[Mesa-dev] [PATCH 19/41] main: Added entry point for glTextureParameterfv.

Laura Ekstrand laura at jlekstrand.net
Mon Dec 15 17:22:34 PST 2014


---
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  6 +++
 src/mesa/main/texparam.c                       | 52 +++++++++++++++++++-------
 src/mesa/main/texparam.h                       |  8 ++++
 3 files changed, 53 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 0757b98..8279ad2 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -81,6 +81,12 @@
       <param name="param" type="GLfloat" />
    </function>
 
+   <function name="TextureParameterfv" offset="assign">
+      <param name="texture" type="GLuint" />
+      <param name="pname" type="GLenum" />
+      <param name="param" type="const GLfloat *" />
+   </function>
+
    <function name="BindTextureUnit" offset="assign">
       <param name="unit" type="GLuint" />
       <param name="texture" type="GLuint" />
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index cd1a094..b19e4f1 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -818,17 +818,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(ctx, target, GL_FALSE);
-   if (!texObj)
-      return;
-
    switch (pname) {
    case GL_TEXTURE_MIN_FILTER:
    case GL_TEXTURE_MAG_FILTER:
@@ -849,7 +844,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:
@@ -860,7 +855,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:
@@ -876,12 +871,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) {
@@ -1002,6 +997,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(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).
@@ -1059,6 +1067,24 @@ _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 a138b56..1514f42 100644
--- a/src/mesa/main/texparam.h
+++ b/src/mesa/main/texparam.h
@@ -39,6 +39,10 @@ _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,8 +92,12 @@ _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 );
 
+
 #endif /* TEXPARAM_H */
-- 
2.1.0



More information about the mesa-dev mailing list