Module: vkd3d Branch: master Commit: 69c3946c85221beda173bccea0aa97c2e4736cd5 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/69c3946c85221beda173bccea0aa97...
Author: Conor McCarthy cmccarthy@codeweavers.com Date: Tue Nov 14 00:07:01 2023 +1000
vkd3d-shader/spirv: Support declared component type and count in indexable temps.
---
libs/vkd3d-shader/spirv.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 956389dc..2eee09d8 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5493,14 +5493,12 @@ static void spirv_compiler_emit_dcl_indexable_temp(struct spirv_compiler *compil { const struct vkd3d_shader_indexable_temp *temp = &instruction->declaration.indexable_temp; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; + enum vkd3d_shader_component_type component_type; struct vkd3d_shader_register reg; struct vkd3d_symbol reg_symbol; size_t function_location; uint32_t id;
- if (temp->component_count != 4) - FIXME("Unhandled component count %u.\n", temp->component_count); - vsir_register_init(®, VKD3DSPR_IDXTEMP, VKD3D_DATA_FLOAT, 1); reg.idx[0].offset = temp->register_idx;
@@ -5516,16 +5514,17 @@ static void spirv_compiler_emit_dcl_indexable_temp(struct spirv_compiler *compil function_location = spirv_compiler_get_current_function_location(compiler); vkd3d_spirv_begin_function_stream_insertion(builder, function_location);
+ component_type = vkd3d_component_type_from_data_type(temp->data_type); id = spirv_compiler_emit_array_variable(compiler, &builder->function_stream, - SpvStorageClassFunction, VKD3D_SHADER_COMPONENT_FLOAT, VKD3D_VEC4_SIZE, &temp->register_size, 1); + SpvStorageClassFunction, component_type, temp->component_count, &temp->register_size, 1);
spirv_compiler_emit_register_debug_name(builder, id, ®);
vkd3d_spirv_end_function_stream_insertion(builder);
vkd3d_symbol_make_register(®_symbol, ®); - vkd3d_symbol_set_register_info(®_symbol, id, - SpvStorageClassFunction, VKD3D_SHADER_COMPONENT_FLOAT, VKD3DSP_WRITEMASK_ALL); + vkd3d_symbol_set_register_info(®_symbol, id, SpvStorageClassFunction, + component_type, vkd3d_write_mask_from_component_count(temp->component_count)); spirv_compiler_put_symbol(compiler, ®_symbol); }