Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- libs/vkd3d/command.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 60c4b37c..bfb52cde 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -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)); }
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstant(ID3D12GraphicsCommandList2 *iface,
On Sun, 18 Jul 2021 at 21:22, Zebediah Figura zfigura@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.
On 7/22/21 4:12 AM, Henri Verbeet wrote:
On Sun, 18 Jul 2021 at 21:22, Zebediah Figura zfigura@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.