mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Pass the block to add_zero_mipmap_level().
This commit is contained in:
committed by
Henri Verbeet
parent
602103dcf0
commit
b7d7deb983
Notes:
Henri Verbeet
2025-02-05 14:07:07 +01:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1365
@@ -1087,8 +1087,8 @@ static bool lower_calls(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct hlsl_ir_node *add_zero_mipmap_level(struct hlsl_ctx *ctx, struct hlsl_ir_node *index,
|
static struct hlsl_ir_node *add_zero_mipmap_level(struct hlsl_ctx *ctx, struct hlsl_block *block,
|
||||||
const struct vkd3d_shader_location *loc)
|
struct hlsl_ir_node *index, const struct vkd3d_shader_location *loc)
|
||||||
{
|
{
|
||||||
unsigned int dim_count = index->data_type->e.numeric.dimx;
|
unsigned int dim_count = index->data_type->e.numeric.dimx;
|
||||||
struct hlsl_ir_node *store, *zero;
|
struct hlsl_ir_node *store, *zero;
|
||||||
@@ -1105,19 +1105,19 @@ static struct hlsl_ir_node *add_zero_mipmap_level(struct hlsl_ctx *ctx, struct h
|
|||||||
hlsl_init_simple_deref_from_var(&coords_deref, coords);
|
hlsl_init_simple_deref_from_var(&coords_deref, coords);
|
||||||
if (!(store = hlsl_new_store_index(ctx, &coords_deref, NULL, index, (1u << dim_count) - 1, loc)))
|
if (!(store = hlsl_new_store_index(ctx, &coords_deref, NULL, index, (1u << dim_count) - 1, loc)))
|
||||||
return NULL;
|
return NULL;
|
||||||
list_add_after(&index->entry, &store->entry);
|
hlsl_block_add_instr(block, store);
|
||||||
|
|
||||||
if (!(zero = hlsl_new_uint_constant(ctx, 0, loc)))
|
if (!(zero = hlsl_new_uint_constant(ctx, 0, loc)))
|
||||||
return NULL;
|
return NULL;
|
||||||
list_add_after(&store->entry, &zero->entry);
|
hlsl_block_add_instr(block, zero);
|
||||||
|
|
||||||
if (!(store = hlsl_new_store_index(ctx, &coords_deref, NULL, zero, 1u << dim_count, loc)))
|
if (!(store = hlsl_new_store_index(ctx, &coords_deref, NULL, zero, 1u << dim_count, loc)))
|
||||||
return NULL;
|
return NULL;
|
||||||
list_add_after(&zero->entry, &store->entry);
|
hlsl_block_add_instr(block, store);
|
||||||
|
|
||||||
if (!(coords_load = hlsl_new_var_load(ctx, coords, loc)))
|
if (!(coords_load = hlsl_new_var_load(ctx, coords, loc)))
|
||||||
return NULL;
|
return NULL;
|
||||||
list_add_after(&store->entry, &coords_load->node.entry);
|
hlsl_block_add_instr(block, &coords_load->node);
|
||||||
|
|
||||||
return &coords_load->node;
|
return &coords_load->node;
|
||||||
}
|
}
|
||||||
@@ -1283,7 +1283,7 @@ static bool lower_index_loads(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr,
|
|||||||
VKD3D_ASSERT(coords->data_type->e.numeric.type == HLSL_TYPE_UINT);
|
VKD3D_ASSERT(coords->data_type->e.numeric.type == HLSL_TYPE_UINT);
|
||||||
VKD3D_ASSERT(coords->data_type->e.numeric.dimx == dim_count);
|
VKD3D_ASSERT(coords->data_type->e.numeric.dimx == dim_count);
|
||||||
|
|
||||||
if (!(coords = add_zero_mipmap_level(ctx, coords, &instr->loc)))
|
if (!(coords = add_zero_mipmap_level(ctx, block, coords, &instr->loc)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
params.type = HLSL_RESOURCE_LOAD;
|
params.type = HLSL_RESOURCE_LOAD;
|
||||||
|
|||||||
Reference in New Issue
Block a user