summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/getstring.c3
-rw-r--r--src/mesa/main/image.c19
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/rastpos.c3
-rw-r--r--src/mesa/main/texstore.c2
5 files changed, 19 insertions, 9 deletions
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index f033ddc895..0c925ed761 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -114,7 +114,8 @@ _mesa_GetString( GLenum name )
ctx->Extensions.ARB_shader_objects &&
ctx->Extensions.ARB_vertex_shader &&
ctx->Extensions.ARB_fragment_shader &&
- ctx->Extensions.ARB_texture_non_power_of_two) {
+ ctx->Extensions.ARB_texture_non_power_of_two &&
+ ctx->Extensions.EXT_blend_equation_separate) {
if (ctx->Extensions.ARB_shading_language_120 &&
ctx->Extensions.EXT_pixel_buffer_object &&
ctx->Extensions.EXT_texture_sRGB) {
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index fc8e1f0f57..eb91ebb611 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1182,15 +1182,24 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) {
/* compute luminance values */
- if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
+ if (transferOps & IMAGE_RED_TO_LUMINANCE) {
+ /* Luminance = Red (glGetTexImage) */
for (i = 0; i < n; i++) {
- GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
- luminance[i] = CLAMP(sum, 0.0F, 1.0F);
+ luminance[i] = rgba[i][RCOMP];
}
}
else {
- for (i = 0; i < n; i++) {
- luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
+ /* Luminance = Red + Green + Blue (glReadPixels) */
+ if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
+ for (i = 0; i < n; i++) {
+ GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
+ luminance[i] = CLAMP(sum, 0.0F, 1.0F);
+ }
+ }
+ else {
+ for (i = 0; i < n; i++) {
+ luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
+ }
}
}
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 422d176c25..7caa1f8d7f 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2540,6 +2540,7 @@ struct matrix_stack
#define IMAGE_HISTOGRAM_BIT 0x200
#define IMAGE_MIN_MAX_BIT 0x400
#define IMAGE_CLAMP_BIT 0x800 /* extra */
+#define IMAGE_RED_TO_LUMINANCE 0x1000
/** Pixel Transfer ops up to convolution */
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index d4f0fa2a71..4a0c24fdbc 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -133,8 +133,7 @@ shade_rastpos(GLcontext *ctx,
GLfloat diffuseColor[4], specularColor[4]; /* for RGB mode only */
GLfloat diffuseCI = 0.0, specularCI = 0.0; /* for CI mode only */
- if (!ctx->_ShineTable[0] || !ctx->_ShineTable[1])
- _mesa_validate_all_lighting_tables( ctx );
+ _mesa_validate_all_lighting_tables( ctx );
COPY_3V(diffuseColor, base[0]);
diffuseColor[3] = CLAMP(
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 87f8fa7a0d..994fb16730 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3611,7 +3611,7 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level,
}
_mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba,
format, type, dest,
- &ctx->Pack, 0x0 /*image xfer ops*/);
+ &ctx->Pack, IMAGE_RED_TO_LUMINANCE);
} /* format */
} /* row */
} /* img */