vkd3d-shader/hlsl: Do not define a separate scope for function parameters.

Remove the no longer needed code to detect redefinition in this case.
This commit is contained in:
Elizabeth Figura
2024-12-07 18:49:35 -06:00
committed by Henri Verbeet
parent 75ef230fbe
commit 2863d86bcc
Notes: Henri Verbeet 2025-01-29 18:04:53 +01:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1359
3 changed files with 14 additions and 23 deletions

View File

@@ -93,7 +93,7 @@ char *hlsl_sprintf_alloc(struct hlsl_ctx *ctx, const char *fmt, ...)
return ret;
}
bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var)
bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl)
{
struct hlsl_scope *scope = ctx->cur_scope;
struct hlsl_ir_var *var;
@@ -105,15 +105,6 @@ bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var
if (var->name && !strcmp(decl->name, var->name))
return false;
}
if (local_var && scope->upper->upper == ctx->globals)
{
/* Check whether the variable redefines a function parameter. */
LIST_FOR_EACH_ENTRY(var, &scope->upper->vars, struct hlsl_ir_var, scope_entry)
{
if (var->name && !strcmp(decl->name, var->name))
return false;
}
}
}
list_add_tail(&scope->vars, &decl->scope_entry);