vkd3d-shader: Scan multi-register descriptor ranges properly.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This commit is contained in:
Philip Rebohle 2020-02-26 17:22:00 +01:00 committed by Hans-Kristian Arntzen
parent ffaa31e1d9
commit 1c9b07e8b3
2 changed files with 5 additions and 1 deletions

View File

@ -137,6 +137,8 @@ struct vkd3d_shader_parameter
} u;
};
#define VKD3D_SHADER_DESCRIPTOR_RANGE_UNBOUNDED (~0u)
struct vkd3d_shader_resource_binding
{
enum vkd3d_shader_descriptor_type type;

View File

@ -2399,7 +2399,9 @@ static const struct vkd3d_shader_resource_binding *vkd3d_dxbc_compiler_get_resou
if (!vkd3d_dxbc_compiler_check_shader_visibility(compiler, current->shader_visibility))
continue;
if (current->type == descriptor_type && current->register_index == reg_idx && current->register_space == reg_space)
if (descriptor_type == current->type && reg_space == current->register_space && reg_idx >= current->register_index
&& (current->register_count == VKD3D_SHADER_DESCRIPTOR_RANGE_UNBOUNDED
|| reg_idx < current->register_index + current->register_count))
return current;
}