OSDN Git Service

dri/nv04: Use nvgl_wrap_mode().
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 17 Sep 2010 13:03:14 +0000 (15:03 +0200)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 21 Sep 2010 00:43:11 +0000 (02:43 +0200)
src/mesa/drivers/dri/nouveau/nv04_state_tex.c

index 4ac8327..b720089 100644 (file)
@@ -55,24 +55,6 @@ get_tex_format(struct gl_texture_image *ti)
        }
 }
 
-static inline unsigned
-get_wrap_mode(unsigned wrap)
-{
-       switch (wrap) {
-       case GL_REPEAT:
-               return 0x1;
-       case GL_MIRRORED_REPEAT:
-               return 0x2;
-       case GL_CLAMP:
-       case GL_CLAMP_TO_EDGE:
-               return 0x3;
-       case GL_CLAMP_TO_BORDER:
-               return 0x4;
-       default:
-               assert(0);
-       }
-}
-
 void
 nv04_emit_tex_obj(GLcontext *ctx, int emit)
 {
@@ -106,8 +88,8 @@ nv04_emit_tex_obj(GLcontext *ctx, int emit)
                                         t->LodBias, -16, 15) * 8;
                }
 
-               format |= get_wrap_mode(t->WrapT) << 28 |
-                       get_wrap_mode(t->WrapS) << 24 |
+               format |= nvgl_wrap_mode(t->WrapT) << 28 |
+                       nvgl_wrap_mode(t->WrapS) << 24 |
                        ti->HeightLog2 << 20 |
                        ti->WidthLog2 << 16 |
                        lod_max << 12 |