diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mapi/glapi/gen/EXT_direct_state_access.xml | 28 | ||||
-rw-r--r-- | src/mapi/glapi/gen/static_data.py | 4 | ||||
-rw-r--r-- | src/mesa/main/dlist.c | 89 | ||||
-rw-r--r-- | src/mesa/main/tests/dispatch_sanity.cpp | 8 | ||||
-rw-r--r-- | src/mesa/main/texparam.c | 87 | ||||
-rw-r--r-- | src/mesa/main/texparam.h | 12 |
6 files changed, 224 insertions, 4 deletions
diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index 7b52b47e5ea..a22ad73ed74 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -383,6 +383,34 @@ <param name="param" type="GLfloat *" /> </function> + <function name="MultiTexParameteriEXT"> + <param name="texunit" type="GLenum" /> + <param name="target" type="GLenum" /> + <param name="pname" type="GLenum" /> + <param name="param" type="GLint" /> + </function> + + <function name="MultiTexParameterivEXT"> + <param name="texunit" type="GLenum" /> + <param name="target" type="GLenum" /> + <param name="pname" type="GLenum" /> + <param name="param" type="const GLint*" /> + </function> + + <function name="MultiTexParameterfEXT"> + <param name="texunit" type="GLenum" /> + <param name="target" type="GLenum" /> + <param name="pname" type="GLenum" /> + <param name="param" type="GLfloat" /> + </function> + + <function name="MultiTexParameterfvEXT"> + <param name="texunit" type="GLenum" /> + <param name="target" type="GLenum" /> + <param name="pname" type="GLenum" /> + <param name="param" type="const GLfloat*" /> + </function> + <!-- OpenGL 1.3 --> <function name="MatrixLoadTransposefEXT" offset="assign"> diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index ae14df59212..73688de9c3e 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1523,6 +1523,10 @@ offsets = { "MultiTexEnvfvEXT": 1487, "GetMultiTexEnvivEXT": 1488, "GetMultiTexEnvfvEXT": 1489, + "MultiTexParameteriEXT": 1490, + "MultiTexParameterivEXT": 1491, + "MultiTexParameterfEXT": 1492, + "MultiTexParameterfvEXT": 1493, } functions = [ diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 6abb1c29dce..995e1fdc636 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -581,6 +581,8 @@ typedef enum OPCODE_COPY_TEXTURE_SUB_IMAGE1D, OPCODE_COPY_TEXTURE_SUB_IMAGE2D, OPCODE_COPY_TEXTURE_SUB_IMAGE3D, + OPCODE_MULTITEXPARAMETER_F, + OPCODE_MULTITEXPARAMETER_I, OPCODE_MULTITEXENV, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D, @@ -9909,6 +9911,69 @@ save_CopyTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, static void GLAPIENTRY +save_MultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, + const GLfloat *params) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_F, 7); + if (n) { + n[1].e = texunit; + n[2].e = target; + n[3].e = pname; + n[4].f = params[0]; + n[5].f = params[1]; + n[6].f = params[2]; + n[7].f = params[3]; + } + if (ctx->ExecuteFlag) { + CALL_MultiTexParameterfvEXT(ctx->Exec, (texunit, target, pname, params)); + } +} + + +static void GLAPIENTRY +save_MultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) +{ + GLfloat parray[4]; + parray[0] = param; + parray[1] = parray[2] = parray[3] = 0.0F; + save_MultiTexParameterfvEXT(texunit, target, pname, parray); +} + +static void GLAPIENTRY +save_MultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_I, 7); + if (n) { + n[1].e = texunit; + n[2].e = target; + n[3].e = pname; + n[4].i = params[0]; + n[5].i = params[1]; + n[6].i = params[2]; + n[7].i = params[3]; + } + if (ctx->ExecuteFlag) { + CALL_MultiTexParameterivEXT(ctx->Exec, (texunit, target, pname, params)); + } +} + +static void GLAPIENTRY +save_MultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) +{ + GLint fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0; + save_MultiTexParameterivEXT(texunit, target, pname, fparam); +} + + +static void GLAPIENTRY save_MultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -11702,6 +11767,26 @@ execute_list(struct gl_context *ctx, GLuint list) n[7].i, n[8].i, n[9].i, n[10].i)); break; + case OPCODE_MULTITEXPARAMETER_F: + { + GLfloat params[4]; + params[0] = n[4].f; + params[1] = n[5].f; + params[2] = n[6].f; + params[3] = n[7].f; + CALL_MultiTexParameterfvEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, params)); + } + break; + case OPCODE_MULTITEXPARAMETER_I: + { + GLint params[4]; + params[0] = n[4].i; + params[1] = n[5].i; + params[2] = n[6].i; + params[3] = n[7].i; + CALL_MultiTexParameterivEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, params)); + } + break; case OPCODE_MULTITEXENV: { GLfloat params[4]; @@ -12725,6 +12810,10 @@ _mesa_initialize_save_table(const struct gl_context *ctx) SET_CopyTextureSubImage1DEXT(table, save_CopyTextureSubImage1DEXT); SET_CopyTextureSubImage2DEXT(table, save_CopyTextureSubImage2DEXT); SET_CopyTextureSubImage3DEXT(table, save_CopyTextureSubImage3DEXT); + SET_MultiTexParameteriEXT(table, save_MultiTexParameteriEXT); + SET_MultiTexParameterivEXT(table, save_MultiTexParameterivEXT); + SET_MultiTexParameterfEXT(table, save_MultiTexParameterfEXT); + SET_MultiTexParameterfvEXT(table, save_MultiTexParameterfvEXT); SET_MultiTexEnvfEXT(table, save_MultiTexEnvfEXT); SET_MultiTexEnvfvEXT(table, save_MultiTexEnvfvEXT); SET_MultiTexEnviEXT(table, save_MultiTexEnviEXT); diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 0702c6de0a3..661f275af7f 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -1072,10 +1072,10 @@ const struct function common_desktop_functions_possible[] = { //{ "glGetMultiTexGendvEXT", 12, -1 }, //{ "glGetMultiTexGenfvEXT", 12, -1 }, //{ "glGetMultiTexGenivEXT", 12, -1 }, - //{ "glMultiTexParameterfEXT", 12, -1 }, - //{ "glMultiTexParameterfvEXT", 12, -1 }, - //{ "glMultiTexParameteriEXT", 12, -1 }, - //{ "glMultiTexParameterivEXT", 12, -1 }, + { "glMultiTexParameterfEXT", 12, -1 }, + { "glMultiTexParameterfvEXT", 12, -1 }, + { "glMultiTexParameteriEXT", 12, -1 }, + { "glMultiTexParameterivEXT", 12, -1 }, //{ "glMultiTexImage1DEXT", 12, -1 }, //{ "glMultiTexImage2DEXT", 12, -1 }, //{ "glMultiTexSubImage1DEXT", 12, -1 }, diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 78888b660fa..a61bd57d7d2 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1196,6 +1196,27 @@ _mesa_TextureParameterfv(GLuint texture, GLenum pname, const GLfloat *params) } void GLAPIENTRY +_mesa_MultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + + texObj = _mesa_get_texobj_by_target_and_texunit(ctx, target, + texunit - GL_TEXTURE0, + false, + "glMultiTexParameterfvEXT"); + if (!texObj) + return; + + if (!is_texparameteri_target_valid(texObj->Target)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glMultiTexParameterifvEXT(target)"); + return; + } + + _mesa_texture_parameterfv(ctx, texObj, pname, params, true); +} + +void GLAPIENTRY _mesa_TextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat param) { struct gl_texture_object *texObj; @@ -1215,6 +1236,28 @@ _mesa_TextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat } void GLAPIENTRY +_mesa_MultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, + GLfloat param) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + + texObj = _mesa_get_texobj_by_target_and_texunit(ctx, target, + texunit - GL_TEXTURE0, + false, + "glMultiTexParameterfEXT"); + if (!texObj) + return; + + if (!is_texparameteri_target_valid(texObj->Target)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glMultiTexParameterfEXT"); + return; + } + + _mesa_texture_parameterf(ctx, texObj, pname, param, true); +} + +void GLAPIENTRY _mesa_TextureParameterf(GLuint texture, GLenum pname, GLfloat param) { struct gl_texture_object *texObj; @@ -1247,6 +1290,28 @@ _mesa_TextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint pa } void GLAPIENTRY +_mesa_MultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, + GLint param) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + + texObj = _mesa_get_texobj_by_target_and_texunit(ctx, target, + texunit - GL_TEXTURE0, + false, + "glMultiTexParameteriEXT"); + if (!texObj) + return; + + if (!is_texparameteri_target_valid(texObj->Target)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glMultiTexParameteriEXT(target)"); + return; + } + + _mesa_texture_parameteri(ctx, texObj, pname, param, true); +} + +void GLAPIENTRY _mesa_TextureParameteri(GLuint texture, GLenum pname, GLint param) { struct gl_texture_object *texObj; @@ -1280,6 +1345,28 @@ _mesa_TextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, } void GLAPIENTRY +_mesa_MultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, + const GLint *params) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + + texObj = _mesa_get_texobj_by_target_and_texunit(ctx, target, + texunit - GL_TEXTURE0, + false, + "glMultiTexParameterivEXT"); + if (!texObj) + return; + + if (!is_texparameteri_target_valid(texObj->Target)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glMultiTexParameterivEXT(target)"); + return; + } + + _mesa_texture_parameteriv(ctx, texObj, pname, params, true); +} + +void GLAPIENTRY _mesa_TextureParameteriv(GLuint texture, GLenum pname, const GLint *params) { diff --git a/src/mesa/main/texparam.h b/src/mesa/main/texparam.h index 77cb6ff6584..a336d2bb6ad 100644 --- a/src/mesa/main/texparam.h +++ b/src/mesa/main/texparam.h @@ -185,4 +185,16 @@ _mesa_TextureParameterIiv(GLuint texture, GLenum pname, const GLint *params); extern void GLAPIENTRY _mesa_TextureParameterIuiv(GLuint texture, GLenum pname, const GLuint *params); +extern void GLAPIENTRY +_mesa_MultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param); + +extern void GLAPIENTRY +_mesa_MultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); + +extern void GLAPIENTRY +_mesa_MultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param); + +extern void GLAPIENTRY +_mesa_MultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params); + #endif /* TEXPARAM_H */ |