mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/fx: Use variable unpacked size when setting buffer sizes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Henri Verbeet
parent
9f0185f304
commit
e33189546a
Notes:
Henri Verbeet
2025-06-02 21:02:29 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1528
@@ -994,16 +994,6 @@ static void write_fx_2_pass(struct hlsl_ir_var *var, struct fx_write_context *fx
|
|||||||
fx->shader_count++;
|
fx->shader_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t get_fx_4_type_size(const struct hlsl_type *type)
|
|
||||||
{
|
|
||||||
uint32_t elements_count;
|
|
||||||
|
|
||||||
elements_count = hlsl_get_multiarray_size(type);
|
|
||||||
type = hlsl_get_multiarray_element_type(type);
|
|
||||||
|
|
||||||
return type->reg_size[HLSL_REGSET_NUMERIC] * sizeof(float) * elements_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum fx_4_type_constants
|
enum fx_4_type_constants
|
||||||
{
|
{
|
||||||
/* Numeric types encoding */
|
/* Numeric types encoding */
|
||||||
@@ -3295,6 +3285,8 @@ static void write_fx_4_buffer(struct hlsl_buffer *b, struct fx_write_context *fx
|
|||||||
size = 0;
|
size = 0;
|
||||||
LIST_FOR_EACH_ENTRY(var, &ctx->extern_vars, struct hlsl_ir_var, extern_entry)
|
LIST_FOR_EACH_ENTRY(var, &ctx->extern_vars, struct hlsl_ir_var, extern_entry)
|
||||||
{
|
{
|
||||||
|
uint32_t unpacked_size;
|
||||||
|
|
||||||
if (!is_numeric_fx_4_type(var->data_type))
|
if (!is_numeric_fx_4_type(var->data_type))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -3302,7 +3294,9 @@ static void write_fx_4_buffer(struct hlsl_buffer *b, struct fx_write_context *fx
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
write_fx_4_numeric_variable(var, shared, fx);
|
write_fx_4_numeric_variable(var, shared, fx);
|
||||||
size = max(size, get_fx_4_type_size(var->data_type) + var->buffer_offset * 4);
|
|
||||||
|
unpacked_size = var->data_type->reg_size[HLSL_REGSET_NUMERIC] * sizeof(float);
|
||||||
|
size = max(size, unpacked_size + var->buffer_offset * 4);
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user