spirv, compiler: add "bool nv" to shader_info.mesh

Not knowing whether we deal with the NV or EXT extension
makes implementation difficult for Intel HW.
NV support will be dropped at some point, so
this ugliness will go away eventually.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>
This commit is contained in:
Marcin Ślusarz 2022-06-07 13:03:24 +02:00 committed by Marge Bot
parent 7d1bcf1f55
commit 14911e8f83
2 changed files with 13 additions and 1 deletions

View file

@ -540,6 +540,9 @@ typedef struct shader_info {
uint16_t max_vertices_out;
uint16_t max_primitives_out;
uint16_t primitive_type; /* GL_POINTS, GL_LINES or GL_TRIANGLES. */
/* TODO: remove this when we stop supporting NV_mesh_shader. */
bool nv;
} mesh;
};
} shader_info;

View file

@ -4458,9 +4458,18 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
break;
}
case SpvOpExtension: {
/* Implementing both NV_mesh_shader and EXT_mesh_shader
* is difficult without knowing which we're dealing with.
* TODO: remove this when we stop supporting NV_mesh_shader.
*/
const char *ext_name = (const char *)&w[1];
if (strcmp(ext_name, "SPV_NV_mesh_shader") == 0)
b->shader->info.mesh.nv = true;
break;
}
case SpvOpSourceExtension:
case SpvOpSourceContinued:
case SpvOpExtension:
case SpvOpModuleProcessed:
/* Unhandled, but these are for debug so that's ok. */
break;