summaryrefslogtreecommitdiff
path: root/src/mesa/main/texgetimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texgetimage.c')
-rw-r--r--src/mesa/main/texgetimage.c64
1 files changed, 38 insertions, 26 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index d786c41d2e..66d01c15d0 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -35,37 +35,11 @@
#include "context.h"
#include "formats.h"
#include "image.h"
-#include "texcompress.h"
#include "texgetimage.h"
#include "teximage.h"
-#include "texstate.h"
-#if FEATURE_EXT_texture_sRGB
-
-/**
- * Convert a float value from linear space to a
- * non-linear sRGB value in [0, 255].
- * Not terribly efficient.
- */
-static INLINE GLfloat
-linear_to_nonlinear(GLfloat cl)
-{
- /* can't have values outside [0, 1] */
- GLfloat cs;
- if (cl < 0.0031308f) {
- cs = 12.92f * cl;
- }
- else {
- cs = (GLfloat)(1.055 * _mesa_pow(cl, 0.41666) - 0.055);
- }
- return cs;
-}
-
-#endif /* FEATURE_EXT_texture_sRGB */
-
-
/**
* Can the given type represent negative values?
*/
@@ -233,6 +207,29 @@ get_tex_ycbcr(GLcontext *ctx, GLuint dimensions,
}
+#if FEATURE_EXT_texture_sRGB
+
+
+/**
+ * Convert a float value from linear space to a
+ * non-linear sRGB value in [0, 255].
+ * Not terribly efficient.
+ */
+static INLINE GLfloat
+linear_to_nonlinear(GLfloat cl)
+{
+ /* can't have values outside [0, 1] */
+ GLfloat cs;
+ if (cl < 0.0031308f) {
+ cs = 12.92f * cl;
+ }
+ else {
+ cs = (GLfloat)(1.055 * _mesa_pow(cl, 0.41666) - 0.055);
+ }
+ return cs;
+}
+
+
/**
* glGetTexImagefor sRGB pixels;
*/
@@ -284,6 +281,21 @@ get_tex_srgb(GLcontext *ctx, GLuint dimensions,
}
+#else /* FEATURE_EXT_texture_sRGB */
+
+
+static INLINE void
+get_tex_srgb(GLcontext *ctx, GLuint dimensions,
+ GLenum format, GLenum type, GLvoid *pixels,
+ const struct gl_texture_image *texImage)
+{
+ ASSERT_NO_FEATURE();
+}
+
+
+#endif /* FEATURE_EXT_texture_sRGB */
+
+
/**
* glGetTexImagefor RGBA, Luminance, etc. pixels.
* This is the slow way since we use texture sampling.