Skip to content

anv: "fix" allocated size of push descriptor buffer

Ivan Briano requested to merge ibriano/mesa:hsw-robustness into master

When used in push constants, buffers need to be sized at multiples of 32 bytes. In general, the underlying BO will be large enough that we never run into issues with this, but when robustBufferAccess is requested, we have extra checks in place to make sure that all buffer access is within bounds, and these checks care about these limits a bit more. The image parameters of a sampled image are sent to the shader in a buffer of size 80, of which not all will necessarily be used. For the most part, only 64 of those 80 bytes are ever used, all the checks see we have everything within the expected limits, and we are happy seeing all our tests pass. But on HSW, some image formats require the shader to deal with the tile format manually, which makes use of the extra SWIZZLING parameter that is all but ignored on BDW and up. This extra parameter means that our buffer uses three GRFs, which our robustness checks will see as requiring 96 bytes, but since we only allocated 80, our tests hit an assert, and that makes us sad.

All of that for debug builds. Release ones will strip the assert and everything just works.

Still, making sure the allocated buffers are sized large enough to guarantee the hardware isn't reading who knows what from who knows where feels like the right thing to do.

Closes #3703 (closed) Fixes dEQP-VK.robustness.image_robustness.push.* on HSW

Merge request reports