From 790f35533ba9449db31cc2f6c4a45620a792e27b Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 3 Oct 2024 16:50:23 +0200 Subject: [PATCH] vkd3d-shader/glsl: vkd3d-shader/glsl: Implement support for VKD3D_SHADER_COMPONENT_INT inputs. --- libs/vkd3d-shader/glsl.c | 6 ++++++ tests/hlsl/bool-semantics.shader_test | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/glsl.c b/libs/vkd3d-shader/glsl.c index 4dc95899..ce81e922 100644 --- a/libs/vkd3d-shader/glsl.c +++ b/libs/vkd3d-shader/glsl.c @@ -1013,6 +1013,9 @@ static void shader_glsl_shader_prologue(struct vkd3d_glsl_generator *gen) case VKD3D_SHADER_COMPONENT_UINT: vkd3d_string_buffer_printf(buffer, " = uintBitsToFloat(shader_in_%u)", i); break; + case VKD3D_SHADER_COMPONENT_INT: + vkd3d_string_buffer_printf(buffer, " = intBitsToFloat(shader_in_%u)", i); + break; default: vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL, "Internal compiler error: Unhandled input component type %#x.", e->component_type); @@ -1663,6 +1666,9 @@ static void shader_glsl_generate_input_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/bool-semantics.shader_test b/tests/hlsl/bool-semantics.shader_test index 67bdfb56..b04ee1a1 100644 --- a/tests/hlsl/bool-semantics.shader_test +++ b/tests/hlsl/bool-semantics.shader_test @@ -49,5 +49,5 @@ float4 main(struct input i) : sv_target } [test] -todo(glsl) draw triangle strip 4 +draw triangle strip 4 probe (0, 0, 640, 480) rgba (0.0, 2.0, 2.0, 2.0)