On 4/21/22 11:30, Henri Verbeet wrote:
On Wed, 20 Apr 2022 at 19:50, Zebediah Figura zfigura@codeweavers.com wrote:
On 4/20/22 10:40, Henri Verbeet wrote:
Is calling SetGraphicsRoot32BitConstants()/SetComputeRoot32BitConstants() valid d3d12? If not, we should be fixing the callers instead.
Right, I believe I received the same feedback when submitting this patch before, and never found the time to properly look into it, which is why it has remained in my tree without being resubmitted.
Looking into it now, I don't see any indication that a zero count is invalid, either from the "specification" [1] or in the function documentation themselves [2] [3], and in practice it's worked on (AMD) Windows when I've tried it. I haven't tried with the debug layer, though, and I don't know of any other things I could check.
The debug layer might be interesting to check, but I guess that's good enough.
I was able to install the debug layer, and it turns out it actually does complain, sort of:
"ID3D12CommandList::SetGraphicsRoot32BitConstants: The currently set root signature declares parameter [0] with type 32bit constants, with Num32BitValues 0, so it is invalid to set DestOffsetIn32BitValues of 0."
It doesn't complain about setting a count of zero, though, just about offset >= size.
Given that it seems to work in practice, I'm not sure whether it makes sense to have this patch or not.