vkd3d-shader/hlsl: Consider register() as manual packing for resource fields.

This commit is contained in:
Francisco Casas 2023-03-01 15:57:31 -03:00 committed by Alexandre Julliard
parent 70ff7aaddd
commit f3e81327dc
Notes: Alexandre Julliard 2023-04-04 22:35:22 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/106
2 changed files with 7 additions and 6 deletions

View File

@ -2994,10 +2994,11 @@ static void validate_buffer_offsets(struct hlsl_ctx *ctx)
LIST_FOR_EACH_ENTRY(var1, &ctx->extern_vars, struct hlsl_ir_var, extern_entry)
{
buffer = var1->buffer;
if (!buffer)
if (!buffer || buffer == ctx->globals_buffer)
continue;
if (var1->reg_reservation.offset_type == 'c')
if (var1->reg_reservation.offset_type
|| (var1->data_type->class == HLSL_CLASS_OBJECT && var1->reg_reservation.reg_type))
buffer->manually_packed_elements = true;
else
buffer->automatically_packed_elements = true;

View File

@ -607,7 +607,7 @@ float4 main() : sv_target
}
% register() can be used instead of packoffset().
[pixel shader todo]
[pixel shader]
cbuffer buffer
{
float4 foo : packoffset(c0);
@ -619,7 +619,7 @@ float4 main() : sv_target
return 0;
}
[pixel shader todo]
[pixel shader]
cbuffer buffer
{
float4 foo : packoffset(c0);
@ -632,7 +632,7 @@ float4 main() : sv_target
}
% Using register() alone is considered manual packing for resources, so the other fields expect packoffset().
[pixel shader fail todo]
[pixel shader fail]
cbuffer buffer
{
float4 foo;
@ -644,7 +644,7 @@ float4 main() : sv_target
return 0;
}
[pixel shader fail todo]
[pixel shader fail]
cbuffer buffer
{
float4 foo;