mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Don't allow manual and automatic cbuffer offset packing.
This commit is contained in:
committed by
Alexandre Julliard
parent
4448d114ad
commit
60237cb773
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
@@ -678,6 +678,9 @@ struct hlsl_buffer
|
|||||||
unsigned size, used_size;
|
unsigned size, used_size;
|
||||||
/* Register of type 'b' on which the buffer is allocated. */
|
/* Register of type 'b' on which the buffer is allocated. */
|
||||||
struct hlsl_reg reg;
|
struct hlsl_reg reg;
|
||||||
|
|
||||||
|
bool manually_packed_elements;
|
||||||
|
bool automatically_packed_elements;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hlsl_ctx
|
struct hlsl_ctx
|
||||||
|
@@ -2990,6 +2990,25 @@ static void validate_buffer_offsets(struct hlsl_ctx *ctx)
|
|||||||
var1->name, var2->name);
|
var1->name, var2->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LIST_FOR_EACH_ENTRY(var1, &ctx->extern_vars, struct hlsl_ir_var, extern_entry)
|
||||||
|
{
|
||||||
|
buffer = var1->buffer;
|
||||||
|
if (!buffer)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (var1->reg_reservation.offset_type == 'c')
|
||||||
|
buffer->manually_packed_elements = true;
|
||||||
|
else
|
||||||
|
buffer->automatically_packed_elements = true;
|
||||||
|
|
||||||
|
if (buffer->manually_packed_elements && buffer->automatically_packed_elements)
|
||||||
|
{
|
||||||
|
hlsl_error(ctx, &buffer->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_RESERVATION,
|
||||||
|
"packoffset() must be specified for all the buffer elements, or none of them.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void allocate_buffers(struct hlsl_ctx *ctx)
|
static void allocate_buffers(struct hlsl_ctx *ctx)
|
||||||
|
@@ -305,7 +305,7 @@ draw quad
|
|||||||
probe all rgba (512.0, 612.0, 712.0, 812.0)
|
probe all rgba (512.0, 612.0, 712.0, 812.0)
|
||||||
|
|
||||||
|
|
||||||
[pixel shader fail todo]
|
[pixel shader fail]
|
||||||
// packoffset cannot be used unless all elements use it.
|
// packoffset cannot be used unless all elements use it.
|
||||||
cbuffer buffer
|
cbuffer buffer
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user