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

View File

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