mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader: Scan sampler comparison mode.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
781c5ed7c9
commit
063f0f057a
@ -345,6 +345,7 @@ struct vkd3d_shader_scan_info
|
|||||||
{
|
{
|
||||||
unsigned int uav_read_mask : VKD3D_SHADER_MAX_UNORDERED_ACCESS_VIEWS;
|
unsigned int uav_read_mask : VKD3D_SHADER_MAX_UNORDERED_ACCESS_VIEWS;
|
||||||
unsigned int uav_counter_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,
|
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;
|
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,
|
static void vkd3d_shader_scan_handle_instruction(struct vkd3d_shader_scan_info *scan_info,
|
||||||
const struct vkd3d_shader_instruction *instruction)
|
const struct vkd3d_shader_instruction *instruction)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
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))
|
if (vkd3d_shader_instruction_is_uav_read(instruction))
|
||||||
{
|
{
|
||||||
for (i = 0; i < instruction->dst_count; ++i)
|
for (i = 0; i < instruction->dst_count; ++i)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user