From bd88613c3e3c2d57cbaf5a584338cff8ebb6c744 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 28 Jul 2021 18:59:11 -0500 Subject: [PATCH] vkd3d-shader: Use vkd3d_bytecode_buffer helpers directly in shader_write_root_parameters(). Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d-shader/dxbc.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 67844d5e..8cd6e564 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -3075,12 +3075,9 @@ static int shader_write_root_parameters(struct root_signature_writer_context *co parameters_position = bytecode_get_size(buffer); for (i = 0; i < parameter_count; ++i) { - if (!write_dword(context, versioned_root_signature_get_parameter_type(desc, i))) - goto fail; - if (!write_dword(context, versioned_root_signature_get_parameter_shader_visibility(desc, i))) - goto fail; - if (!write_dword(context, 0xffffffff)) /* offset */ - goto fail; + put_u32(buffer, versioned_root_signature_get_parameter_type(desc, i)); + put_u32(buffer, versioned_root_signature_get_parameter_shader_visibility(desc, i)); + put_u32(buffer, 0xffffffff); /* offset */ } for (i = 0; i < parameter_count; ++i) @@ -3116,11 +3113,6 @@ static int shader_write_root_parameters(struct root_signature_writer_context *co } return VKD3D_OK; - -fail: - vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY, - "Out of memory while writing root signature root parameters."); - return VKD3D_ERROR_OUT_OF_MEMORY; } static int shader_write_static_samplers(struct root_signature_writer_context *context,