[Mesa-dev] [PATCH] isl/state: fix assert on raw buffer surface state minimum size

Samuel Iglesias Gonsálvez siglesias at igalia.com
Thu Feb 23 07:16:53 UTC 2017



On 22/02/17 17:32, Jason Ekstrand wrote:
> Seems reasonable  Are you sure this isn't somehow required on old hardware?
> 

This assert is inside if (gen >= 7) block. I have checked all gen7+
specs and they all say the same.

What I saw was that for PLANAR* surface formats, num_elements must be a
multiple of 4, which is what we were asserting before. However as we are
asserting the limits for raw surfaces, this doesn't apply here.

> Reviewed-by: Jason Ekstrand <jason at jlekstrand.net
> <mailto:jason at jlekstrand.net>>
> 

Thanks!

Sam

> On Wed, Feb 22, 2017 at 3:39 AM, Samuel Iglesias Gonsálvez
> <siglesias at igalia.com <mailto:siglesias at igalia.com>> wrote:
> 
>     From IVB PRM, SURFACE_STATE::Height:
> 
>     "For typed buffer and structured buffer surfaces, the number of
>      entries in the buffer ranges from 1 to 2^27 . For raw buffer
>      surfaces, the number of entries in the buffer is the number of bytes
>      which can range from 1 to 2^30."
> 
>     The minimum value is 1, according to the spec. The spec quote
>     was already added into the code by 028f6d8317f00.
> 
>     Fixes crashing tests under:
> 
>     dEQP-VK.robustness.buffer_access.*
> 
>     Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com
>     <mailto:siglesias at igalia.com>>
>     Cc: jason at jlekstrand.net <mailto:jason at jlekstrand.net>
>     ---
>      src/intel/isl/isl_surface_state.c | 2 +-
>      1 file changed, 1 insertion(+), 1 deletion(-)
> 
>     diff --git a/src/intel/isl/isl_surface_state.c
>     b/src/intel/isl/isl_surface_state.c
>     index 29ec289a5d..853bb11846 100644
>     --- a/src/intel/isl/isl_surface_state.c
>     +++ b/src/intel/isl/isl_surface_state.c
>     @@ -671,7 +671,7 @@ isl_genX(buffer_fill_state_s)(void *state,
>             */
>            if (info->format == ISL_FORMAT_RAW) {
>               assert(num_elements <= (1ull << 30));
>     -         assert((num_elements & 3) == 0);
>     +         assert(num_elements > 0);
>            } else {
>               assert(num_elements <= (1ull << 27));
>            }
>     --
>     2.11.0
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 862 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170223/a14057c6/attachment-0001.sig>


More information about the mesa-dev mailing list