Mesa (master): ARB_texture_rg: Add GL_RED as a valid GL_DEPTH_TEXTURE_MODE
Ian Romanick
idr at kemper.freedesktop.org
Fri Oct 1 22:56:18 UTC 2010
Module: Mesa
Branch: master
Commit: cd5dea640144b45ba2e88c2451f1f01ee08c1c4a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd5dea640144b45ba2e88c2451f1f01ee08c1c4a
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Tue Sep 28 13:50:34 2010 -0700
ARB_texture_rg: Add GL_RED as a valid GL_DEPTH_TEXTURE_MODE
---
src/mesa/main/texparam.c | 3 ++-
src/mesa/swrast/s_texfilter.c | 3 +++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 58d7858..e96ace7 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -351,7 +351,8 @@ set_tex_parameteri(GLcontext *ctx,
if (ctx->Extensions.ARB_depth_texture &&
(params[0] == GL_LUMINANCE ||
params[0] == GL_INTENSITY ||
- params[0] == GL_ALPHA)) {
+ params[0] == GL_ALPHA ||
+ (ctx->Extensions.ARB_texture_rg && params[0] == GL_RED))) {
if (texObj->DepthMode != params[0]) {
flush(ctx, texObj);
texObj->DepthMode = params[0];
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index 1aa2bca..de694c3 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -3051,6 +3051,9 @@ sample_depth_texture( GLcontext *ctx,
case GL_ALPHA:
ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result);
break;
+ case GL_RED:
+ ASSIGN_4V(texel[i], result, 0.0F, 0.0F, 1.0F);
+ break;
default:
_mesa_problem(ctx, "Bad depth texture mode");
}
More information about the mesa-commit
mailing list