vkd3d-shader/glsl: vkd3d-shader/glsl: Implement support for VKD3D_SHADER_COMPONENT_INT inputs.

This commit is contained in:
Henri Verbeet 2024-10-03 16:50:23 +02:00
parent bb0e4506a6
commit 790f35533b
Notes: Henri Verbeet 2024-10-09 13:19:34 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1162
2 changed files with 7 additions and 1 deletions

View File

@ -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;

View File

@ -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)