From e00481586c6fe87c5bf8753f9502d220ea46763a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 26 May 2011 19:25:44 -0600 Subject: [PATCH] mesa: more geometry shader display list functions --- src/mesa/main/dlist.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 80a3c95..c2cd96e 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -454,6 +454,8 @@ typedef enum /* GL_ARB_geometry_shader4 */ OPCODE_PROGRAM_PARAMETERI, + OPCODE_FRAMEBUFFER_TEXTURE, + OPCODE_FRAMEBUFFER_TEXTURE_FACE, /* GL_ARB_sync */ OPCODE_WAIT_SYNC, @@ -7308,6 +7310,47 @@ save_ProgramParameteri(GLuint program, GLenum pname, GLint value) } } +static void GLAPIENTRY +save_FramebufferTexture(GLenum target, GLenum attachment, + GLuint texture, GLint level) +{ + Node *n; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_FRAMEBUFFER_TEXTURE, 4); + if (n) { + n[1].e = target; + n[2].e = attachment; + n[3].ui = texture; + n[4].i = level; + } + if (ctx->ExecuteFlag) { + CALL_FramebufferTextureARB(ctx->Exec, (target, attachment, texture, level)); + } +} + +static void GLAPIENTRY +save_FramebufferTextureFace(GLenum target, GLenum attachment, + GLuint texture, GLint level, GLenum face) +{ + Node *n; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_FRAMEBUFFER_TEXTURE_FACE, 5); + if (n) { + n[1].e = target; + n[2].e = attachment; + n[3].ui = texture; + n[4].i = level; + n[5].e = face; + } + if (ctx->ExecuteFlag) { + CALL_FramebufferTextureFaceARB(ctx->Exec, (target, attachment, texture, + level, face)); + } +} + + static void GLAPIENTRY save_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) @@ -8576,6 +8619,14 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_PROGRAM_PARAMETERI: CALL_ProgramParameteriARB(ctx->Exec, (n[1].ui, n[2].e, n[3].i)); break; + case OPCODE_FRAMEBUFFER_TEXTURE: + CALL_FramebufferTextureARB(ctx->Exec, (n[1].e, n[2].e, + n[3].ui, n[4].i)); + break; + case OPCODE_FRAMEBUFFER_TEXTURE_FACE: + CALL_FramebufferTextureFaceARB(ctx->Exec, (n[1].e, n[2].e, + n[3].ui, n[4].i, n[5].e)); + break; /* GL_ARB_sync */ case OPCODE_WAIT_SYNC: @@ -10283,6 +10334,8 @@ _mesa_create_save_table(void) /* GL_ARB_geometry_shader4 */ SET_ProgramParameteriARB(table, save_ProgramParameteri); + SET_FramebufferTextureARB(table, save_FramebufferTexture); + SET_FramebufferTextureFaceARB(table, save_FramebufferTextureFace); /* GL_ARB_sync */ _mesa_init_sync_dispatch(table); -- 2.7.4