From 2ce5db3930ca3441b5647b907531c24e058b45ff Mon Sep 17 00:00:00 2001 From: Laura Ekstrand Date: Wed, 10 Dec 2014 16:19:21 -0800 Subject: [PATCH] main: Added entry point for glTextureParameterfv. Reviewed-by: Anuj Phogat --- .../glapi/gen/ARB_direct_state_access.xml | 12 +++++ src/mesa/main/tests/dispatch_sanity.cpp | 2 + src/mesa/main/texparam.c | 51 ++++++++++++++----- src/mesa/main/texparam.h | 7 +++ 4 files changed, 59 insertions(+), 13 deletions(-) diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index 0757b986353..68c6ebe3882 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -81,6 +81,18 @@ + + + + + + + + + + + + diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index af838673922..8d7f37a4e54 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -964,6 +964,8 @@ const struct function gl_core_functions_possible[] = { { "glTextureSubImage3D", 45, -1 }, { "glBindTextureUnit", 45, -1 }, { "glTextureParameterf", 45, -1 }, + { "glTextureParameterfv", 45, -1 }, + { "glTextureParameteri", 45, -1 }, { NULL, 0, -1 } }; diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 94e4a13520f..4843f9c49ab 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -813,17 +813,12 @@ _mesa_texture_parameterf(struct gl_context *ctx, } -void GLAPIENTRY -_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) +void +_mesa_texture_parameterfv(struct gl_context *ctx, + struct gl_texture_object *texObj, + GLenum pname, const GLfloat *params, bool dsa) { GLboolean need_update; - struct gl_texture_object *texObj; - GET_CURRENT_CONTEXT(ctx); - - texObj = get_texobj_by_target(ctx, target, GL_FALSE); - if (!texObj) - return; - switch (pname) { case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: @@ -844,7 +839,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) GLint p[4]; p[0] = (GLint) params[0]; p[1] = p[2] = p[3] = 0; - need_update = set_tex_parameteri(ctx, texObj, pname, p, false); + need_update = set_tex_parameteri(ctx, texObj, pname, p, dsa); } break; case GL_TEXTURE_CROP_RECT_OES: @@ -855,7 +850,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) iparams[1] = (GLint) params[1]; iparams[2] = (GLint) params[2]; iparams[3] = (GLint) params[3]; - need_update = set_tex_parameteri(ctx, texObj, pname, iparams, false); + need_update = set_tex_parameteri(ctx, texObj, pname, iparams, dsa); } break; case GL_TEXTURE_SWIZZLE_R_EXT: @@ -871,12 +866,12 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) p[2] = (GLint) params[2]; p[3] = (GLint) params[3]; } - need_update = set_tex_parameteri(ctx, texObj, pname, p, false); + need_update = set_tex_parameteri(ctx, texObj, pname, p, dsa); } break; default: /* this will generate an error if pname is illegal */ - need_update = set_tex_parameterf(ctx, texObj, pname, params, false); + need_update = set_tex_parameterf(ctx, texObj, pname, params, dsa); } if (ctx->Driver.TexParameter && need_update) { @@ -996,6 +991,19 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) _mesa_texture_parameterf(ctx, texObj, pname, param, false); } +void GLAPIENTRY +_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + + texObj = get_texobj_by_target(ctx, target, GL_FALSE); + if (!texObj) + return; + + _mesa_texture_parameterfv(ctx, texObj, pname, params, false); +} + /** * Set tex parameter to integer value(s). Primarily intended to set * integer-valued texture border color (for integer-valued textures). @@ -1053,6 +1061,23 @@ _mesa_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params) /* XXX no driver hook for TexParameterIuiv() yet */ } + +void GLAPIENTRY +_mesa_TextureParameterfv(GLuint texture, GLenum pname, const GLfloat *params) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + + texObj = get_texobj_by_name(ctx, texture, GL_FALSE); + if (!texObj) { + /* User passed a non-generated name. */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glTextureParameterfv(texture)"); + return; + } + + _mesa_texture_parameterfv(ctx, texObj, pname, params, true); +} + void GLAPIENTRY _mesa_TextureParameterf(GLuint texture, GLenum pname, GLfloat param) { diff --git a/src/mesa/main/texparam.h b/src/mesa/main/texparam.h index a5f7c4dbb75..cf3efec88f6 100644 --- a/src/mesa/main/texparam.h +++ b/src/mesa/main/texparam.h @@ -39,6 +39,11 @@ _mesa_texture_parameterf(struct gl_context *ctx, struct gl_texture_object *texObj, GLenum pname, GLfloat param, bool dsa); +extern void +_mesa_texture_parameterfv(struct gl_context *ctx, + struct gl_texture_object *texObj, + GLenum pname, const GLfloat *params, bool dsa); + /*@}*/ /** @@ -88,6 +93,8 @@ _mesa_TexParameterIiv(GLenum target, GLenum pname, const GLint *params); extern void GLAPIENTRY _mesa_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params); +extern void GLAPIENTRY +_mesa_TextureParameterfv(GLuint texture, GLenum pname, const GLfloat *params); extern void GLAPIENTRY _mesa_TextureParameterf(GLuint texture, GLenum pname, GLfloat param); -- 2.30.2