From: Pierre-Eric Pelloux-Prayer Date: Mon, 9 Sep 2019 15:26:30 +0000 (+0200) Subject: mesa: add EXT_dsa + EXT_gpu_program_parameters functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a4e935f2d70304a89104157378a4033ba10cd3e0;p=mesa.git mesa: add EXT_dsa + EXT_gpu_program_parameters functions Reviewed-by: Marek Olšák --- 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 --> + + + + + + + + + + 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; } @@ -714,6 +710,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, 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 },