On 04/13/2011 07:05 PM, Eric Anholt wrote:
It was accepting only GL_DUDV_ATI and not the specific sized format
GL_DU8DV8_ATI.  Fixes assertion failure at startup in Shadowgrounds.
---

Have these assertions in texstore stuff actually proven useful to
people?

Yes, they were very helpful to me when I initially wrote the code.


So far it seems like I'm always just adding more entries to
them because they never have enough, and any time I want to use this
pack/unpack stuff I'm just reading the code anyway since I know the
assertions don't match reality.

This particular case is unusual because the <format> parameter to glTexImage() has historically always been a generic format like GL_RGBA, GL_INTENSITY, etc. and not a sized format like GL_RGBA8 or GL_INTENSITY16. GL_ATI_envmap_bumpmap seems to be the one oddball in that it allows format=GL_DU8DV8.

I prefer to keep the assertions.


  src/mesa/main/pack.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index 0215458..4bb0a90 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -3973,7 +3973,8 @@ _mesa_unpack_dudv_span_byte( struct gl_context *ctx,
                               GLbitfield transferOps )
  {
     ASSERT(dstFormat == GL_DUDV_ATI);
-   ASSERT(srcFormat == GL_DUDV_ATI);
+   ASSERT(srcFormat == GL_DUDV_ATI ||
+         srcFormat == GL_DU8DV8_ATI);

     ASSERT(srcType == GL_UNSIGNED_BYTE ||
            srcType == GL_BYTE ||

Reviewed-by: Brian Paul <[email protected]>

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to