spirv: handle ViewportMaskNV builtin/cap from SPV_NV_mesh_shader

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14263>
This commit is contained in:
Marcin Ślusarz
2021-12-17 17:00:08 +01:00
committed by Marge Bot
parent 1619279219
commit 4cb7dcb097
3 changed files with 9 additions and 0 deletions

View File

@@ -85,6 +85,7 @@ struct spirv_supported_capabilities {
bool float_controls;
bool shader_clock;
bool shader_viewport_index_layer;
bool shader_viewport_mask_nv;
bool sparse_residency;
bool stencil_export;
bool storage_8bit;

View File

@@ -4805,6 +4805,10 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
spv_check_supported(mesh_shading_nv, cap);
break;
case SpvCapabilityShaderViewportMaskNV:
spv_check_supported(shader_viewport_mask_nv, cap);
break;
default:
vtn_fail("Unhandled capability: %s (%u)",
spirv_capability_to_string(cap), cap);

View File

@@ -864,6 +864,10 @@ vtn_get_builtin_location(struct vtn_builder *b,
else
vtn_fail("invalid stage for SpvBuiltInViewportIndex");
break;
case SpvBuiltInViewportMaskNV:
*location = VARYING_SLOT_VIEWPORT_MASK;
*mode = nir_var_shader_out;
break;
case SpvBuiltInTessLevelOuter:
*location = VARYING_SLOT_TESS_LEVEL_OUTER;
break;