=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d-shader: Check shader visibility for combined samplers.
Alexandre Julliard
julliard at winehq.org
Tue Mar 19 17:09:05 CDT 2019
Module: vkd3d
Branch: master
Commit: 27b4779930d05e308989cb12a5f48a62521e74f0
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=27b4779930d05e308989cb12a5f48a62521e74f0
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Tue Mar 19 14:41:00 2019 +0100
vkd3d-shader: Check shader visibility for combined samplers.
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, 6 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index e13d730..0aa220f 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -2135,7 +2135,7 @@ static struct vkd3d_push_constant_buffer_binding *vkd3d_dxbc_compiler_find_push_
return NULL;
}
-static bool vkd3d_dxbc_compiler_have_combined_sampler(const struct vkd3d_dxbc_compiler *compiler,
+static bool vkd3d_dxbc_compiler_has_combined_sampler(const struct vkd3d_dxbc_compiler *compiler,
const struct vkd3d_shader_register *resource, const struct vkd3d_shader_register *sampler)
{
const struct vkd3d_shader_interface_info *shader_interface = &compiler->shader_interface;
@@ -2152,6 +2152,9 @@ static bool vkd3d_dxbc_compiler_have_combined_sampler(const struct vkd3d_dxbc_co
{
combined_sampler = &shader_interface->combined_samplers[i];
+ if (!vkd3d_dxbc_compiler_check_shader_visibility(compiler, combined_sampler->shader_visibility))
+ continue;
+
if ((!resource || combined_sampler->resource_index == resource->idx[0].offset)
&& (!sampler || combined_sampler->sampler_index == sampler->idx[0].offset))
return true;
@@ -4562,7 +4565,7 @@ static void vkd3d_dxbc_compiler_emit_dcl_sampler(struct vkd3d_dxbc_compiler *com
uint32_t type_id, ptr_type_id, var_id;
struct vkd3d_symbol reg_symbol;
- if (vkd3d_dxbc_compiler_have_combined_sampler(compiler, NULL, reg))
+ if (vkd3d_dxbc_compiler_has_combined_sampler(compiler, NULL, reg))
return;
type_id = vkd3d_spirv_get_op_type_sampler(builder);
@@ -4750,7 +4753,7 @@ static void vkd3d_dxbc_compiler_emit_resource_declaration(struct vkd3d_dxbc_comp
sampled_type = vkd3d_component_type_from_data_type(resource_data_type);
- if (vkd3d_dxbc_compiler_have_combined_sampler(compiler, reg, NULL))
+ if (vkd3d_dxbc_compiler_has_combined_sampler(compiler, reg, NULL))
{
vkd3d_dxbc_compiler_emit_combined_sampler_declarations(compiler,
reg, resource_type, sampled_type, structure_stride, raw, resource_type_info);
More information about the wine-cvs
mailing list