mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
i965: Emit a NULL surface for buffer textures with no buffer
This is a preexisting bug but it was uncovered by231653ea35("intel/isl: Add a max_buffer_size limit to isl_device") which added an assert(num_elements > 0) for typed buffers. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13351> (cherry picked from commit393fda2d34)
This commit is contained in:
parent
8876a87565
commit
071ce0bbc7
2 changed files with 11 additions and 1 deletions
|
|
@ -1669,7 +1669,7 @@
|
|||
"description": "i965: Emit a NULL surface for buffer textures with no buffer",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -680,6 +680,11 @@ buffer_texture_range_size(struct brw_context *brw,
|
|||
brw->ctx.Const.MaxTextureBufferSize * texel_size);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_null_surface_state(struct brw_context *brw,
|
||||
const struct gl_framebuffer *fb,
|
||||
uint32_t *out_offset);
|
||||
|
||||
void
|
||||
brw_update_buffer_texture_surface(struct gl_context *ctx,
|
||||
unsigned unit,
|
||||
|
|
@ -695,6 +700,11 @@ brw_update_buffer_texture_surface(struct gl_context *ctx,
|
|||
const enum isl_format isl_format = brw_isl_format_for_mesa_format(format);
|
||||
int texel_size = _mesa_get_format_bytes(format);
|
||||
|
||||
if (tObj->BufferObject == NULL) {
|
||||
emit_null_surface_state(brw, NULL, surf_offset);
|
||||
return;
|
||||
}
|
||||
|
||||
if (intel_obj)
|
||||
bo = brw_bufferobj_buffer(brw, intel_obj, tObj->BufferOffset, size,
|
||||
false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue