summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2021-09-16 14:25:42 -0700
committerMarge Bot <eric+marge@anholt.net>2021-09-30 17:41:33 +0000
commit2123d596934127d03e0b41374321520a24201d18 (patch)
tree8fa3404e8e17ebaa60d81e1e72d836390274f55c /src/mesa/drivers/dri/i965
parent00ea664cb6c1817d92cccd8f48c05fa93ddd3160 (diff)
intel/blorp: Convert blorp_clear color_write_disable to a bitmask
Reworks: * Various cleanups adding BITFIELD_* (s-b Jason) * Add /* color_write_disable */ comment (s-b Jason) Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11564>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 4e94d86b779..64876b6a8e1 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -1165,7 +1165,7 @@ err:
static bool
set_write_disables(const struct brw_renderbuffer *irb,
- const unsigned color_mask, bool *color_write_disable)
+ const unsigned color_mask, uint8_t *color_write_disable)
{
/* Format information in the renderbuffer represents the requirements
* given by the client. There are cases where the backing miptree uses,
@@ -1174,16 +1174,9 @@ set_write_disables(const struct brw_renderbuffer *irb,
*/
const GLenum base_format = irb->Base.Base._BaseFormat;
const int components = _mesa_components_in_format(base_format);
- bool disables = false;
-
assert(components > 0);
-
- for (int i = 0; i < components; i++) {
- color_write_disable[i] = !(color_mask & (1 << i));
- disables = disables || color_write_disable[i];
- }
-
- return disables;
+ *color_write_disable = ~color_mask & BITFIELD_MASK(components);
+ return *color_write_disable;
}
static void
@@ -1219,9 +1212,9 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
if (INTEL_DEBUG & DEBUG_NO_FAST_CLEAR)
can_fast_clear = false;
- bool color_write_disable[4] = { false, false, false, false };
+ uint8_t color_write_disable = 0;
if (set_write_disables(irb, GET_COLORMASK(ctx->Color.ColorMask, buf),
- color_write_disable))
+ &color_write_disable))
can_fast_clear = false;
/* We store clear colors as floats or uints as needed. If there are