summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/dlist.c
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-06-09 22:50:43 -0400
committerIlia Mirkin <[email protected]>2016-06-18 12:51:55 -0400
commitd68c1e2ac28bbf0ac6259e9619fb73958fc598b8 (patch)
treea2bc494b87e8fc08ad777551231a73d9e11b42e4 /src/mesa/main/dlist.c
parent78506ad2466563d9ec3f8d09a746a069e6cab6b5 (diff)
mesa: add GL_EXT_window_rectangles state storage/retrieval functionality
Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/dlist.c')
-rw-r--r--src/mesa/main/dlist.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 43e2ffb3a78..4e4b1385c0b 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -485,6 +485,9 @@ typedef enum
/* EXT_polygon_offset_clamp */
OPCODE_POLYGON_OFFSET_CLAMP,
+ /* EXT_window_rectangles */
+ OPCODE_WINDOW_RECTANGLES,
+
/* The following three are meta instructions */
OPCODE_ERROR, /* raise compiled-in error */
OPCODE_CONTINUE,
@@ -1090,7 +1093,10 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
free(get_pointer(&n[3]));
n += InstSize[n[0].opcode];
break;
-
+ case OPCODE_WINDOW_RECTANGLES:
+ free(get_pointer(&n[3]));
+ n += InstSize[n[0].opcode];
+ break;
case OPCODE_CONTINUE:
n = (Node *) get_pointer(&n[1]);
free(block);
@@ -7922,6 +7928,27 @@ save_UniformBlockBinding(GLuint prog, GLuint index, GLuint binding)
}
}
+/** GL_EXT_window_rectangles */
+static void GLAPIENTRY
+save_WindowRectanglesEXT(GLenum mode, GLsizei count, const GLint *box)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_WINDOW_RECTANGLES, 2 + POINTER_DWORDS);
+ if (n) {
+ GLint *box_copy = NULL;
+
+ if (count > 0)
+ box_copy = memdup(box, sizeof(GLint) * 4 * count);
+ n[1].e = mode;
+ n[2].si = count;
+ save_pointer(&n[3], box_copy);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_WindowRectanglesEXT(ctx->Exec, (mode, count, box));
+ }
+}
/**
* Save an error-generating command into display list.
@@ -9122,6 +9149,12 @@ execute_list(struct gl_context *ctx, GLuint list)
CALL_UniformBlockBinding(ctx->Exec, (n[1].ui, n[2].ui, n[3].ui));
break;
+ /* GL_EXT_window_rectangles */
+ case OPCODE_WINDOW_RECTANGLES:
+ CALL_WindowRectanglesEXT(
+ ctx->Exec, (n[1].e, n[2].si, get_pointer(&n[3])));
+ break;
+
case OPCODE_CONTINUE:
n = (Node *) get_pointer(&n[1]);
break;
@@ -10018,6 +10051,9 @@ _mesa_initialize_save_table(const struct gl_context *ctx)
/* GL_EXT_polygon_offset_clamp */
SET_PolygonOffsetClampEXT(table, save_PolygonOffsetClampEXT);
+
+ /* GL_EXT_window_rectangles */
+ SET_WindowRectanglesEXT(table, save_WindowRectanglesEXT);
}