=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: libs/vkd3d-shader: Use vkd3d_dxbc_compiler_get_constant_float_vector() in more places.

Alexandre Julliard julliard at winehq.org
Mon Feb 5 12:00:22 CST 2018


Module: vkd3d
Branch: master
Commit: 8d2c59dd350e9ff2b8e93b2f85c3d7e59a5a965e
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=8d2c59dd350e9ff2b8e93b2f85c3d7e59a5a965e

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Sun Feb  4 23:58:28 2018 +0100

libs/vkd3d-shader: Use vkd3d_dxbc_compiler_get_constant_float_vector() in more places.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 5d310bf..8a45676 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);




More information about the wine-cvs mailing list