summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2016-10-18 15:41:49 -0700
committerAnuj Phogat <anuj.phogat@gmail.com>2016-10-24 11:07:39 -0700
commite2dd582de8eb5ccba669daddf0bd1cb5f72c6bd4 (patch)
tree15a1c91b6dce835238bba0aadf9f4c065fa62d4d
parentd588e4f1925c5a2fc3efbf9ab192f0f6494be57b (diff)
i965/gen8: Use DrawBuffer->_IntegerBuffers in gen8_upload_blend_state()
No functional changes in this patch. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/mesa/drivers/dri/i965/gen8_blend_state.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/gen8_blend_state.c b/src/mesa/drivers/dri/i965/gen8_blend_state.c
index 4935d82af62..8aca8b8ad68 100644
--- a/src/mesa/drivers/dri/i965/gen8_blend_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_blend_state.c
@@ -59,11 +59,7 @@ gen8_upload_blend_state(struct brw_context *brw)
* integer format, the SAMPLE_ALPHA_TO_COVERAGE and SAMPLE_ALPHA_TO_ONE
* operations are skipped."
*/
- struct gl_renderbuffer *rb0 = ctx->DrawBuffer->_ColorDrawBuffers[0];
- GLenum rb_zero_type =
- rb0 ? _mesa_get_format_datatype(rb0->Format) : GL_UNSIGNED_NORMALIZED;
-
- if (rb_zero_type != GL_INT && rb_zero_type != GL_UNSIGNED_INT) {
+ if (!(ctx->DrawBuffer->_IntegerBuffers & 0x1)) {
/* _NEW_MULTISAMPLE */
if (_mesa_is_multisample_enabled(ctx)) {
if (ctx->Multisample.SampleAlphaToCoverage) {
@@ -90,8 +86,6 @@ gen8_upload_blend_state(struct brw_context *brw)
for (int i = 0; i < nr_draw_buffers; i++) {
/* _NEW_BUFFERS */
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[i];
- GLenum rb_type =
- rb ? _mesa_get_format_datatype(rb->Format) : GL_UNSIGNED_NORMALIZED;
/* Used for implementing the following bit of GL_EXT_texture_integer:
* "Per-fragment operations that require floating-point color
@@ -99,7 +93,7 @@ gen8_upload_blend_state(struct brw_context *brw)
* blending, and dithering, have no effect when the corresponding
* colors are written to an integer color buffer."
*/
- bool integer = rb_type == GL_INT || rb_type == GL_UNSIGNED_INT;
+ bool integer = ctx->DrawBuffer->_IntegerBuffers & (0x1 << i);
/* _NEW_COLOR */
if (ctx->Color.ColorLogicOpEnabled) {