X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fi915%2Fi915_clear.c;h=30a39262ae078e09caae0d24f14ceba03d45857b;hb=26097c4855b97ee6e362c19df11d51fb7fd42192;hp=235ac67c5307b22d95a8052448f50b4f3ef8ac7d;hpb=a13eed4b826d0bb5dfcb5e63651987a232df8a06;p=mesa.git diff --git a/src/gallium/drivers/i915/i915_clear.c b/src/gallium/drivers/i915/i915_clear.c index 235ac67c530..30a39262ae0 100644 --- a/src/gallium/drivers/i915/i915_clear.c +++ b/src/gallium/drivers/i915/i915_clear.c @@ -74,7 +74,7 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers, } /* correctly swizzle clear value */ - if (i915->current.need_target_fixup) + if (i915->current.target_fixup_format) util_pack_color(color->f, cbuf->format, &u_color); else util_pack_color(color->f, PIPE_FORMAT_B8G8R8A8_UNORM, &u_color); @@ -93,28 +93,27 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers, if (util_format_get_blocksize(depth_tex->b.b.format) == 4) { /* Avoid read-modify-write if there's no stencil. */ if (buffers & PIPE_CLEAR_STENCIL - || depth_tex->b.b.format != PIPE_FORMAT_Z24_UNORM_S8_USCALED) { + || depth_tex->b.b.format != PIPE_FORMAT_Z24_UNORM_S8_UINT) { clear_params |= CLEARPARAM_WRITE_STENCIL; - clear_stencil = packed_z_stencil & 0xff; - clear_depth = packed_z_stencil; - } else - clear_depth = packed_z_stencil & 0xffffff00; + clear_stencil = packed_z_stencil >> 24; + } + clear_depth = packed_z_stencil & 0xffffff; depth_clear_bbp = 32; } else { clear_depth = (packed_z_stencil & 0xffff) | (packed_z_stencil << 16); depth_clear_bbp = 16; } - } else if (buffers & PIPE_CLEAR_DEPTH) { + } else if (buffers & PIPE_CLEAR_STENCIL) { struct pipe_surface *zbuf = i915->framebuffer.zsbuf; clear_params |= CLEARPARAM_WRITE_STENCIL; depth_tex = i915_texture(zbuf->texture); - assert(depth_tex->b.b.format == PIPE_FORMAT_Z24_UNORM_S8_USCALED); + assert(depth_tex->b.b.format == PIPE_FORMAT_Z24_UNORM_S8_UINT); packed_z_stencil = util_pack_z_stencil(depth_tex->b.b.format, depth, stencil); depth_clear_bbp = 32; - clear_stencil = packed_z_stencil & 0xff; + clear_stencil = packed_z_stencil >> 24; } /* hw can't fastclear both depth and color if their bbp mismatch. */