mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Set the "flat constant" count in sm1_generate_vsir().
Aside from being required in order to produce valid vsir, this is used by vsir_program_scan() to generate descriptor information.
This commit is contained in:
Notes:
Henri Verbeet
2025-09-11 16:15:21 +02:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1724
@@ -10174,7 +10174,10 @@ static void sm1_generate_vsir(struct hlsl_ctx *ctx, const struct vkd3d_shader_co
|
|||||||
struct hlsl_ir_function_decl *func, struct list *semantic_vars,
|
struct hlsl_ir_function_decl *func, struct list *semantic_vars,
|
||||||
struct hlsl_block *body, uint64_t config_flags, struct vsir_program *program)
|
struct hlsl_block *body, uint64_t config_flags, struct vsir_program *program)
|
||||||
{
|
{
|
||||||
|
struct hlsl_ir_var *var;
|
||||||
struct hlsl_block block;
|
struct hlsl_block block;
|
||||||
|
struct hlsl_reg *reg;
|
||||||
|
unsigned int *count;
|
||||||
|
|
||||||
program->ssa_count = 0;
|
program->ssa_count = 0;
|
||||||
program->temp_count = 0;
|
program->temp_count = 0;
|
||||||
@@ -10189,6 +10192,17 @@ static void sm1_generate_vsir(struct hlsl_ctx *ctx, const struct vkd3d_shader_co
|
|||||||
|
|
||||||
sm1_generate_vsir_block(ctx, body, program);
|
sm1_generate_vsir_block(ctx, body, program);
|
||||||
|
|
||||||
|
count = &program->flat_constant_count[VKD3D_SHADER_D3DBC_FLOAT_CONSTANT_REGISTER];
|
||||||
|
LIST_FOR_EACH_ENTRY(var, &ctx->extern_vars, struct hlsl_ir_var, extern_entry)
|
||||||
|
{
|
||||||
|
if (!var->is_uniform)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!(reg = &var->regs[HLSL_REGSET_NUMERIC])->allocation_size)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
*count = max(*count, reg->id + reg->allocation_size);
|
||||||
|
}
|
||||||
program->ssa_count = ctx->ssa_count;
|
program->ssa_count = ctx->ssa_count;
|
||||||
program->temp_count = ctx->temp_count;
|
program->temp_count = ctx->temp_count;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user