summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_tex_format.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-11-20 10:45:36 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-10-01 15:49:13 -0700
commitc77cd9ec10f7c6ad2927740e15900591d1ff388a (patch)
treefe9966623851f5a2698d173774691a62f6815378 /src/mesa/drivers/dri/intel/intel_tex_format.c
parent9ef390dc14edd0adc0fa0d07c64621b0f220edd8 (diff)
i965: Enable GL_ARB_texture_rg
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex_format.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_format.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c
index e03b203fb4..97b26efcb7 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_format.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_format.c
@@ -93,6 +93,10 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
case GL_LUMINANCE12_ALPHA4:
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
+ /* i915 could implement this mode using MT_32BIT_RG1616. However, this
+ * would require an extra swizzle instruction in the fragment shader to
+ * convert the { R, G, 1.0, 1.0 } to { R, R, R, G }.
+ */
#ifndef I915
return MESA_FORMAT_AL1616;
#else
@@ -193,6 +197,22 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
case GL_RGBA_SNORM:
case GL_RGBA8_SNORM:
return MESA_FORMAT_SIGNED_RGBA8888_REV;
+
+ /* i915 can do a RG16, but it can't do any of the other RED or RG formats.
+ * In addition, it only implements the broken D3D mode where undefined
+ * components are read as 1.0. I'm not sure who thought reading
+ * { R, G, 1.0, 1.0 } from a red-green texture would be useful.
+ */
+ case GL_RED:
+ case GL_R8:
+ return MESA_FORMAT_R8;
+ case GL_R16:
+ return MESA_FORMAT_R16;
+ case GL_RG:
+ case GL_RG8:
+ return MESA_FORMAT_RG88;
+ case GL_RG16:
+ return MESA_FORMAT_RG1616;
#endif
default: