summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/buffers.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/buffers.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/buffers.c')
-rw-r--r--src/mesa/main/buffers.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index d3640479f00..5492227de08 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -299,7 +299,8 @@ draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,
}
/* if we get here, there's no error so set new state */
- _mesa_drawbuffers(ctx, fb, 1, &buffer, &destMask);
+ const GLenum16 buffer16 = buffer;
+ _mesa_drawbuffers(ctx, fb, 1, &buffer16, &destMask);
/* Call device driver function only if fb is the bound draw buffer */
if (fb == ctx->DrawBuffer) {
@@ -573,7 +574,11 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb, GLsizei n,
}
/* OK, if we get here, there were no errors so set the new state */
- _mesa_drawbuffers(ctx, fb, n, buffers, destMask);
+ GLenum16 buffers16[MAX_DRAW_BUFFERS];
+ for (int i = 0; i < n; i++)
+ buffers16[i] = buffers[i];
+
+ _mesa_drawbuffers(ctx, fb, n, buffers16, destMask);
/*
* Call device driver function if fb is the bound draw buffer.
@@ -694,7 +699,8 @@ updated_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb)
*/
void
_mesa_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint n, const GLenum *buffers, const GLbitfield *destMask)
+ GLuint n, const GLenum16 *buffers,
+ const GLbitfield *destMask)
{
GLbitfield mask[MAX_DRAW_BUFFERS];
GLuint buf;