st/pbo: reject vs/fs pbo ops if rowstride < width

this pbo shader works by iterating over the framebuffer size
and storing a value to an offset for each source pixel. if the
number of pixels being written out does not correspond to fragcoord
to the extent that certain source pixels are not written at all, however,
then this method should not be used in order to avoid giving broken results

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30689>
(cherry picked from commit c2dcecffc5)
This commit is contained in:
Mike Blumenkrantz 2024-08-16 09:10:37 -04:00 committed by Eric Engestrom
parent bd69d51ba0
commit 33cb5bfa25
2 changed files with 4 additions and 1 deletions

View File

@ -1034,7 +1034,7 @@
"description": "st/pbo: reject vs/fs pbo ops if rowstride < width",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View File

@ -111,6 +111,9 @@ st_pbo_addresses_pixelstore(struct st_context *st,
if (buf_offset % addr->bytes_per_pixel)
return false;
if (store->RowLength && store->RowLength < addr->width)
return false;
/* Convert to texels */
buf_offset = buf_offset / addr->bytes_per_pixel;