vkd3d-shader/hlsl: Generate synthetic temps for object uniforms as well.

These can be assigned to when compatibility mode is used.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-10-15 16:54:08 -05:00 committed by Alexandre Julliard
parent 5e3b8b70fc
commit 423213fb05

View File

@ -1310,35 +1310,26 @@ int hlsl_emit_dxbc(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_fun
LIST_FOR_EACH_ENTRY(var, &ctx->globals->vars, struct hlsl_ir_var, scope_entry)
{
if (var->data_type->type == HLSL_CLASS_OBJECT)
list_add_tail(&ctx->extern_vars, &var->extern_entry);
else if (var->modifiers & HLSL_STORAGE_UNIFORM)
if (var->modifiers & HLSL_STORAGE_UNIFORM)
prepend_uniform_copy(ctx, entry_func->body, var);
}
LIST_FOR_EACH_ENTRY(var, entry_func->parameters, struct hlsl_ir_var, param_entry)
{
if (var->data_type->type == HLSL_CLASS_OBJECT)
if (var->data_type->type == HLSL_CLASS_OBJECT || (var->modifiers & HLSL_STORAGE_UNIFORM))
{
list_add_tail(&ctx->extern_vars, &var->extern_entry);
prepend_uniform_copy(ctx, entry_func->body, var);
}
else
{
if (var->modifiers & HLSL_STORAGE_UNIFORM)
{
prepend_uniform_copy(ctx, entry_func->body, var);
}
else
{
if (var->data_type->type != HLSL_CLASS_STRUCT && !var->semantic.name)
hlsl_error(ctx, var->loc, VKD3D_SHADER_ERROR_HLSL_MISSING_SEMANTIC,
"Parameter \"%s\" is missing a semantic.", var->name);
if (var->data_type->type != HLSL_CLASS_STRUCT && !var->semantic.name)
hlsl_error(ctx, var->loc, VKD3D_SHADER_ERROR_HLSL_MISSING_SEMANTIC,
"Parameter \"%s\" is missing a semantic.", var->name);
if (var->modifiers & HLSL_STORAGE_IN)
prepend_input_var_copy(ctx, entry_func->body, var);
if (var->modifiers & HLSL_STORAGE_OUT)
append_output_var_copy(ctx, entry_func->body, var);
}
if (var->modifiers & HLSL_STORAGE_IN)
prepend_input_var_copy(ctx, entry_func->body, var);
if (var->modifiers & HLSL_STORAGE_OUT)
append_output_var_copy(ctx, entry_func->body, var);
}
}
if (entry_func->return_var)