On Mon, Apr 5, 2021 at 6:32 AM Zebediah Figura zfigura@codeweavers.com wrote:
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
libs/vkd3d-shader/hlsl_codegen.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 990c9540..734fa027 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -838,9 +838,25 @@ static void allocate_const_registers_recurse(struct list *instrs, struct livenes } }
-static void allocate_const_registers(struct hlsl_ir_function_decl *entry_func) +static void allocate_const_registers(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func) { struct liveness liveness = {0};
- struct hlsl_ir_var *var;
- LIST_FOR_EACH_ENTRY(var, &ctx->globals->vars, struct hlsl_ir_var, scope_entry)
- {
if (var->is_uniform && var->last_read)
{
if (var->data_type->reg_size > 1)
var->reg = allocate_range(&liveness, 1, INT_MAX, var->data_type->reg_size);
else
{
var->reg = allocate_register(&liveness, 1, INT_MAX, 4);
var->reg.writemask = (1 << var->data_type->dimx) - 1;
}
TRACE("Allocated %s to %s.\n", var->name, debug_register('c', var->reg, var->data_type));
}
- }
I just noticed that this uses INT_MAX, like the old version of patch 5/6. There's also the "1u" thing...