[PATCH vkd3d] vkd3d: Do not call vkCmdPushConstants() with a count of zero (KHRONOS_validation).
Zebediah Figura (she/her)
zfigura at codeweavers.com
Thu Jul 22 11:58:50 CDT 2021
On 7/22/21 4:12 AM, Henri Verbeet wrote:
> 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.
It's shader_runner_d3d12 (run with any test that doesn't use constants,
say, hlsl-struct-semantics.shader_test). I can't find any indication in
the documentation that this is invalid in d3d12, and my AMD machine
doesn't complain with --validate --gbv.
More information about the wine-devel