Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- libs/vkd3d-shader/spirv.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 5781ce18..999abd68 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -6877,14 +6877,22 @@ static void vkd3d_dxbc_compiler_emit_shader_epilogue_invocation(struct vkd3d_dxb { if (compiler->private_output_variable[i]) { + uint32_t argument_id = compiler->private_output_variable[i]; unsigned int argument_idx = count++; - arguments[argument_idx] = compiler->private_output_variable[i];
if (compiler->private_output_variable_array_idx[i]) { - arguments[argument_idx] = vkd3d_spirv_build_op_access_chain1(builder, ptr_type_id, - arguments[argument_idx], compiler->private_output_variable_array_idx[i]); + uint32_t tmp_id; + + tmp_id = vkd3d_spirv_build_op_access_chain1(builder, ptr_type_id, + argument_id, compiler->private_output_variable_array_idx[i]); + tmp_id = vkd3d_spirv_build_op_load(builder, type_id, tmp_id, SpvMemoryAccessMaskNone); + argument_id = vkd3d_spirv_build_op_variable(builder, + &builder->global_stream, ptr_type_id, SpvStorageClassPrivate, 0); + vkd3d_spirv_build_op_store(builder, argument_id, tmp_id, SpvMemoryAccessMaskNone); } + + arguments[argument_idx] = argument_id; } }