From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d-shader/spirv.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 06abe65a58fe..0813f49516aa 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2942,6 +2942,12 @@ static void vkd3d_dxbc_compiler_decorate_builtin(struct vkd3d_dxbc_compiler *com case SpvBuiltInLayer: vkd3d_spirv_enable_capability(builder, SpvCapabilityGeometry); break; + case SpvBuiltInViewportIndex: + vkd3d_spirv_enable_capability(builder, SpvCapabilityMultiViewport); + break; + case SpvBuiltInSampleId: + vkd3d_spirv_enable_capability(builder, SpvCapabilitySampleRateShading); + break; default: break; } @@ -3012,14 +3018,6 @@ static uint32_t sv_front_face_fixup(struct vkd3d_dxbc_compiler *compiler, return vkd3d_dxbc_compiler_emit_bool_to_int(compiler, 1, front_facing_id); }
-static uint32_t sv_sample_index(struct vkd3d_dxbc_compiler *compiler, uint32_t id) -{ - struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; - - vkd3d_spirv_enable_capability(builder, SpvCapabilitySampleRateShading); - return id; -} - struct vkd3d_spirv_builtin { enum vkd3d_component_type component_type; @@ -3049,10 +3047,11 @@ vkd3d_system_value_builtins[] = {VKD3D_SIV_INSTANCE_ID, {VKD3D_TYPE_INT, 1, SpvBuiltInInstanceIndex, sv_instance_id_fixup}},
{VKD3D_SIV_RENDER_TARGET_ARRAY_INDEX, {VKD3D_TYPE_INT, 1, SpvBuiltInLayer}}, + {VKD3D_SIV_VIEWPORT_ARRAY_INDEX, {VKD3D_TYPE_INT, 1, SpvBuiltInViewportIndex}},
{VKD3D_SIV_IS_FRONT_FACE, {VKD3D_TYPE_BOOL, 1, SpvBuiltInFrontFacing, sv_front_face_fixup}},
- {VKD3D_SIV_SAMPLE_INDEX, {VKD3D_TYPE_UINT, 1, SpvBuiltInSampleId, sv_sample_index}}, + {VKD3D_SIV_SAMPLE_INDEX, {VKD3D_TYPE_UINT, 1, SpvBuiltInSampleId}},
{VKD3D_SIV_CLIP_DISTANCE, {VKD3D_TYPE_FLOAT, 1, SpvBuiltInClipDistance, NULL, true}}, {VKD3D_SIV_CULL_DISTANCE, {VKD3D_TYPE_FLOAT, 1, SpvBuiltInCullDistance, NULL, true}},