summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorLaura Ekstrand <[email protected]>2014-12-10 15:32:20 -0800
committerLaura Ekstrand <[email protected]>2015-01-08 11:37:29 -0800
commit89912d04a10d6d70c3f9791beecace76c6c550a0 (patch)
tree592c59f1e7ee350d08bdb08d34950290934c03cf /src/mesa/main
parent86bb3be3193512c12c284bb2cc609fa78d27fc55 (diff)
main: Added entry point for glGetTextureParameterfv.
Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp1
-rw-r--r--src/mesa/main/texparam.c52
-rw-r--r--src/mesa/main/texparam.h5
3 files changed, 46 insertions, 12 deletions
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index c75b284100a..7ee3109b0a8 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -971,6 +971,7 @@ const struct function gl_core_functions_possible[] = {
{ "glTextureParameteriv", 45, -1 },
{ "glGetTextureLevelParameterfv", 45, -1 },
{ "glGetTextureLevelParameteriv", 45, -1 },
+ { "glGetTextureParameterfv", 45, -1 },
{ NULL, 0, -1 }
};
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 6b8532f965b..fc721dd5569 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1678,16 +1678,15 @@ _mesa_GetTextureLevelParameteriv(GLuint texture, GLint level,
pname, params, true);
}
-void GLAPIENTRY
-_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
+/**
+ * This isn't exposed to the rest of the driver because it is a part of the
+ * OpenGL API that is rarely used.
+ */
+static void
+get_tex_parameterfv(struct gl_context *ctx,
+ struct gl_texture_object *obj,
+ GLenum pname, GLfloat *params, bool dsa)
{
- struct gl_texture_object *obj;
- GET_CURRENT_CONTEXT(ctx);
-
- obj = get_texobj_by_target(ctx, target, GL_TRUE);
- if (!obj)
- return;
-
_mesa_lock_context_textures(ctx);
switch (pname) {
case GL_TEXTURE_MAG_FILTER:
@@ -1900,7 +1899,8 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
invalid_pname:
_mesa_unlock_context_textures(ctx);
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", pname);
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTex%sParameterfv(pname=0x%x)",
+ dsa ? "ture" : "", pname);
}
@@ -2125,6 +2125,20 @@ invalid_pname:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", pname);
}
+void GLAPIENTRY
+_mesa_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ struct gl_texture_object *obj;
+ GET_CURRENT_CONTEXT(ctx);
+
+ obj = get_texobj_by_target(ctx, target, GL_TRUE);
+ if (!obj)
+ return;
+
+ get_tex_parameterfv(ctx, obj, pname, params, false);
+}
+
+
/** New in GL 3.0 */
void GLAPIENTRY
_mesa_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params)
@@ -2175,3 +2189,21 @@ _mesa_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params)
}
}
}
+
+
+void GLAPIENTRY
+_mesa_GetTextureParameterfv(GLuint texture, GLenum pname, GLfloat *params)
+{
+ struct gl_texture_object *obj;
+ GET_CURRENT_CONTEXT(ctx);
+
+ obj = get_texobj_by_name(ctx, texture, GL_TRUE);
+ if (!obj) {
+ /* User passed a non-generated name. */
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetTextureParameterfv(texture)");
+ return;
+ }
+
+ get_tex_parameterfv(ctx, obj, pname, params, true);
+}
diff --git a/src/mesa/main/texparam.h b/src/mesa/main/texparam.h
index 961081def16..11cbf346408 100644
--- a/src/mesa/main/texparam.h
+++ b/src/mesa/main/texparam.h
@@ -104,19 +104,20 @@ _mesa_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params);
extern void GLAPIENTRY
+_mesa_GetTextureParameterfv(GLuint texture, GLenum pname, GLfloat *params);
+
+extern void GLAPIENTRY
_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params );
extern void GLAPIENTRY
_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param );
-
extern void GLAPIENTRY
_mesa_TexParameteri( GLenum target, GLenum pname, GLint param );
extern void GLAPIENTRY
_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params );
-
extern void GLAPIENTRY
_mesa_TexParameterIiv(GLenum target, GLenum pname, const GLint *params);