mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Fix numeric offset of object fields.
This commit is contained in:
parent
86893bc7f4
commit
0ceecd1225
Notes:
Alexandre Julliard
2023-04-13 23:20:28 +02:00
Approved-by: Zebediah Figura (@zfigura) 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/154
@ -216,7 +216,8 @@ unsigned int hlsl_type_get_sm4_offset(const struct hlsl_type *type, unsigned int
|
|||||||
* (b) the type would cross a vec4 boundary; i.e. a vec3 and a
|
* (b) the type would cross a vec4 boundary; i.e. a vec3 and a
|
||||||
* vec1 can be packed together, but not a vec3 and a vec2.
|
* vec1 can be packed together, but not a vec3 and a vec2.
|
||||||
*/
|
*/
|
||||||
if (type->class > HLSL_CLASS_LAST_NUMERIC || (offset & 3) + type->reg_size[HLSL_REGSET_NUMERIC] > 4)
|
if (type->class == HLSL_CLASS_STRUCT || type->class == HLSL_CLASS_ARRAY
|
||||||
|
|| (offset & 3) + type->reg_size[HLSL_REGSET_NUMERIC] > 4)
|
||||||
return align(offset, 4);
|
return align(offset, 4);
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ float4 main() : sv_target
|
|||||||
uniform 0 float4 1.0 2.0 3.0 4.0
|
uniform 0 float4 1.0 2.0 3.0 4.0
|
||||||
uniform 4 float4 5.0 6.0 7.0 8.0
|
uniform 4 float4 5.0 6.0 7.0 8.0
|
||||||
draw quad
|
draw quad
|
||||||
todo probe all rgba (1.0, 2.0, 3.0, 0.0)
|
probe all rgba (1.0, 2.0, 3.0, 0.0)
|
||||||
|
|
||||||
|
|
||||||
[pixel shader]
|
[pixel shader]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user