Skip to content
Snippets Groups Projects
Commit 063f0f05 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard
Browse files

vkd3d-shader: Scan sampler comparison mode.

parent 781c5ed7
Branches
Tags
No related merge requests found
......@@ -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,
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment