Henri Verbeet : vkd3d-shader: Properly handle scalar destinations in vkd3d_dxbc_compiler_emit_store().
Alexandre Julliard
julliard at winehq.org
Thu Aug 20 16:00:26 CDT 2020
Module: vkd3d
Branch: master
Commit: a451af9c5194228e2228bcc685d2245a2014eadf
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=a451af9c5194228e2228bcc685d2245a2014eadf
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Aug 20 23:57:44 2020 +0430
vkd3d-shader: Properly handle scalar destinations in vkd3d_dxbc_compiler_emit_store().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
libs/vkd3d-shader/spirv.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index ea696a2..c677963 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -3385,6 +3385,16 @@ static void vkd3d_dxbc_compiler_emit_store(struct vkd3d_dxbc_compiler *compiler,
assert(write_mask);
component_count = vkd3d_write_mask_component_count(write_mask);
+ dst_component_count = vkd3d_write_mask_component_count(dst_write_mask);
+
+ if (dst_component_count == 1 && component_count != 1)
+ {
+ type_id = vkd3d_spirv_get_type_id(builder, component_type, 1);
+ val_id = vkd3d_spirv_build_op_composite_extract1(builder, type_id, val_id,
+ vkd3d_write_mask_get_component_idx(dst_write_mask));
+ write_mask &= dst_write_mask;
+ component_count = 1;
+ }
if (component_count == 1)
{
@@ -3392,7 +3402,6 @@ static void vkd3d_dxbc_compiler_emit_store(struct vkd3d_dxbc_compiler *compiler,
dst_id, dst_write_mask, component_type, storage_class, write_mask, val_id);
}
- dst_component_count = vkd3d_write_mask_component_count(dst_write_mask);
if (dst_component_count != component_count)
{
type_id = vkd3d_spirv_get_type_id(builder, component_type, dst_component_count);
More information about the wine-cvs
mailing list