i915g: fix generation of large mipmaps
Generation of mipmaps was failing for large heights. If height > 1365 LEVEL 1 couldnot be generated because of the max texture size limit (2048). This is solved by using an offset at the texture-buffer at overflow situations. The height of the offset must be multiple of 8. This solves the problem mentioned at MR !27561 (closed). Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10410 Cc: mesa-stable Signed-off-by: GKraats <vd.kraats@hccnet.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28638>
This commit is contained in:
@@ -174,6 +174,7 @@ struct i915_state {
|
||||
unsigned dst_buf_vars;
|
||||
uint32_t draw_offset;
|
||||
uint32_t draw_size;
|
||||
unsigned cbuf_offset;
|
||||
|
||||
/* Reswizzle for OC writes in PIXEL_SHADER_PROGRAM, or 0 if unnecessary. */
|
||||
uint32_t fixup_swizzle;
|
||||
|
@@ -214,7 +214,7 @@ emit_static(struct i915_context *i915)
|
||||
if (i915->current.cbuf_bo && (i915->static_dirty & I915_DST_BUF_COLOR)) {
|
||||
OUT_BATCH(_3DSTATE_BUF_INFO_CMD);
|
||||
OUT_BATCH(i915->current.cbuf_flags);
|
||||
OUT_RELOC(i915->current.cbuf_bo, I915_USAGE_RENDER, 0);
|
||||
OUT_RELOC(i915->current.cbuf_bo, I915_USAGE_RENDER, i915->current.cbuf_offset);
|
||||
}
|
||||
|
||||
/* What happens if no zbuf??
|
||||
|
@@ -81,6 +81,7 @@ update_framebuffer(struct i915_context *i915)
|
||||
struct pipe_surface *cbuf_surface = i915->framebuffer.cbufs[0];
|
||||
struct pipe_surface *depth_surface = i915->framebuffer.zsbuf;
|
||||
unsigned x, y;
|
||||
unsigned y1;
|
||||
int layer;
|
||||
uint32_t draw_offset, draw_size;
|
||||
|
||||
@@ -91,11 +92,19 @@ update_framebuffer(struct i915_context *i915)
|
||||
|
||||
i915->current.cbuf_bo = tex->buffer;
|
||||
i915->current.cbuf_flags = surf->buf_info;
|
||||
i915->current.cbuf_offset = 0;
|
||||
|
||||
layer = cbuf_surface->u.tex.first_layer;
|
||||
|
||||
x = tex->image_offset[cbuf_surface->u.tex.level][layer].nblocksx;
|
||||
y = tex->image_offset[cbuf_surface->u.tex.level][layer].nblocksy;
|
||||
// Use offset if buffer not within max texture size 2048
|
||||
if (y + i915->framebuffer.height >= (1 << (I915_MAX_TEXTURE_2D_LEVELS - 1))) {
|
||||
// offset should be multiple of 8 to support TILE_X
|
||||
y1 = (y / 8) * 8;
|
||||
y -= y1;
|
||||
i915->current.cbuf_offset = y1 * tex->stride;
|
||||
}
|
||||
} else {
|
||||
i915->current.cbuf_bo = NULL;
|
||||
x = y = 0;
|
||||
|
Reference in New Issue
Block a user