mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader: Allocate the $Params buffer in hlsl_ctx_init().
For clarity. Signed-off-by: Zebediah Figura <zfigura@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:
committed by
Alexandre Julliard
parent
e292351fa9
commit
1ed82b9fc4
@ -1142,27 +1142,16 @@ static void calculate_buffer_offset(struct hlsl_ir_var *var)
|
||||
|
||||
static void allocate_buffers(struct hlsl_ctx *ctx)
|
||||
{
|
||||
struct hlsl_buffer *buffer, *params_buffer;
|
||||
struct hlsl_buffer *buffer;
|
||||
struct hlsl_ir_var *var;
|
||||
uint32_t index = 0;
|
||||
|
||||
if (!(params_buffer = hlsl_new_buffer(ctx, HLSL_BUFFER_CONSTANT,
|
||||
hlsl_strdup(ctx, "$Params"), NULL, ctx->location)))
|
||||
return;
|
||||
|
||||
/* The $Globals and $Params buffers should be allocated first, before all
|
||||
* explicit buffers. */
|
||||
list_remove(¶ms_buffer->entry);
|
||||
list_add_head(&ctx->buffers, ¶ms_buffer->entry);
|
||||
list_remove(&ctx->globals_buffer->entry);
|
||||
list_add_head(&ctx->buffers, &ctx->globals_buffer->entry);
|
||||
|
||||
LIST_FOR_EACH_ENTRY(var, &ctx->extern_vars, struct hlsl_ir_var, extern_entry)
|
||||
{
|
||||
if (var->is_uniform)
|
||||
{
|
||||
if (var->is_param)
|
||||
var->buffer = params_buffer;
|
||||
var->buffer = ctx->params_buffer;
|
||||
|
||||
calculate_buffer_offset(var);
|
||||
}
|
||||
|
Reference in New Issue
Block a user