From 466d849c721fe154a81c9dc7462470b66b9034ff Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Fri, 25 Oct 2024 15:48:08 +0200 Subject: [PATCH] vkd3d-shader/glsl: Implement support for VKD3D_SHADER_COMPONENT_INT outputs. --- libs/vkd3d-shader/glsl.c | 6 ++++++ tests/hlsl/rt-format-mismatch.shader_test | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/glsl.c b/libs/vkd3d-shader/glsl.c index 363054cb..97d3adce 100644 --- a/libs/vkd3d-shader/glsl.c +++ b/libs/vkd3d-shader/glsl.c @@ -1390,6 +1390,9 @@ static void shader_glsl_shader_epilogue(struct vkd3d_glsl_generator *gen) case VKD3D_SHADER_COMPONENT_UINT: vkd3d_string_buffer_printf(buffer, " = floatBitsToUint(%s_out[%u])", gen->prefix, e->register_index); break; + case VKD3D_SHADER_COMPONENT_INT: + vkd3d_string_buffer_printf(buffer, " = floatBitsToInt(%s_out[%u])", gen->prefix, e->register_index); + break; default: vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL, "Internal compiler error: Unhandled output component type %#x.", e->component_type); @@ -2213,6 +2216,9 @@ static void shader_glsl_generate_output_declarations(struct vkd3d_glsl_generator case VKD3D_SHADER_COMPONENT_UINT: vkd3d_string_buffer_printf(buffer, "uvec4"); break; + case VKD3D_SHADER_COMPONENT_INT: + vkd3d_string_buffer_printf(buffer, "ivec4"); + break; case VKD3D_SHADER_COMPONENT_FLOAT: vkd3d_string_buffer_printf(buffer, "vec4"); break; diff --git a/tests/hlsl/rt-format-mismatch.shader_test b/tests/hlsl/rt-format-mismatch.shader_test index b63dea52..ddf6e4c7 100644 --- a/tests/hlsl/rt-format-mismatch.shader_test +++ b/tests/hlsl/rt-format-mismatch.shader_test @@ -39,7 +39,7 @@ int4 main() : sv_target } [test] -todo(mvk & vulkan | glsl | msl) draw quad +todo(mvk & vulkan | msl) draw quad todo(mvk) probe (0, 0) rgbai (0, 22, -22, -1000) [pixel shader] @@ -83,7 +83,7 @@ int4 main() : sv_target } [test] -todo(mvk & vulkan | glsl | msl) draw quad +todo(mvk & vulkan | msl) draw quad todo(mvk) probe (0, 0) rgbai (0, 22, -22, -1000) [pixel shader] @@ -127,7 +127,7 @@ int4 main() : sv_target } [test] -todo(glsl | msl) draw quad +todo(msl) draw quad probe (0, 0) rgbai (0, 22, -22, -1000) [pixel shader] @@ -171,7 +171,7 @@ int4 main() : sv_target } [test] -todo(mvk & vulkan | glsl | msl) draw quad +todo(mvk & vulkan | msl) draw quad todo(mvk) probe (0, 0) ri (-22) [pixel shader]