vkd3d-shader/spirv: Declare indexable temps as Private unless function scope is specified.

This commit is contained in:
Conor McCarthy
2024-01-12 12:47:19 +10:00
committed by Alexandre Julliard
parent 37d9dba512
commit b4b2b0d3ac
Notes: Alexandre Julliard 2024-01-17 22:42:55 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/450
4 changed files with 12 additions and 5 deletions

View File

@@ -5597,7 +5597,10 @@ static void spirv_compiler_emit_dcl_indexable_temp(struct spirv_compiler *compil
SpvStorageClass storage_class;
size_t function_location;
storage_class = SpvStorageClassFunction;
/* Indexable temps may be used by more than one function in hull shaders, and
* declarations generally should not occur within VSIR code blocks unless function
* scope is specified, e.g. DXIL alloca. */
storage_class = temp->has_function_scope ? SpvStorageClassFunction : SpvStorageClassPrivate;
vsir_register_init(&reg, VKD3DSPR_IDXTEMP, VKD3D_DATA_FLOAT, 1);
reg.idx[0].offset = temp->register_idx;