summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/attrib.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-01-26 14:25:53 -0700
committerBrian Paul <[email protected]>2018-01-29 21:15:52 -0700
commitf96a69f916aed40519e755d0460a83940a58780e (patch)
tree6515058fbd5ad07f986e1b31df217ae7910c7ab1 /src/mesa/main/attrib.c
parent94843e60562c52975325f59f21cb1c8e89f2fe20 (diff)
mesa: replace GLenum with GLenum16 in common structures (v4)
v2: - fix glGet* - also use GLenum16 for DrawBuffers v3: - rebase to top of tree (BrianP) and incorporate Ian's suggestions v4: - fix a GLenum16 bug in VBO/save code, add some STATIC_ASSERT()s gl_context = 152432 -> 136840 bytes vbo_context = 22096 -> 20608 bytes Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main/attrib.c')
-rw-r--r--src/mesa/main/attrib.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 50b65c413e5..3c12fd6824d 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1005,11 +1005,16 @@ _mesa_PopAttrib(void)
* user FBO bound, GL_FRONT will be illegal and we'll need
* to record that error. Per OpenGL ARB decision.
*/
- if (multipleBuffers)
- _mesa_DrawBuffers(ctx->Const.MaxDrawBuffers,
- color->DrawBuffer);
- else
+ if (multipleBuffers) {
+ GLenum buffers[MAX_DRAW_BUFFERS];
+
+ for (unsigned i = 0; i < ctx->Const.MaxDrawBuffers; i++)
+ buffers[i] = color->DrawBuffer[i];
+
+ _mesa_DrawBuffers(ctx->Const.MaxDrawBuffers, buffers);
+ } else {
_mesa_DrawBuffer(color->DrawBuffer[0]);
+ }
}
_mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled);
_mesa_AlphaFunc(color->AlphaFunc, color->AlphaRefUnclamped);