From 8d2c59dd350e9ff2b8e93b2f85c3d7e59a5a965e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Sun, 4 Feb 2018 23:58:28 +0100 Subject: [PATCH] libs/vkd3d-shader: Use vkd3d_dxbc_compiler_get_constant_float_vector() in more places. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d-shader/spirv.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 5d310bf8..8a456769 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2614,17 +2614,12 @@ static void vkd3d_dxbc_compiler_emit_store_reg(struct vkd3d_dxbc_compiler *compi static uint32_t vkd3d_dxbc_compiler_emit_sat(struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_register *reg, DWORD write_mask, uint32_t val_id) { - static const float zero[] = {0.0f, 0.0f, 0.0f, 0.0f}; - static const float one[] = {1.0f, 1.0f, 1.0f, 1.0f}; - unsigned int component_count = vkd3d_write_mask_component_count(write_mask); struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; uint32_t type_id, zero_id, one_id; - zero_id = vkd3d_dxbc_compiler_get_constant(compiler, - VKD3D_TYPE_FLOAT, component_count, (const uint32_t *)zero); - one_id = vkd3d_dxbc_compiler_get_constant(compiler, - VKD3D_TYPE_FLOAT, component_count, (const uint32_t *)one); + zero_id = vkd3d_dxbc_compiler_get_constant_float_vector(compiler, 0.0f, component_count); + one_id = vkd3d_dxbc_compiler_get_constant_float_vector(compiler, 1.0f, component_count); type_id = vkd3d_spirv_get_type_id(builder, vkd3d_component_type_from_data_type(reg->data_type), component_count);