diff options
-rw-r--r-- | src/mapi/glapi/gen/EXT_direct_state_access.xml | 10 | ||||
-rw-r--r-- | src/mapi/glapi/gen/static_data.py | 1 | ||||
-rw-r--r-- | src/mesa/main/arbprogram.c | 55 | ||||
-rw-r--r-- | src/mesa/main/arbprogram.h | 3 | ||||
-rw-r--r-- | src/mesa/main/tests/dispatch_sanity.cpp | 2 |
5 files changed, 56 insertions, 15 deletions
diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index 4e1bd241ee0..bf900eb9306 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -1162,5 +1162,15 @@ ProgramUniform*EXT functions are added in EXT_separate_shader_objects.xml --> + <!-- EXT_gpu_program_parameters --> + + <function name="NamedProgramLocalParameters4fvEXT"> + <param name="program" type="GLuint" /> + <param name="target" type="GLenum" /> + <param name="index" type="GLuint" /> + <param name="count" type="GLsizei" /> + <param name="params" type="const GLfloat*" /> + </function> + </category> </OpenGLAPI> diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index 938acbc0191..f4ad5da6f3e 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1592,6 +1592,7 @@ offsets = { "MultiTexParameterIuivEXT": 1556, "GetMultiTexParameterIivEXT": 1557, "GetMultiTexParameterIuivEXT": 1558, + "NamedProgramLocalParameters4fvEXT": 1559, } functions = [ diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c index 062052b5061..ac7aa49213e 100644 --- a/src/mesa/main/arbprogram.c +++ b/src/mesa/main/arbprogram.c @@ -680,32 +680,28 @@ _mesa_NamedProgramLocalParameter4fvEXT(GLuint program, GLenum target, GLuint ind } -void GLAPIENTRY -_mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, - const GLfloat *params) +static void +program_local_parameters4fv(struct gl_program* prog, GLuint index, GLsizei count, + const GLfloat *params, const char* caller) { GET_CURRENT_CONTEXT(ctx); GLfloat *dest; - struct gl_program* prog = get_current_program(ctx, target, "glProgramLocalParameters4fv"); - if (!prog) { - return; - } - - flush_vertices_for_program_constants(ctx, target); + flush_vertices_for_program_constants(ctx, prog->Target); if (count <= 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fv(count)"); + _mesa_error(ctx, GL_INVALID_VALUE, "%s(count)", caller); } - if (get_local_param_pointer(ctx, "glProgramLocalParameters4fvEXT", - prog, target, index, &dest)) { - GLuint maxParams = target == GL_FRAGMENT_PROGRAM_ARB ? + if (get_local_param_pointer(ctx, caller, + prog, prog->Target, index, &dest)) { + GLuint maxParams = prog->Target == GL_FRAGMENT_PROGRAM_ARB ? ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams : ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams; if ((index + count) > maxParams) { _mesa_error(ctx, GL_INVALID_VALUE, - "glProgramLocalParameters4fvEXT(index + count)"); + "%s(index + count)", + caller); return; } @@ -715,6 +711,37 @@ _mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, void GLAPIENTRY +_mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, + const GLfloat *params) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_program* prog = get_current_program(ctx, target, + "glProgramLocalParameters4fv"); + if (!prog) { + return; + } + + program_local_parameters4fv(prog, index, count, params, + "glProgramLocalParameters4fv"); +} + +void GLAPIENTRY +_mesa_NamedProgramLocalParameters4fvEXT(GLuint program, GLenum target, GLuint index, + GLsizei count, const GLfloat *params) +{ + struct gl_program* prog = + lookup_or_create_program(program, target, + "glNamedProgramLocalParameters4fvEXT"); + if (!prog) { + return; + } + + program_local_parameters4fv(prog, index, count, params, + "glNamedProgramLocalParameters4fvEXT"); +} + + +void GLAPIENTRY _mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) diff --git a/src/mesa/main/arbprogram.h b/src/mesa/main/arbprogram.h index 0a86e9d5e18..d7fa15ba570 100644 --- a/src/mesa/main/arbprogram.h +++ b/src/mesa/main/arbprogram.h @@ -121,6 +121,9 @@ extern void GLAPIENTRY _mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat *params); +extern void GLAPIENTRY +_mesa_NamedProgramLocalParameters4fvEXT(GLuint program, GLenum target, GLuint index, + GLsizei count, const GLfloat *params); extern void GLAPIENTRY _mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index, diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index b87f2e298e6..6782e7504d6 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -1151,7 +1151,7 @@ const struct function common_desktop_functions_possible[] = { /* GL_EXT_direct_state_access - EXT_gpu_shader4 */ /* Added glProgramUniform*u*EXT functions are aliases */ /* GL_EXT_direct_state_access - EXT_gpu_program_parameters */ - //{ "glNamedProgramLocalParameters4fvEXT", 10, -1 }, + { "glNamedProgramLocalParameters4fvEXT", 10, -1 }, /* GL_EXT_direct_state_access - GL 3.0 */ //{ "glGetFloati_vEXT", 30, -1 }, //{ "glGetDoublei_vEXT", 30, -1 }, |