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

This commit is contained in:
Henri Verbeet 2024-10-25 15:48:08 +02:00
parent 5df836c513
commit 466d849c72
Notes: Henri Verbeet 2024-11-06 23:02:41 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1232
2 changed files with 10 additions and 4 deletions

View File

@ -1390,6 +1390,9 @@ static void shader_glsl_shader_epilogue(struct vkd3d_glsl_generator *gen)
case VKD3D_SHADER_COMPONENT_UINT: case VKD3D_SHADER_COMPONENT_UINT:
vkd3d_string_buffer_printf(buffer, " = floatBitsToUint(%s_out[%u])", gen->prefix, e->register_index); vkd3d_string_buffer_printf(buffer, " = floatBitsToUint(%s_out[%u])", gen->prefix, e->register_index);
break; break;
case VKD3D_SHADER_COMPONENT_INT:
vkd3d_string_buffer_printf(buffer, " = floatBitsToInt(%s_out[%u])", gen->prefix, e->register_index);
break;
default: default:
vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL, vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL,
"Internal compiler error: Unhandled output component type %#x.", e->component_type); "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: case VKD3D_SHADER_COMPONENT_UINT:
vkd3d_string_buffer_printf(buffer, "uvec4"); vkd3d_string_buffer_printf(buffer, "uvec4");
break; break;
case VKD3D_SHADER_COMPONENT_INT:
vkd3d_string_buffer_printf(buffer, "ivec4");
break;
case VKD3D_SHADER_COMPONENT_FLOAT: case VKD3D_SHADER_COMPONENT_FLOAT:
vkd3d_string_buffer_printf(buffer, "vec4"); vkd3d_string_buffer_printf(buffer, "vec4");
break; break;

View File

@ -39,7 +39,7 @@ int4 main() : sv_target
} }
[test] [test]
todo(mvk & vulkan | glsl | msl) draw quad todo(mvk & vulkan | msl) draw quad
todo(mvk) probe (0, 0) rgbai (0, 22, -22, -1000) todo(mvk) probe (0, 0) rgbai (0, 22, -22, -1000)
[pixel shader] [pixel shader]
@ -83,7 +83,7 @@ int4 main() : sv_target
} }
[test] [test]
todo(mvk & vulkan | glsl | msl) draw quad todo(mvk & vulkan | msl) draw quad
todo(mvk) probe (0, 0) rgbai (0, 22, -22, -1000) todo(mvk) probe (0, 0) rgbai (0, 22, -22, -1000)
[pixel shader] [pixel shader]
@ -127,7 +127,7 @@ int4 main() : sv_target
} }
[test] [test]
todo(glsl | msl) draw quad todo(msl) draw quad
probe (0, 0) rgbai (0, 22, -22, -1000) probe (0, 0) rgbai (0, 22, -22, -1000)
[pixel shader] [pixel shader]
@ -171,7 +171,7 @@ int4 main() : sv_target
} }
[test] [test]
todo(mvk & vulkan | glsl | msl) draw quad todo(mvk & vulkan | msl) draw quad
todo(mvk) probe (0, 0) ri (-22) todo(mvk) probe (0, 0) ri (-22)
[pixel shader] [pixel shader]