mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Use vsir_program_append() in sm1_generate_vsir_constant_defs().
This commit is contained in:
committed by
Henri Verbeet
parent
8717fe9c47
commit
81488ce330
Notes:
Henri Verbeet
2025-08-04 15:08:37 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1666
@@ -8282,7 +8282,6 @@ static uint32_t generate_vsir_get_src_swizzle(uint32_t src_writemask, uint32_t d
|
|||||||
static void sm1_generate_vsir_constant_defs(struct hlsl_ctx *ctx, struct vsir_program *program,
|
static void sm1_generate_vsir_constant_defs(struct hlsl_ctx *ctx, struct vsir_program *program,
|
||||||
struct hlsl_block *block)
|
struct hlsl_block *block)
|
||||||
{
|
{
|
||||||
struct vkd3d_shader_instruction_array *instructions = &program->instructions;
|
|
||||||
struct vkd3d_shader_dst_param *dst_param;
|
struct vkd3d_shader_dst_param *dst_param;
|
||||||
struct vkd3d_shader_src_param *src_param;
|
struct vkd3d_shader_src_param *src_param;
|
||||||
struct vkd3d_shader_instruction *ins;
|
struct vkd3d_shader_instruction *ins;
|
||||||
@@ -8292,19 +8291,17 @@ static void sm1_generate_vsir_constant_defs(struct hlsl_ctx *ctx, struct vsir_pr
|
|||||||
{
|
{
|
||||||
const struct hlsl_constant_register *constant_reg = &ctx->constant_defs.regs[i];
|
const struct hlsl_constant_register *constant_reg = &ctx->constant_defs.regs[i];
|
||||||
|
|
||||||
if (!shader_instruction_array_reserve(instructions, instructions->count + 1))
|
if (!(ins = vsir_program_append(program)))
|
||||||
{
|
{
|
||||||
ctx->result = VKD3D_ERROR_OUT_OF_MEMORY;
|
ctx->result = VKD3D_ERROR_OUT_OF_MEMORY;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ins = &instructions->elements[instructions->count];
|
|
||||||
if (!vsir_instruction_init_with_params(program, ins, &constant_reg->loc, VSIR_OP_DEF, 1, 1))
|
if (!vsir_instruction_init_with_params(program, ins, &constant_reg->loc, VSIR_OP_DEF, 1, 1))
|
||||||
{
|
{
|
||||||
|
vsir_instruction_init(ins, &constant_reg->loc, VSIR_OP_NOP);
|
||||||
ctx->result = VKD3D_ERROR_OUT_OF_MEMORY;
|
ctx->result = VKD3D_ERROR_OUT_OF_MEMORY;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
++instructions->count;
|
|
||||||
|
|
||||||
dst_param = &ins->dst[0];
|
dst_param = &ins->dst[0];
|
||||||
vsir_register_init(&dst_param->reg, VKD3DSPR_CONST, VSIR_DATA_F32, 1);
|
vsir_register_init(&dst_param->reg, VKD3DSPR_CONST, VSIR_DATA_F32, 1);
|
||||||
|
Reference in New Issue
Block a user