Józef Kucia : vkd3d-shader: Scan sampler comparison mode.
Module: vkd3d Branch: master Commit: 063f0f057aa35fc39061676a5e9af2ff812e3c66 URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=063f0f057aa35fc39061676a... Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Oct 22 01:49:15 2018 +0200 vkd3d-shader: Scan sampler comparison mode. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- 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 f0ff82b..ce8de6d 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 5b269bd..348fa5d 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)
participants (1)
-
Alexandre Julliard