[PATCH vkd3d] vkd3d: Do not call vkCmdPushConstants() with a count of zero (KHRONOS_validation).

Henri Verbeet hverbeet at gmail.com
Thu Jul 22 04:12:45 CDT 2021


On Sun, 18 Jul 2021 at 21:22, Zebediah Figura <zfigura at codeweavers.com> wrote:
> @@ -4149,8 +4149,9 @@ static void d3d12_command_list_set_root_constants(struct d3d12_command_list *lis
>      const struct d3d12_root_constant *c;
>
>      c = root_signature_get_32bit_constants(root_signature, index);
> -    VK_CALL(vkCmdPushConstants(list->vk_command_buffer, root_signature->vk_pipeline_layout,
> -            c->stage_flags, c->offset + offset * sizeof(uint32_t), count * sizeof(uint32_t), data));
> +    if (count)
> +        VK_CALL(vkCmdPushConstants(list->vk_command_buffer, root_signature->vk_pipeline_layout,
> +                c->stage_flags, c->offset + offset * sizeof(uint32_t), count * sizeof(uint32_t), data));
>  }
>
Is that an application making such a call, our is that our own code,
like e.g. shader_runner? In case it's the latter, is this legal in
d3d12, or would d3d12 validation complain about this as well? In case
it's the former, if "count" is zero, there's not much point in doing
anything else here either.



More information about the wine-devel mailing list