diff options
author | Roland Scheidegger <[email protected]> | 2009-03-12 15:01:16 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2009-03-12 15:01:16 +0100 |
commit | 114152e068ec919feb0a57a1259c2ada970b9f02 (patch) | |
tree | f424d1c9f88ddf36c94991906879f3a71ca1c36a /src/mesa/main/texformat.c | |
parent | b7d841b59e9087c0ba8c2726897ab1506375e4e6 (diff) |
mesa: add support for ATI_envmap_bumpmap
add new entrypoints, new texture format, etc
translate in texenvprogram.c for drivers using the mesa-generated tex env
fragment program
also handled in swrast, but not tested (cannot work due to negative texel
results not handled correctly)
Diffstat (limited to 'src/mesa/main/texformat.c')
-rw-r--r-- | src/mesa/main/texformat.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 16d05cc7d07..61a12493a6b 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -696,6 +696,33 @@ const struct gl_texture_format _mesa_texformat_intensity_float16 = { store_texel_intensity_f16 /* StoreTexel */ }; +const struct gl_texture_format _mesa_texformat_dudv8 = { + MESA_FORMAT_DUDV8, /* MesaFormat */ + GL_DUDV_ATI, /* BaseFormat */ + /* FIXME: spec doesn't say since that parameter didn't exist then, + but this should be something like SIGNED_NORMALIZED */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + /* maybe should add dudvBits field, but spec seems to be + lacking the ability to query with GetTexLevelParameter anyway */ + 0, /* RedBits */ + 0, /* GreenBits */ + 0, /* BlueBits */ + 0, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 2, /* TexelBytes */ + _mesa_texstore_dudv8, /* StoreTexImageFunc */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + NULL, /* FetchTexel1Df */ + fetch_texel_2d_dudv8, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ + NULL /* StoreTexel */ +}; /*@}*/ @@ -1634,6 +1661,16 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, } } + if (ctx->Extensions.ATI_envmap_bumpmap) { + switch (internalFormat) { + case GL_DUDV_ATI: + case GL_DU8DV8_ATI: + return &_mesa_texformat_dudv8; + default: + ; /* fallthrough */ + } + } + #if FEATURE_EXT_texture_sRGB if (ctx->Extensions.EXT_texture_sRGB) { switch (internalFormat) { @@ -1778,6 +1815,11 @@ _mesa_format_to_type_and_comps(const struct gl_texture_format *format, *comps = 1; return; + case MESA_FORMAT_DUDV8: + *datatype = GL_BYTE; + *comps = 2; + return; + #if FEATURE_EXT_texture_sRGB case MESA_FORMAT_SRGB8: *datatype = GL_UNSIGNED_BYTE; |