From: Conor McCarthy cmccarthy@codeweavers.com
Fixes compilation failures in Cyberpunk 2077 due to missing UAV counter flag. --- libs/vkd3d-shader/vkd3d_shader_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 273a543a..0c3422f6 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -705,7 +705,8 @@ static void vkd3d_shader_scan_add_uav_flag(const struct vkd3d_shader_scan_contex
for (i = 0; i < context->scan_descriptor_info->descriptor_count; ++i) { - if (context->scan_descriptor_info->descriptors[i].register_id == range_id) + if (context->scan_descriptor_info->descriptors[i].type == VKD3D_SHADER_DESCRIPTOR_TYPE_UAV + && context->scan_descriptor_info->descriptors[i].register_id == range_id) { context->scan_descriptor_info->descriptors[i].flags |= flag; break;
From: Conor McCarthy cmccarthy@codeweavers.com
All downstream code treats buffer_size as a vec4 count. --- libs/vkd3d-shader/vkd3d_shader_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 0c3422f6..9a370a37 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -797,7 +797,7 @@ static void vkd3d_shader_scan_constant_buffer_declaration(struct vkd3d_shader_sc if (!(d = vkd3d_shader_scan_add_descriptor(context, VKD3D_SHADER_DESCRIPTOR_TYPE_CBV, &cb->src.reg, &cb->range, VKD3D_SHADER_RESOURCE_BUFFER, VKD3D_SHADER_RESOURCE_DATA_UINT))) return; - d->buffer_size = cb->size * 16; + d->buffer_size = cb->size; }
static void vkd3d_shader_scan_sampler_declaration(struct vkd3d_shader_scan_context *context, @@ -1171,7 +1171,7 @@ static int scan_with_parser(const struct vkd3d_shader_compile_info *compile_info { if ((d = vkd3d_shader_scan_add_descriptor(&context, VKD3D_SHADER_DESCRIPTOR_TYPE_CBV, ®, &range, VKD3D_SHADER_RESOURCE_BUFFER, VKD3D_SHADER_RESOURCE_DATA_UINT))) - d->buffer_size = size * 16; + d->buffer_size = size; } }
This merge request was approved by Giovanni Mascellani.
Oops, sorry about that...
Wrt 2/2, my original intent was that these would eventually be exposed as API, and in that case I think byte size is a bit more intuitive to deal with than vec4 size. In that case I intended to fix spirv to treat the size as a byte size, but forgot to do that (and of course the tests didn't catch it, since it just resulted in declaring larger buffers than we actually access).