From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- include/private/vkd3d_shader.h | 1 + libs/vkd3d-shader/vkd3d_shader_main.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+)
diff --git a/include/private/vkd3d_shader.h b/include/private/vkd3d_shader.h index f0ff82b8ce7f..ce8de6dad388 100644 --- a/include/private/vkd3d_shader.h +++ b/include/private/vkd3d_shader.h @@ -345,6 +345,7 @@ struct vkd3d_shader_scan_info { unsigned int uav_read_mask : VKD3D_SHADER_MAX_UNORDERED_ACCESS_VIEWS; unsigned int uav_counter_mask : VKD3D_SHADER_MAX_UNORDERED_ACCESS_VIEWS; + uint32_t sampler_comparison_mode_mask; };
int vkd3d_shader_scan_dxbc(const struct vkd3d_shader_code *dxbc, diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 5b269bd6a343..348fa5d6e7c6 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -160,11 +160,25 @@ static void vkd3d_shader_scan_record_uav_counter(struct vkd3d_shader_scan_info * scan_info->uav_counter_mask |= 1u << reg->idx[0].offset; }
+static void vkd3d_shader_scan_sampler_declaration(struct vkd3d_shader_scan_info *scan_info, + const struct vkd3d_shader_instruction *instruction) +{ + unsigned int sampler_index = instruction->declaration.dst.reg.idx[0].offset; + if (instruction->flags & VKD3DSI_SAMPLER_COMPARISON_MODE) + { + assert(sampler_index < CHAR_BIT * sizeof(scan_info->sampler_comparison_mode_mask)); + scan_info->sampler_comparison_mode_mask |= 1u << sampler_index; + } +} + static void vkd3d_shader_scan_handle_instruction(struct vkd3d_shader_scan_info *scan_info, const struct vkd3d_shader_instruction *instruction) { unsigned int i;
+ if (instruction->handler_idx == VKD3DSIH_DCL_SAMPLER) + vkd3d_shader_scan_sampler_declaration(scan_info, instruction); + if (vkd3d_shader_instruction_is_uav_read(instruction)) { for (i = 0; i < instruction->dst_count; ++i)