From 2d8b8d3bd1c21c4840378d2ef412ae7eb7798bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Fri, 25 Oct 2019 11:00:04 +0300 Subject: [PATCH] mesa: add [Program]Uniform*64ARB display list support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is required for int64 to be enabled in compat profile. Signed-off-by: Tapani Pälli Acked-by: Marek Olšák Reviewed-by: Kenneth Graunke --- src/mesa/main/dlist.c | 979 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 979 insertions(+) diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 5d73a4c670c..01c650acfaa 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -393,6 +393,40 @@ typedef enum OPCODE_UNIFORM_MATRIX34D, OPCODE_UNIFORM_MATRIX43D, + /* GL_ARB_gpu_shader_int64 */ + OPCODE_UNIFORM_1I64, + OPCODE_UNIFORM_2I64, + OPCODE_UNIFORM_3I64, + OPCODE_UNIFORM_4I64, + OPCODE_UNIFORM_1I64V, + OPCODE_UNIFORM_2I64V, + OPCODE_UNIFORM_3I64V, + OPCODE_UNIFORM_4I64V, + OPCODE_UNIFORM_1UI64, + OPCODE_UNIFORM_2UI64, + OPCODE_UNIFORM_3UI64, + OPCODE_UNIFORM_4UI64, + OPCODE_UNIFORM_1UI64V, + OPCODE_UNIFORM_2UI64V, + OPCODE_UNIFORM_3UI64V, + OPCODE_UNIFORM_4UI64V, + OPCODE_PROGRAM_UNIFORM_1I64, + OPCODE_PROGRAM_UNIFORM_2I64, + OPCODE_PROGRAM_UNIFORM_3I64, + OPCODE_PROGRAM_UNIFORM_4I64, + OPCODE_PROGRAM_UNIFORM_1I64V, + OPCODE_PROGRAM_UNIFORM_2I64V, + OPCODE_PROGRAM_UNIFORM_3I64V, + OPCODE_PROGRAM_UNIFORM_4I64V, + OPCODE_PROGRAM_UNIFORM_1UI64, + OPCODE_PROGRAM_UNIFORM_2UI64, + OPCODE_PROGRAM_UNIFORM_3UI64, + OPCODE_PROGRAM_UNIFORM_4UI64, + OPCODE_PROGRAM_UNIFORM_1UI64V, + OPCODE_PROGRAM_UNIFORM_2UI64V, + OPCODE_PROGRAM_UNIFORM_3UI64V, + OPCODE_PROGRAM_UNIFORM_4UI64V, + /* OpenGL 4.0 / GL_ARB_tessellation_shader */ OPCODE_PATCH_PARAMETER_I, OPCODE_PATCH_PARAMETER_FV_INNER, @@ -725,6 +759,11 @@ union float64_pair GLuint uint32[2]; }; +union int64_pair +{ + GLint64 int64; + GLint int32[2]; +}; #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \ do { \ @@ -734,6 +773,21 @@ union float64_pair n[idx+1].ui = tmp.uint32[1]; \ } while (0) +#define ASSIGN_UINT64_TO_NODES(n, idx, value) \ + do { \ + union uint64_pair tmp; \ + tmp.uint64 = value; \ + n[idx].ui = tmp.uint32[0]; \ + n[idx+1].ui = tmp.uint32[1]; \ + } while (0) + +#define ASSIGN_INT64_TO_NODES(n, idx, value) \ + do { \ + union int64_pair tmp; \ + tmp.int64 = value; \ + n[idx].i = tmp.int32[0]; \ + n[idx+1].i = tmp.int32[1]; \ + } while (0) /** * How many nodes to allocate at a time. Note that bulk vertex data @@ -1183,6 +1237,14 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) case OPCODE_UNIFORM_2UIV: case OPCODE_UNIFORM_3UIV: case OPCODE_UNIFORM_4UIV: + case OPCODE_UNIFORM_1I64V: + case OPCODE_UNIFORM_2I64V: + case OPCODE_UNIFORM_3I64V: + case OPCODE_UNIFORM_4I64V: + case OPCODE_UNIFORM_1UI64V: + case OPCODE_UNIFORM_2UI64V: + case OPCODE_UNIFORM_3UI64V: + case OPCODE_UNIFORM_4UI64V: free(get_pointer(&n[3])); break; case OPCODE_UNIFORM_MATRIX22: @@ -1221,6 +1283,14 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) case OPCODE_PROGRAM_UNIFORM_2UIV: case OPCODE_PROGRAM_UNIFORM_3UIV: case OPCODE_PROGRAM_UNIFORM_4UIV: + case OPCODE_PROGRAM_UNIFORM_1I64V: + case OPCODE_PROGRAM_UNIFORM_2I64V: + case OPCODE_PROGRAM_UNIFORM_3I64V: + case OPCODE_PROGRAM_UNIFORM_4I64V: + case OPCODE_PROGRAM_UNIFORM_1UI64V: + case OPCODE_PROGRAM_UNIFORM_2UI64V: + case OPCODE_PROGRAM_UNIFORM_3UI64V: + case OPCODE_PROGRAM_UNIFORM_4UI64V: free(get_pointer(&n[4])); break; case OPCODE_PROGRAM_UNIFORM_MATRIX22F: @@ -7843,6 +7913,592 @@ save_UniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose, } } +static void GLAPIENTRY +save_Uniform1i64ARB(GLint location, GLint64 x) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1I64, 3); + if (n) { + n[1].i = location; + ASSIGN_INT64_TO_NODES(n, 2, x); + } + if (ctx->ExecuteFlag) { + CALL_Uniform1i64ARB(ctx->Exec, (location, x)); + } +} + +static void GLAPIENTRY +save_Uniform2i64ARB(GLint location, GLint64 x, GLint64 y) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2I64, 5); + if (n) { + n[1].i = location; + ASSIGN_INT64_TO_NODES(n, 2, x); + ASSIGN_INT64_TO_NODES(n, 4, y); + } + if (ctx->ExecuteFlag) { + CALL_Uniform2i64ARB(ctx->Exec, (location, x, y)); + } +} + +static void GLAPIENTRY +save_Uniform3i64ARB(GLint location, GLint64 x, GLint64 y, GLint64 z) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3I64, 7); + if (n) { + n[1].i = location; + ASSIGN_INT64_TO_NODES(n, 2, x); + ASSIGN_INT64_TO_NODES(n, 4, y); + ASSIGN_INT64_TO_NODES(n, 6, z); + } + if (ctx->ExecuteFlag) { + CALL_Uniform3i64ARB(ctx->Exec, (location, x, y, z)); + } +} + +static void GLAPIENTRY +save_Uniform4i64ARB(GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4I64, 9); + if (n) { + n[1].i = location; + ASSIGN_INT64_TO_NODES(n, 2, x); + ASSIGN_INT64_TO_NODES(n, 4, y); + ASSIGN_INT64_TO_NODES(n, 6, z); + ASSIGN_INT64_TO_NODES(n, 8, w); + } + if (ctx->ExecuteFlag) { + CALL_Uniform4i64ARB(ctx->Exec, (location, x, y, z, w)); + } +} + +static void GLAPIENTRY +save_Uniform1i64vARB(GLint location, GLsizei count, const GLint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1I64V, 2 + POINTER_DWORDS); + if (n) { + n[1].i = location; + n[2].i = count; + save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLint64))); + } + if (ctx->ExecuteFlag) { + CALL_Uniform1i64vARB(ctx->Exec, (location, count, v)); + } +} + +static void GLAPIENTRY +save_Uniform2i64vARB(GLint location, GLsizei count, const GLint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2I64V, 2 + POINTER_DWORDS); + if (n) { + n[1].i = location; + n[2].i = count; + save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLint64))); + } + if (ctx->ExecuteFlag) { + CALL_Uniform2i64vARB(ctx->Exec, (location, count, v)); + } +} + +static void GLAPIENTRY +save_Uniform3i64vARB(GLint location, GLsizei count, const GLint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3I64V, 2 + POINTER_DWORDS); + if (n) { + n[1].i = location; + n[2].i = count; + save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLint64))); + } + if (ctx->ExecuteFlag) { + CALL_Uniform3i64vARB(ctx->Exec, (location, count, v)); + } +} + +static void GLAPIENTRY +save_Uniform4i64vARB(GLint location, GLsizei count, const GLint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4I64V, 2 + POINTER_DWORDS); + if (n) { + n[1].i = location; + n[2].i = count; + save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLint64))); + } + if (ctx->ExecuteFlag) { + CALL_Uniform4i64vARB(ctx->Exec, (location, count, v)); + } +} + +static void GLAPIENTRY +save_Uniform1ui64ARB(GLint location, GLuint64 x) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1UI64, 3); + if (n) { + n[1].i = location; + ASSIGN_UINT64_TO_NODES(n, 2, x); + } + if (ctx->ExecuteFlag) { + CALL_Uniform1ui64ARB(ctx->Exec, (location, x)); + } +} + +static void GLAPIENTRY +save_Uniform2ui64ARB(GLint location, GLuint64 x, GLuint64 y) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2UI64, 5); + if (n) { + n[1].i = location; + ASSIGN_UINT64_TO_NODES(n, 2, x); + ASSIGN_UINT64_TO_NODES(n, 4, y); + } + if (ctx->ExecuteFlag) { + CALL_Uniform2ui64ARB(ctx->Exec, (location, x, y)); + } +} + +static void GLAPIENTRY +save_Uniform3ui64ARB(GLint location, GLuint64 x, GLuint64 y, GLuint64 z) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3UI64, 7); + if (n) { + n[1].i = location; + ASSIGN_UINT64_TO_NODES(n, 2, x); + ASSIGN_UINT64_TO_NODES(n, 4, y); + ASSIGN_UINT64_TO_NODES(n, 6, z); + } + if (ctx->ExecuteFlag) { + CALL_Uniform3ui64ARB(ctx->Exec, (location, x, y, z)); + } +} + +static void GLAPIENTRY +save_Uniform4ui64ARB(GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4UI64, 9); + if (n) { + n[1].i = location; + ASSIGN_UINT64_TO_NODES(n, 2, x); + ASSIGN_UINT64_TO_NODES(n, 4, y); + ASSIGN_UINT64_TO_NODES(n, 6, z); + ASSIGN_UINT64_TO_NODES(n, 8, w); + } + if (ctx->ExecuteFlag) { + CALL_Uniform4ui64ARB(ctx->Exec, (location, x, y, z, w)); + } +} + +static void GLAPIENTRY +save_Uniform1ui64vARB(GLint location, GLsizei count, const GLuint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1UI64V, 2 + POINTER_DWORDS); + if (n) { + n[1].i = location; + n[2].i = count; + save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLuint64))); + } + if (ctx->ExecuteFlag) { + CALL_Uniform1ui64vARB(ctx->Exec, (location, count, v)); + } +} + +static void GLAPIENTRY +save_Uniform2ui64vARB(GLint location, GLsizei count, const GLuint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2UI64V, 2 + POINTER_DWORDS); + if (n) { + n[1].i = location; + n[2].i = count; + save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLuint64))); + } + if (ctx->ExecuteFlag) { + CALL_Uniform2ui64vARB(ctx->Exec, (location, count, v)); + } +} + +static void GLAPIENTRY +save_Uniform3ui64vARB(GLint location, GLsizei count, const GLuint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3UI64V, 2 + POINTER_DWORDS); + if (n) { + n[1].i = location; + n[2].i = count; + save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLuint64))); + } + if (ctx->ExecuteFlag) { + CALL_Uniform3ui64vARB(ctx->Exec, (location, count, v)); + } +} + +static void GLAPIENTRY +save_Uniform4ui64vARB(GLint location, GLsizei count, const GLuint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4UI64V, 2 + POINTER_DWORDS); + if (n) { + n[1].i = location; + n[2].i = count; + save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLuint64))); + } + if (ctx->ExecuteFlag) { + CALL_Uniform4ui64vARB(ctx->Exec, (location, count, v)); + } +} + +static void GLAPIENTRY +save_ProgramUniform1i64ARB(GLuint program, GLint location, GLint64 x) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1I64, 4); + if (n) { + n[1].ui = program; + n[2].i = location; + ASSIGN_INT64_TO_NODES(n, 3, x); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform1i64ARB(ctx->Exec, (program, location, x)); + } +} + +static void GLAPIENTRY +save_ProgramUniform2i64ARB(GLuint program, GLint location, GLint64 x, + GLint64 y) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2I64, 6); + if (n) { + n[1].ui = program; + n[2].i = location; + ASSIGN_INT64_TO_NODES(n, 3, x); + ASSIGN_INT64_TO_NODES(n, 5, y); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform2i64ARB(ctx->Exec, (program, location, x, y)); + } +} + +static void GLAPIENTRY +save_ProgramUniform3i64ARB(GLuint program, GLint location, GLint64 x, + GLint64 y, GLint64 z) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3I64, 8); + if (n) { + n[1].ui = program; + n[2].i = location; + ASSIGN_INT64_TO_NODES(n, 3, x); + ASSIGN_INT64_TO_NODES(n, 5, y); + ASSIGN_INT64_TO_NODES(n, 7, z); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform3i64ARB(ctx->Exec, (program, location, x, y, z)); + } +} + +static void GLAPIENTRY +save_ProgramUniform4i64ARB(GLuint program, GLint location, GLint64 x, + GLint64 y, GLint64 z, GLint64 w) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4I64, 10); + if (n) { + n[1].ui = program; + n[2].i = location; + ASSIGN_INT64_TO_NODES(n, 3, x); + ASSIGN_INT64_TO_NODES(n, 5, y); + ASSIGN_INT64_TO_NODES(n, 7, z); + ASSIGN_INT64_TO_NODES(n, 9, w); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform4i64ARB(ctx->Exec, (program, location, x, y, z, w)); + } +} + +static void GLAPIENTRY +save_ProgramUniform1i64vARB(GLuint program, GLint location, GLsizei count, + const GLint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1I64V, 3 + POINTER_DWORDS); + if (n) { + n[1].ui = program; + n[2].i = location; + n[3].i = count; + save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64))); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform1i64vARB(ctx->Exec, (program, location, count, v)); + } +} + +static void GLAPIENTRY +save_ProgramUniform2i64vARB(GLuint program, GLint location, GLsizei count, + const GLint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2I64V, 3 + POINTER_DWORDS); + if (n) { + n[1].ui = program; + n[2].i = location; + n[3].i = count; + save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64))); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform2i64vARB(ctx->Exec, (program, location, count, v)); + } +} + +static void GLAPIENTRY +save_ProgramUniform3i64vARB(GLuint program, GLint location, GLsizei count, + const GLint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3I64V, 3 + POINTER_DWORDS); + if (n) { + n[1].ui = program; + n[2].i = location; + n[3].i = count; + save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64))); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform3i64vARB(ctx->Exec, (program, location, count, v)); + } +} + +static void GLAPIENTRY +save_ProgramUniform4i64vARB(GLuint program, GLint location, GLsizei count, + const GLint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4I64V, 3 + POINTER_DWORDS); + if (n) { + n[1].ui = program; + n[2].i = location; + n[3].i = count; + save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64))); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform4i64vARB(ctx->Exec, (program, location, count, v)); + } +} + +static void GLAPIENTRY +save_ProgramUniform1ui64ARB(GLuint program, GLint location, GLuint64 x) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1UI64, 4); + if (n) { + n[1].ui = program; + n[2].i = location; + ASSIGN_UINT64_TO_NODES(n, 3, x); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform1ui64ARB(ctx->Exec, (program, location, x)); + } +} + +static void GLAPIENTRY +save_ProgramUniform2ui64ARB(GLuint program, GLint location, GLuint64 x, + GLuint64 y) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2UI64, 6); + if (n) { + n[1].ui = program; + n[2].i = location; + ASSIGN_UINT64_TO_NODES(n, 3, x); + ASSIGN_UINT64_TO_NODES(n, 5, y); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform2ui64ARB(ctx->Exec, (program, location, x, y)); + } +} + +static void GLAPIENTRY +save_ProgramUniform3ui64ARB(GLuint program, GLint location, GLuint64 x, + GLuint64 y, GLuint64 z) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3UI64, 8); + if (n) { + n[1].ui = program; + n[2].i = location; + ASSIGN_UINT64_TO_NODES(n, 3, x); + ASSIGN_UINT64_TO_NODES(n, 5, y); + ASSIGN_UINT64_TO_NODES(n, 7, z); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform3ui64ARB(ctx->Exec, (program, location, x, y, z)); + } +} + +static void GLAPIENTRY +save_ProgramUniform4ui64ARB(GLuint program, GLint location, GLuint64 x, + GLuint64 y, GLuint64 z, GLuint64 w) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4UI64, 10); + if (n) { + n[1].ui = program; + n[2].i = location; + ASSIGN_UINT64_TO_NODES(n, 3, x); + ASSIGN_UINT64_TO_NODES(n, 5, y); + ASSIGN_UINT64_TO_NODES(n, 7, z); + ASSIGN_UINT64_TO_NODES(n, 9, w); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform4i64ARB(ctx->Exec, (program, location, x, y, z, w)); + } +} + +static void GLAPIENTRY +save_ProgramUniform1ui64vARB(GLuint program, GLint location, GLsizei count, + const GLuint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1UI64V, + 3 + POINTER_DWORDS); + if (n) { + n[1].ui = program; + n[2].i = location; + n[3].i = count; + save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64))); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform1ui64vARB(ctx->Exec, (program, location, count, v)); + } +} + +static void GLAPIENTRY +save_ProgramUniform2ui64vARB(GLuint program, GLint location, GLsizei count, + const GLuint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2UI64V, + 3 + POINTER_DWORDS); + if (n) { + n[1].ui = program; + n[2].i = location; + n[3].i = count; + save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64))); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform2ui64vARB(ctx->Exec, (program, location, count, v)); + } +} + +static void GLAPIENTRY +save_ProgramUniform3ui64vARB(GLuint program, GLint location, GLsizei count, + const GLuint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3UI64V, + 3 + POINTER_DWORDS); + if (n) { + n[1].ui = program; + n[2].i = location; + n[3].i = count; + save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64))); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform3ui64vARB(ctx->Exec, (program, location, count, v)); + } +} + +static void GLAPIENTRY +save_ProgramUniform4ui64vARB(GLuint program, GLint location, GLsizei count, + const GLuint64 *v) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4UI64V, + 3 + POINTER_DWORDS); + if (n) { + n[1].ui = program; + n[2].i = location; + n[3].i = count; + save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64))); + } + if (ctx->ExecuteFlag) { + CALL_ProgramUniform4ui64vARB(ctx->Exec, (program, location, count, v)); + } +} + static void GLAPIENTRY save_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program) @@ -12099,6 +12755,294 @@ execute_list(struct gl_context *ctx, GLuint list) (n[1].i, n[2].i, n[3].b, get_pointer(&n[4]))); break; + case OPCODE_UNIFORM_1I64: { + union int64_pair x; + + x.int32[0] = n[2].i; + x.int32[1] = n[3].i; + + CALL_Uniform1i64ARB(ctx->Exec, (n[1].i, x.int64)); + break; + } + case OPCODE_UNIFORM_2I64: { + union int64_pair x; + union int64_pair y; + + x.int32[0] = n[2].i; + x.int32[1] = n[3].i; + y.int32[0] = n[4].i; + y.int32[1] = n[5].i; + + CALL_Uniform2i64ARB(ctx->Exec, (n[1].i, x.int64, y.int64)); + break; + } + case OPCODE_UNIFORM_3I64: { + union int64_pair x; + union int64_pair y; + union int64_pair z; + + x.int32[0] = n[2].i; + x.int32[1] = n[3].i; + y.int32[0] = n[4].i; + y.int32[1] = n[5].i; + z.int32[0] = n[6].i; + z.int32[1] = n[7].i; + + + CALL_Uniform3i64ARB(ctx->Exec, (n[1].i, x.int64, y.int64, z.int64)); + break; + } + case OPCODE_UNIFORM_4I64: { + union int64_pair x; + union int64_pair y; + union int64_pair z; + union int64_pair w; + + x.int32[0] = n[2].i; + x.int32[1] = n[3].i; + y.int32[0] = n[4].i; + y.int32[1] = n[5].i; + z.int32[0] = n[6].i; + z.int32[1] = n[7].i; + w.int32[0] = n[8].i; + w.int32[1] = n[9].i; + + CALL_Uniform4i64ARB(ctx->Exec, (n[1].i, x.int64, y.int64, z.int64, w.int64)); + break; + } + case OPCODE_UNIFORM_1I64V: + CALL_Uniform1i64vARB(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); + break; + case OPCODE_UNIFORM_2I64V: + CALL_Uniform2i64vARB(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); + break; + case OPCODE_UNIFORM_3I64V: + CALL_Uniform3i64vARB(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); + break; + case OPCODE_UNIFORM_4I64V: + CALL_Uniform4i64vARB(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); + break; + case OPCODE_UNIFORM_1UI64: { + union uint64_pair x; + + x.uint32[0] = n[2].ui; + x.uint32[1] = n[3].ui; + + CALL_Uniform1ui64ARB(ctx->Exec, (n[1].i, x.uint64)); + break; + } + case OPCODE_UNIFORM_2UI64: { + union uint64_pair x; + union uint64_pair y; + + x.uint32[0] = n[2].ui; + x.uint32[1] = n[3].ui; + y.uint32[0] = n[4].ui; + y.uint32[1] = n[5].ui; + + CALL_Uniform2ui64ARB(ctx->Exec, (n[1].i, x.uint64, y.uint64)); + break; + } + case OPCODE_UNIFORM_3UI64: { + union uint64_pair x; + union uint64_pair y; + union uint64_pair z; + + x.uint32[0] = n[2].ui; + x.uint32[1] = n[3].ui; + y.uint32[0] = n[4].ui; + y.uint32[1] = n[5].ui; + z.uint32[0] = n[6].ui; + z.uint32[1] = n[7].ui; + + + CALL_Uniform3ui64ARB(ctx->Exec, (n[1].i, x.uint64, y.uint64, + z.uint64)); + break; + } + case OPCODE_UNIFORM_4UI64: { + union uint64_pair x; + union uint64_pair y; + union uint64_pair z; + union uint64_pair w; + + x.uint32[0] = n[2].ui; + x.uint32[1] = n[3].ui; + y.uint32[0] = n[4].ui; + y.uint32[1] = n[5].ui; + z.uint32[0] = n[6].ui; + z.uint32[1] = n[7].ui; + w.uint32[0] = n[8].ui; + w.uint32[1] = n[9].ui; + + CALL_Uniform4ui64ARB(ctx->Exec, (n[1].i, x.uint64, y.uint64, + z.uint64, w.uint64)); + break; + } + case OPCODE_UNIFORM_1UI64V: + CALL_Uniform1ui64vARB(ctx->Exec, (n[1].i, n[2].i, + get_pointer(&n[3]))); + break; + case OPCODE_UNIFORM_2UI64V: + CALL_Uniform2ui64vARB(ctx->Exec, (n[1].i, n[2].i, + get_pointer(&n[3]))); + break; + case OPCODE_UNIFORM_3UI64V: + CALL_Uniform3ui64vARB(ctx->Exec, (n[1].i, n[2].i, + get_pointer(&n[3]))); + break; + case OPCODE_UNIFORM_4UI64V: + CALL_Uniform4ui64vARB(ctx->Exec, (n[1].i, n[2].i, + get_pointer(&n[3]))); + break; + + case OPCODE_PROGRAM_UNIFORM_1I64: { + union int64_pair x; + + x.int32[0] = n[3].i; + x.int32[1] = n[4].i; + + CALL_ProgramUniform1i64ARB(ctx->Exec, (n[1].ui, n[2].i, x.int64)); + break; + } + case OPCODE_PROGRAM_UNIFORM_2I64: { + union int64_pair x; + union int64_pair y; + + x.int32[0] = n[3].i; + x.int32[1] = n[4].i; + y.int32[0] = n[5].i; + y.int32[1] = n[6].i; + + CALL_ProgramUniform2i64ARB(ctx->Exec, (n[1].ui, n[2].i, x.int64, + y.int64)); + break; + } + case OPCODE_PROGRAM_UNIFORM_3I64: { + union int64_pair x; + union int64_pair y; + union int64_pair z; + + x.int32[0] = n[3].i; + x.int32[1] = n[4].i; + y.int32[0] = n[5].i; + y.int32[1] = n[6].i; + z.int32[0] = n[7].i; + z.int32[1] = n[8].i; + + CALL_ProgramUniform3i64ARB(ctx->Exec, (n[1].ui, n[2].i, x.int64, + y.int64, z.int64)); + break; + } + case OPCODE_PROGRAM_UNIFORM_4I64: { + union int64_pair x; + union int64_pair y; + union int64_pair z; + union int64_pair w; + + x.int32[0] = n[3].i; + x.int32[1] = n[4].i; + y.int32[0] = n[5].i; + y.int32[1] = n[6].i; + z.int32[0] = n[7].i; + z.int32[1] = n[8].i; + w.int32[0] = n[9].i; + w.int32[1] = n[10].i; + + CALL_ProgramUniform4i64ARB(ctx->Exec, (n[1].ui, n[2].i, x.int64, + y.int64, z.int64, w.int64)); + break; + } + case OPCODE_PROGRAM_UNIFORM_1I64V: + CALL_ProgramUniform1i64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i, + get_pointer(&n[4]))); + break; + case OPCODE_PROGRAM_UNIFORM_2I64V: + CALL_ProgramUniform2i64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i, + get_pointer(&n[4]))); + break; + case OPCODE_PROGRAM_UNIFORM_3I64V: + CALL_ProgramUniform3i64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i, + get_pointer(&n[4]))); + break; + case OPCODE_PROGRAM_UNIFORM_4I64V: + CALL_ProgramUniform4i64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i, + get_pointer(&n[4]))); + break; + case OPCODE_PROGRAM_UNIFORM_1UI64: { + union uint64_pair x; + + x.uint32[0] = n[3].ui; + x.uint32[1] = n[4].ui; + + CALL_ProgramUniform1i64ARB(ctx->Exec, (n[1].ui, n[2].i, x.uint64)); + break; + } + case OPCODE_PROGRAM_UNIFORM_2UI64: { + union uint64_pair x; + union uint64_pair y; + + x.uint32[0] = n[3].ui; + x.uint32[1] = n[4].ui; + y.uint32[0] = n[5].ui; + y.uint32[1] = n[6].ui; + + CALL_ProgramUniform2ui64ARB(ctx->Exec, (n[1].ui, n[2].i, x.uint64, + y.uint64)); + break; + } + case OPCODE_PROGRAM_UNIFORM_3UI64: { + union uint64_pair x; + union uint64_pair y; + union uint64_pair z; + + x.uint32[0] = n[3].ui; + x.uint32[1] = n[4].ui; + y.uint32[0] = n[5].ui; + y.uint32[1] = n[6].ui; + z.uint32[0] = n[7].ui; + z.uint32[1] = n[8].ui; + + CALL_ProgramUniform3ui64ARB(ctx->Exec, (n[1].ui, n[2].i, x.uint64, + y.uint64, z.uint64)); + break; + } + case OPCODE_PROGRAM_UNIFORM_4UI64: { + union uint64_pair x; + union uint64_pair y; + union uint64_pair z; + union uint64_pair w; + + x.uint32[0] = n[3].ui; + x.uint32[1] = n[4].ui; + y.uint32[0] = n[5].ui; + y.uint32[1] = n[6].ui; + z.uint32[0] = n[7].ui; + z.uint32[1] = n[8].ui; + w.uint32[0] = n[9].ui; + w.uint32[1] = n[10].ui; + + CALL_ProgramUniform4ui64ARB(ctx->Exec, (n[1].ui, n[2].i, x.uint64, + y.uint64, z.uint64, w.uint64)); + break; + } + case OPCODE_PROGRAM_UNIFORM_1UI64V: + CALL_ProgramUniform1ui64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i, + get_pointer(&n[4]))); + break; + case OPCODE_PROGRAM_UNIFORM_2UI64V: + CALL_ProgramUniform2ui64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i, + get_pointer(&n[4]))); + break; + case OPCODE_PROGRAM_UNIFORM_3UI64V: + CALL_ProgramUniform3ui64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i, + get_pointer(&n[4]))); + break; + case OPCODE_PROGRAM_UNIFORM_4UI64V: + CALL_ProgramUniform4ui64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i, + get_pointer(&n[4]))); + break; + case OPCODE_USE_PROGRAM_STAGES: CALL_UseProgramStages(ctx->Exec, (n[1].ui, n[2].ui, n[3].ui)); break; @@ -13877,6 +14821,41 @@ _mesa_initialize_save_table(const struct gl_context *ctx) SET_UniformMatrix3x4dv(table, save_UniformMatrix3x4dv); SET_UniformMatrix4x3dv(table, save_UniformMatrix4x3dv); + /* GL_ARB_gpu_shader_int64 */ + SET_Uniform1i64ARB(table, save_Uniform1i64ARB); + SET_Uniform2i64ARB(table, save_Uniform2i64ARB); + SET_Uniform3i64ARB(table, save_Uniform3i64ARB); + SET_Uniform4i64ARB(table, save_Uniform4i64ARB); + SET_Uniform1i64vARB(table, save_Uniform1i64vARB); + SET_Uniform2i64vARB(table, save_Uniform2i64vARB); + SET_Uniform3i64vARB(table, save_Uniform3i64vARB); + SET_Uniform4i64vARB(table, save_Uniform4i64vARB); + SET_Uniform1ui64ARB(table, save_Uniform1ui64ARB); + SET_Uniform2ui64ARB(table, save_Uniform2ui64ARB); + SET_Uniform3ui64ARB(table, save_Uniform3ui64ARB); + SET_Uniform4ui64ARB(table, save_Uniform4ui64ARB); + SET_Uniform1ui64vARB(table, save_Uniform1ui64vARB); + SET_Uniform2ui64vARB(table, save_Uniform2ui64vARB); + SET_Uniform3ui64vARB(table, save_Uniform3ui64vARB); + SET_Uniform4ui64vARB(table, save_Uniform4ui64vARB); + + SET_ProgramUniform1i64ARB(table, save_ProgramUniform1i64ARB); + SET_ProgramUniform2i64ARB(table, save_ProgramUniform2i64ARB); + SET_ProgramUniform3i64ARB(table, save_ProgramUniform3i64ARB); + SET_ProgramUniform4i64ARB(table, save_ProgramUniform4i64ARB); + SET_ProgramUniform1i64vARB(table, save_ProgramUniform1i64vARB); + SET_ProgramUniform2i64vARB(table, save_ProgramUniform2i64vARB); + SET_ProgramUniform3i64vARB(table, save_ProgramUniform3i64vARB); + SET_ProgramUniform4i64vARB(table, save_ProgramUniform4i64vARB); + SET_ProgramUniform1ui64ARB(table, save_ProgramUniform1ui64ARB); + SET_ProgramUniform2ui64ARB(table, save_ProgramUniform2ui64ARB); + SET_ProgramUniform3ui64ARB(table, save_ProgramUniform3ui64ARB); + SET_ProgramUniform4ui64ARB(table, save_ProgramUniform4ui64ARB); + SET_ProgramUniform1ui64vARB(table, save_ProgramUniform1ui64vARB); + SET_ProgramUniform2ui64vARB(table, save_ProgramUniform2ui64vARB); + SET_ProgramUniform3ui64vARB(table, save_ProgramUniform3ui64vARB); + SET_ProgramUniform4ui64vARB(table, save_ProgramUniform4ui64vARB); + /* These are: */ SET_BeginTransformFeedback(table, save_BeginTransformFeedback); SET_EndTransformFeedback(table, save_EndTransformFeedback);