mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 17:20:10 +01:00
zink: clamp out partial texels when creating bufferviews
this is an illegal alignment, so clamp the range to the nearest texel offset since the shader should be hitting the robustness case for the partial texel affects: dEQP-GLES31.functional.texture.texture_buffer.modify.mapbuffer_readwrite.range_size_65537 Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15827>
This commit is contained in:
parent
b3ee943050
commit
ac8337041c
1 changed files with 8 additions and 1 deletions
|
|
@ -701,7 +701,14 @@ create_bvci(struct zink_context *ctx, struct zink_resource *res, enum pipe_forma
|
|||
assert(bvci.format);
|
||||
bvci.offset = offset;
|
||||
bvci.range = !offset && range == res->base.b.width0 ? VK_WHOLE_SIZE : range;
|
||||
uint32_t clamp = util_format_get_blocksize(format) * screen->info.props.limits.maxTexelBufferElements;
|
||||
unsigned blocksize = util_format_get_blocksize(format);
|
||||
if (bvci.range != VK_WHOLE_SIZE) {
|
||||
/* clamp out partial texels */
|
||||
bvci.range -= bvci.range % blocksize;
|
||||
if (bvci.offset + bvci.range >= res->base.b.width0)
|
||||
bvci.range = VK_WHOLE_SIZE;
|
||||
}
|
||||
uint32_t clamp = blocksize * screen->info.props.limits.maxTexelBufferElements;
|
||||
if (bvci.range == VK_WHOLE_SIZE && res->base.b.width0 > clamp)
|
||||
bvci.range = clamp;
|
||||
bvci.flags = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue