[Mesa-dev] [PATCH 2/4] gallium: only use PIPE_BIND_SAMPLER_VIEW_* flags actually needed

Luca Barbieri luca at luca-barbieri.com
Tue Aug 17 00:09:11 PDT 2010


This changes the whole codebase to specify precisely which sampling
capabilities they actually need.

It also removes PIPE_BIND_SAMPLER_VIEW since all users are moved
to either more specific flags, or PIPE_BIND_SAMPLER_VIEW_ALL.

This prevents accidentally specifying PIPE_SAMPLER_VIEW incorrectly.
---
 src/gallium/auxiliary/draw/draw_pipe_aaline.c      |    2 +-
 src/gallium/auxiliary/draw/draw_pipe_pstipple.c    |    2 +-
 src/gallium/auxiliary/util/u_blit.c                |    4 ++--
 src/gallium/auxiliary/util/u_blitter.c             |    2 +-
 src/gallium/auxiliary/util/u_caps.c                |    2 +-
 src/gallium/auxiliary/util/u_debug.c               |    3 +--
 src/gallium/drivers/nouveau/nouveau_screen.c       |    2 +-
 src/gallium/drivers/nv50/nv50_screen.c             |    2 +-
 src/gallium/drivers/nvfx/nvfx_miptree.c            |    2 +-
 src/gallium/drivers/nvfx/nvfx_screen.c             |    2 +-
 src/gallium/drivers/r300/r300_blit.c               |    2 +-
 src/gallium/drivers/r300/r300_context.c            |    2 +-
 src/gallium/drivers/r300/r300_screen.c             |    4 ++--
 src/gallium/drivers/r300/r300_transfer.c           |    4 ++--
 src/gallium/drivers/r600/r600_buffer.c             |    2 +-
 src/gallium/drivers/r600/r600_screen.c             |    4 ++--
 src/gallium/drivers/svga/svga_pipe_blit.c          |    2 +-
 src/gallium/drivers/svga/svga_resource_texture.c   |    2 +-
 src/gallium/drivers/svga/svga_screen.c             |    2 +-
 src/gallium/include/pipe/p_defines.h               |    3 ---
 .../state_trackers/dri/common/dri_drawable.c       |    2 +-
 src/gallium/state_trackers/dri/drm/dri2.c          |    2 +-
 src/gallium/state_trackers/egl/gdi/native_gdi.c    |    2 +-
 src/gallium/state_trackers/egl/kms/native_kms.c    |    2 +-
 src/gallium/state_trackers/egl/x11/native_ximage.c |    2 +-
 src/gallium/state_trackers/python/st_device.c      |    2 +-
 src/gallium/state_trackers/vega/api_filters.c      |    2 +-
 src/gallium/state_trackers/vega/image.c            |    4 ++--
 src/gallium/state_trackers/vega/mask.c             |    2 +-
 src/gallium/state_trackers/vega/paint.c            |    2 +-
 src/gallium/state_trackers/vega/renderer.c         |    6 +++---
 src/gallium/state_trackers/vega/vg_manager.c       |    2 +-
 src/gallium/state_trackers/xorg/xorg_exa.c         |    6 +++---
 src/gallium/state_trackers/xorg/xorg_renderer.c    |    4 ++--
 src/gallium/state_trackers/xorg/xorg_xv.c          |    2 +-
 src/gallium/tests/graw/fs-test.c                   |    2 +-
 src/gallium/tests/graw/gs-test.c                   |    2 +-
 src/gallium/tests/graw/quad-tex.c                  |    2 +-
 src/gallium/tests/graw/vs-test.c                   |    2 +-
 src/gallium/tests/python/tests/surface_copy.py     |    5 +++--
 src/gallium/tests/python/tests/texture_blit.py     |    6 +++---
 src/gallium/tests/python/tests/texture_render.py   |    4 ++--
 src/gallium/tests/python/tests/texture_transfer.py |    2 +-
 src/gallium/winsys/radeon/drm/radeon_r300.c        |    2 +-
 src/mesa/state_tracker/st_atom_pixeltransfer.c     |    4 ++--
 src/mesa/state_tracker/st_cb_bitmap.c              |   10 +++++-----
 src/mesa/state_tracker/st_cb_drawpixels.c          |    6 +++---
 src/mesa/state_tracker/st_cb_eglimage.c            |    2 +-
 src/mesa/state_tracker/st_cb_texture.c             |   10 +++++-----
 src/mesa/state_tracker/st_extensions.c             |   14 +++++++-------
 src/mesa/state_tracker/st_format.c                 |   12 ++++++------
 src/mesa/state_tracker/st_texture.c                |    2 +-
 52 files changed, 88 insertions(+), 91 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index c0135f5..5173d33 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -407,7 +407,7 @@ aaline_create_texture(struct aaline_stage *aaline)
    texTemp.width0 = 1 << MAX_TEXTURE_LEVEL;
    texTemp.height0 = 1 << MAX_TEXTURE_LEVEL;
    texTemp.depth0 = 1;
-   texTemp.bind = PIPE_BIND_SAMPLER_VIEW;
+   texTemp.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    aaline->texture = screen->resource_create(screen, &texTemp);
    if (!aaline->texture)
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index ed9a53e..11b436e 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -440,7 +440,7 @@ pstip_create_texture(struct pstip_stage *pstip)
    texTemp.width0 = 32;
    texTemp.height0 = 32;
    texTemp.depth0 = 1;
-   texTemp.bind = PIPE_BIND_SAMPLER_VIEW;
+   texTemp.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    pstip->texture = screen->resource_create(screen, &texTemp);
    if (pstip->texture == NULL)
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c
index 97fa99e..a86806c 100644
--- a/src/gallium/auxiliary/util/u_blit.c
+++ b/src/gallium/auxiliary/util/u_blit.c
@@ -378,7 +378,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
       texTemp.width0 = srcW;
       texTemp.height0 = srcH;
       texTemp.depth0 = 1;
-      texTemp.bind = PIPE_BIND_SAMPLER_VIEW;
+      texTemp.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
       tex = screen->resource_create(screen, &texTemp);
       if (!tex)
@@ -424,7 +424,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
 
    assert(screen->is_format_supported(screen, sampler_view->format, PIPE_TEXTURE_2D,
                                       sampler_view->texture->nr_samples,
-                                      PIPE_BIND_SAMPLER_VIEW, 0));
+                                      PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0));
    assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
                                       dst->texture->nr_samples,
                                       PIPE_BIND_RENDER_TARGET, 0));
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index b5b86b7..87e4c7e 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -746,7 +746,7 @@ void util_blitter_copy_region(struct blitter_context *blitter,
        !screen->is_format_supported(screen, dst->format, dst->target,
                                     dst->nr_samples, bind, 0) ||
        !screen->is_format_supported(screen, src->format, src->target,
-                                    src->nr_samples, PIPE_BIND_SAMPLER_VIEW, 0)) {
+                                    src->nr_samples, PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0)) {
       util_resource_copy_region(pipe, dst, subdst, dstx, dsty, dstz,
                                 src, subsrc, srcx, srcy, srcz, width, height);
       return;
diff --git a/src/gallium/auxiliary/util/u_caps.c b/src/gallium/auxiliary/util/u_caps.c
index 94d5bd3..0b6b4e4 100644
--- a/src/gallium/auxiliary/util/u_caps.c
+++ b/src/gallium/auxiliary/util/u_caps.c
@@ -69,7 +69,7 @@ util_check_caps_out(struct pipe_screen *screen, const unsigned *list, int *out)
                                           list[i++],
                                           PIPE_TEXTURE_2D,
                                           0,
-                                          PIPE_BIND_SAMPLER_VIEW,
+                                          PIPE_BIND_SAMPLER_VIEW_ANY,
                                           0)) {
             *out = i - 2;
             return FALSE;
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index 504e6d2..3ebf8ec 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -508,8 +508,7 @@ void debug_dump_texture(struct pipe_context *pipe,
    screen = texture->screen;
 
    /* XXX for now, just dump image for face=0, level=0 */
-   surface = screen->get_tex_surface(screen, texture, 0, 0, 0,
-                                     PIPE_BIND_SAMPLER_VIEW);
+   surface = screen->get_tex_surface(screen, texture, 0, 0, 0, 0);
    if (surface) {
       debug_dump_surface(pipe, prefix, surface);
       screen->tex_surface_destroy(surface);
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index 513e5e0..e20c091 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -55,7 +55,7 @@ nouveau_screen_bo_new(struct pipe_screen *pscreen, unsigned alignment,
 			PIPE_BIND_DEPTH_STENCIL |
 			PIPE_BIND_SCANOUT |
 			PIPE_BIND_DISPLAY_TARGET |
-			PIPE_BIND_SAMPLER_VIEW))
+			PIPE_BIND_SAMPLER_VIEW_ANY))
 	{
 		/* TODO: this may be incorrect or suboptimal */
 		if (!(bind & PIPE_BIND_SCANOUT))
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index ca4b01b..abe2c66 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -65,7 +65,7 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
 			break;
 		}
 	} else {
-		if (tex_usage & PIPE_BIND_SAMPLER_VIEW) {
+		if (tex_usage & PIPE_BIND_SAMPLER_VIEW_ANY) {
 			switch (format) {
 			case PIPE_FORMAT_DXT1_RGB:
 			case PIPE_FORMAT_DXT1_RGBA:
diff --git a/src/gallium/drivers/nvfx/nvfx_miptree.c b/src/gallium/drivers/nvfx/nvfx_miptree.c
index b5639bb..9ee3a58 100644
--- a/src/gallium/drivers/nvfx/nvfx_miptree.c
+++ b/src/gallium/drivers/nvfx/nvfx_miptree.c
@@ -22,7 +22,7 @@ nvfx_miptree_layout(struct nvfx_miptree *mt)
 	uint width = pt->width0;
 	uint offset = 0;
 	int nr_faces, l, f;
-	uint wide_pitch = pt->bind & (PIPE_BIND_SAMPLER_VIEW |
+	uint wide_pitch = pt->bind & (PIPE_BIND_SAMPLER_VIEW_ANY |
 				      PIPE_BIND_DEPTH_STENCIL |
 				      PIPE_BIND_RENDER_TARGET |
 				      PIPE_BIND_DISPLAY_TARGET |
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c b/src/gallium/drivers/nvfx/nvfx_screen.c
index f2525cc..4a55c55 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.c
+++ b/src/gallium/drivers/nvfx/nvfx_screen.c
@@ -199,7 +199,7 @@ nvfx_screen_surface_format_supported(struct pipe_screen *pscreen,
 		}
 	} else {
 		switch (format) {
-		if (tex_usage & PIPE_BIND_SAMPLER_VIEW) {
+		if (tex_usage & PIPE_BIND_SAMPLER_VIEW_ANY) {
 			switch (format) {
 			case PIPE_FORMAT_DXT1_RGB:
 			case PIPE_FORMAT_DXT1_RGBA:
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index 47ffc0c..5e8d05f 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -364,7 +364,7 @@ static void r300_resource_copy_region(struct pipe_context *pipe,
                                            old_format, src->target,
                                            src->nr_samples,
                                            PIPE_BIND_RENDER_TARGET |
-                                           PIPE_BIND_SAMPLER_VIEW, 0) &&
+                                           PIPE_BIND_SAMPLER_VIEW_ANY, 0) &&
         util_format_is_plain(old_format)) {
         switch (util_format_get_blocksize(old_format)) {
             case 1:
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index a83ad89..1eb22a2 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -489,7 +489,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
 
         rtempl.target = PIPE_TEXTURE_2D;
         rtempl.format = PIPE_FORMAT_I8_UNORM;
-        rtempl.bind = PIPE_BIND_SAMPLER_VIEW;
+        rtempl.bind = PIPE_BIND_SAMPLER_VIEW_ANY;
         rtempl.width0 = 1;
         rtempl.height0 = 1;
         rtempl.depth0 = 1;
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 1e4edcd..d9f8fac 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -291,13 +291,13 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
     }
 
     /* Check sampler format support. */
-    if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
+    if ((usage & PIPE_BIND_SAMPLER_VIEW_ANY) &&
         /* ATI1N is r5xx-only. */
         (is_r500 || !is_ati1n) &&
         /* ATI2N is supported on r4xx-r5xx. */
         (is_r400 || is_r500 || !is_ati2n) &&
         r300_is_sampler_format_supported(format)) {
-        retval |= PIPE_BIND_SAMPLER_VIEW;
+        retval |= (usage & PIPE_BIND_SAMPLER_VIEW_ALL);
     }
 
     /* Check colorbuffer format support. */
diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c
index e9333b3..5ea2bef 100644
--- a/src/gallium/drivers/r300/r300_transfer.c
+++ b/src/gallium/drivers/r300/r300_transfer.c
@@ -110,7 +110,7 @@ r300_texture_get_transfer(struct pipe_context *ctx,
 
     blittable = ctx->screen->is_format_supported(
             ctx->screen, texture->format, texture->target, 0,
-            PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET, 0);
+            PIPE_BIND_SAMPLER_VIEW_ANY | PIPE_BIND_RENDER_TARGET, 0);
 
     trans = CALLOC_STRUCT(r300_transfer);
     if (trans) {
@@ -144,7 +144,7 @@ r300_texture_get_transfer(struct pipe_context *ctx,
             /* For texture writing, the temporary texture is used as a sampler
              * when blitting into a tiled texture. */
             if (usage & PIPE_TRANSFER_WRITE) {
-                base.bind |= PIPE_BIND_SAMPLER_VIEW;
+                base.bind |= PIPE_BIND_SAMPLER_VIEW_ANY;
             }
 
             /* Create the temporary texture. */
diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c
index 7829a47..cd6089a 100644
--- a/src/gallium/drivers/r600/r600_buffer.c
+++ b/src/gallium/drivers/r600/r600_buffer.c
@@ -46,7 +46,7 @@ u32 r600_domain_from_usage(unsigned usage)
 	if (usage & PIPE_BIND_DEPTH_STENCIL) {
 	    domain |= RADEON_GEM_DOMAIN_VRAM;
 	}
-	if (usage & PIPE_BIND_SAMPLER_VIEW) {
+	if (usage & PIPE_BIND_SAMPLER_VIEW_ANY) {
 	    domain |= RADEON_GEM_DOMAIN_VRAM;
 	}
 	/* also need BIND_BLIT_SOURCE/DESTINATION ? */
diff --git a/src/gallium/drivers/r600/r600_screen.c b/src/gallium/drivers/r600/r600_screen.c
index cdaca9e..da7e330 100644
--- a/src/gallium/drivers/r600/r600_screen.c
+++ b/src/gallium/drivers/r600/r600_screen.c
@@ -188,9 +188,9 @@ static boolean r600_is_format_supported(struct pipe_screen* screen,
 	if (sample_count > 1)
 		return FALSE;
 
-	if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
+	if ((usage & PIPE_BIND_SAMPLER_VIEW_ANY) &&
 	    r600_is_sampler_format_supported(format)) {
-		retval |= PIPE_BIND_SAMPLER_VIEW;
+            retval |= (usage & PIPE_BIND_SAMPLER_VIEW_ALL);
 	}
 
 	if ((usage & (PIPE_BIND_RENDER_TARGET |
diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c
index ca036a6..be6b16f 100644
--- a/src/gallium/drivers/svga/svga_pipe_blit.c
+++ b/src/gallium/drivers/svga/svga_pipe_blit.c
@@ -52,7 +52,7 @@ static void svga_surface_copy(struct pipe_context *pipe,
 
    srcsurf = screen->get_tex_surface(screen, src_tex,
                                      subsrc.face, subsrc.level, srcz,
-                                     PIPE_BIND_SAMPLER_VIEW);
+                                     PIPE_BIND_SAMPLER_VIEW_ANY);
 
    dstsurf = screen->get_tex_surface(screen, dst_tex,
                                      subdst.face, subdst.level, dstz,
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index ff83c75..2d2e7f6 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -518,7 +518,7 @@ svga_texture_create(struct pipe_screen *screen,
 
    tex->key.cachable = 1;
 
-   if (template->bind & PIPE_BIND_SAMPLER_VIEW)
+   if (template->bind & PIPE_BIND_SAMPLER_VIEW_ANY)
       tex->key.flags |= SVGA3D_SURFACE_HINT_TEXTURE;
 
    if (template->bind & PIPE_BIND_DISPLAY_TARGET) {
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 077ff9a..68579ac 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -344,7 +344,7 @@ svga_is_format_supported( struct pipe_screen *screen,
          mask.offscreenRenderTarget = 1;
       if (tex_usage & PIPE_BIND_DEPTH_STENCIL)
          mask.zStencil = 1;
-      if (tex_usage & PIPE_BIND_SAMPLER_VIEW)
+      if (tex_usage & PIPE_BIND_SAMPLER_VIEW_ANY)
          mask.texture = 1;
 
       if ((result.u & mask.value) == mask.value)
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 1acb54e..a298731 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -316,9 +316,6 @@ enum pipe_transfer_usage {
 		| PIPE_BIND_SAMPLER_VIEW_UNNORMALIZED_NON_CLAMP \
                 | PIPE_BIND_SAMPLER_VIEW_NORMALIZED)
 
-/* XXX: this will be removed in the next patch */
-#define PIPE_BIND_SAMPLER_VIEW PIPE_BIND_SAMPLER_VIEW_ALL
-
 #define PIPE_BIND_VERTEX_BUFFER        (1 << 6) /* set_vertex_buffers */
 #define PIPE_BIND_INDEX_BUFFER         (1 << 7) /* draw_elements */
 #define PIPE_BIND_CONSTANT_BUFFER      (1 << 8) /* set_constant_buffer */
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c b/src/gallium/state_trackers/dri/common/dri_drawable.c
index 1bdfdcc..2fe561f 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.c
@@ -250,7 +250,7 @@ dri_drawable_get_format(struct dri_drawable *drawable,
    case ST_ATTACHMENT_FRONT_RIGHT:
    case ST_ATTACHMENT_BACK_RIGHT:
       *format = drawable->stvis.color_format;
-      *bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
+      *bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW_ANY;
       break;
    case ST_ATTACHMENT_DEPTH_STENCIL:
       *format = drawable->stvis.depth_stencil_format;
diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index 47005c1..63914bf 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -316,7 +316,7 @@ dri2_create_image_from_name(__DRIcontext *context,
    unsigned tex_usage;
    enum pipe_format pf;
 
-   tex_usage = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
+   tex_usage = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW_ANY;
 
    switch (format) {
    case __DRI_IMAGE_FORMAT_RGB565:
diff --git a/src/gallium/state_trackers/egl/gdi/native_gdi.c b/src/gallium/state_trackers/egl/gdi/native_gdi.c
index 91701e5..a6ff495 100644
--- a/src/gallium/state_trackers/egl/gdi/native_gdi.c
+++ b/src/gallium/state_trackers/egl/gdi/native_gdi.c
@@ -219,7 +219,7 @@ gdi_display_create_window_surface(struct native_display *ndpy,
    gsurf->rsurf = resource_surface_create(gdpy->base.screen,
          gsurf->color_format,
          PIPE_BIND_RENDER_TARGET |
-         PIPE_BIND_SAMPLER_VIEW |
+         PIPE_BIND_SAMPLER_VIEW_ANY |
          PIPE_BIND_DISPLAY_TARGET |
          PIPE_BIND_SCANOUT);
    if (!gsurf->rsurf) {
diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c
index d4e8fbc..a583489 100644
--- a/src/gallium/state_trackers/egl/kms/native_kms.c
+++ b/src/gallium/state_trackers/egl/kms/native_kms.c
@@ -220,7 +220,7 @@ kms_display_create_surface(struct native_display *ndpy,
    ksurf->rsurf = resource_surface_create(kdpy->base.screen,
          ksurf->color_format,
          PIPE_BIND_RENDER_TARGET |
-         PIPE_BIND_SAMPLER_VIEW |
+         PIPE_BIND_SAMPLER_VIEW_ANY |
          PIPE_BIND_DISPLAY_TARGET |
          PIPE_BIND_SCANOUT);
    if (!ksurf->rsurf) {
diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c
index 4b32f6e..40a5527 100644
--- a/src/gallium/state_trackers/egl/x11/native_ximage.c
+++ b/src/gallium/state_trackers/egl/x11/native_ximage.c
@@ -239,7 +239,7 @@ ximage_display_create_surface(struct native_display *ndpy,
    xsurf->rsurf = resource_surface_create(xdpy->base.screen,
          xsurf->color_format,
          PIPE_BIND_RENDER_TARGET |
-         PIPE_BIND_SAMPLER_VIEW |
+         PIPE_BIND_SAMPLER_VIEW_ANY |
          PIPE_BIND_DISPLAY_TARGET |
          PIPE_BIND_SCANOUT);
    if (!xsurf->rsurf) {
diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c
index dce24bc..de7255b 100644
--- a/src/gallium/state_trackers/python/st_device.c
+++ b/src/gallium/state_trackers/python/st_device.c
@@ -242,7 +242,7 @@ st_context_create(struct st_device *st_dev)
       templat.height0 = 1;
       templat.depth0 = 1;
       templat.last_level = 0;
-      templat.bind = PIPE_BIND_SAMPLER_VIEW;
+      templat.bind = PIPE_BIND_SAMPLER_VIEW_ANY;
    
       st_ctx->default_texture = screen->resource_create( screen, &templat );
       if(st_ctx->default_texture) {
diff --git a/src/gallium/state_trackers/vega/api_filters.c b/src/gallium/state_trackers/vega/api_filters.c
index 8ace985..cafb452 100644
--- a/src/gallium/state_trackers/vega/api_filters.c
+++ b/src/gallium/state_trackers/vega/api_filters.c
@@ -75,7 +75,7 @@ static INLINE struct pipe_resource *create_texture_1d(struct vg_context *ctx,
    templ.width0 = color_data_len;
    templ.height0 = 1;
    templ.depth0 = 1;
-   templ.bind = PIPE_BIND_SAMPLER_VIEW;
+   templ.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    tex = screen->resource_create(screen, &templ);
 
diff --git a/src/gallium/state_trackers/vega/image.c b/src/gallium/state_trackers/vega/image.c
index c12dc71..7e8ff21 100644
--- a/src/gallium/state_trackers/vega/image.c
+++ b/src/gallium/state_trackers/vega/image.c
@@ -270,7 +270,7 @@ struct vg_image * image_create(VGImageFormat format,
    image->sampler.normalized_coords = 1;
 
    assert(screen->is_format_supported(screen, pformat, PIPE_TEXTURE_2D,
-                                      0, PIPE_BIND_SAMPLER_VIEW, 0));
+                                      0, PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0));
 
    memset(&pt, 0, sizeof(pt));
    pt.target = PIPE_TEXTURE_2D;
@@ -279,7 +279,7 @@ struct vg_image * image_create(VGImageFormat format,
    pt.width0 = width;
    pt.height0 = height;
    pt.depth0 = 1;
-   pt.bind = PIPE_BIND_SAMPLER_VIEW;
+   pt.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    newtex = screen->resource_create(screen, &pt);
 
diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c
index ef28ebd..e2efb69 100644
--- a/src/gallium/state_trackers/vega/mask.c
+++ b/src/gallium/state_trackers/vega/mask.c
@@ -496,7 +496,7 @@ struct vg_mask_layer * mask_layer_create(VGint width, VGint height)
       pt.width0 = width;
       pt.height0 = height;
       pt.depth0 = 1;
-      pt.bind = PIPE_BIND_SAMPLER_VIEW;
+      pt.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
       pt.compressed = 0;
 
       texture = screen->resource_create(screen, &pt);
diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c
index 2c0eb6b..54bfa07 100644
--- a/src/gallium/state_trackers/vega/paint.c
+++ b/src/gallium/state_trackers/vega/paint.c
@@ -157,7 +157,7 @@ static INLINE struct pipe_resource *create_gradient_texture(struct vg_paint *p)
    templ.width0 = 1024;
    templ.height0 = 1;
    templ.depth0 = 1;
-   templ.bind = PIPE_BIND_SAMPLER_VIEW;
+   templ.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    tex = screen->resource_create(screen, &templ);
 
diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c
index 8c02304..0aef140 100644
--- a/src/gallium/state_trackers/vega/renderer.c
+++ b/src/gallium/state_trackers/vega/renderer.c
@@ -442,9 +442,9 @@ void renderer_copy_surface(struct renderer *ctx,
    }
 
    assert(screen->is_format_supported(screen, src->format, PIPE_TEXTURE_2D,
-                                      0, PIPE_BIND_SAMPLER_VIEW, 0));
+                                      0, PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0));
    assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
-                                      0, PIPE_BIND_SAMPLER_VIEW, 0));
+                                      0, PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0));
    assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
                                       0, PIPE_BIND_RENDER_TARGET, 0));
 
@@ -461,7 +461,7 @@ void renderer_copy_surface(struct renderer *ctx,
    texTemp.width0 = srcW;
    texTemp.height0 = srcH;
    texTemp.depth0 = 1;
-   texTemp.bind = PIPE_BIND_SAMPLER_VIEW;
+   texTemp.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    tex = screen->resource_create(screen, &texTemp);
    if (!tex)
diff --git a/src/gallium/state_trackers/vega/vg_manager.c b/src/gallium/state_trackers/vega/vg_manager.c
index c2aa98b..2a0c997 100644
--- a/src/gallium/state_trackers/vega/vg_manager.c
+++ b/src/gallium/state_trackers/vega/vg_manager.c
@@ -69,7 +69,7 @@ create_texture(struct pipe_context *pipe, enum pipe_format format,
    } else {
       templ.bind = (PIPE_BIND_DISPLAY_TARGET |
                     PIPE_BIND_RENDER_TARGET |
-                    PIPE_BIND_SAMPLER_VIEW);
+                    PIPE_BIND_SAMPLER_VIEW_NORMALIZED);
    }
 
    return pipe->screen->resource_create(pipe->screen, &templ);
diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c
index 6b2c80f..864a571 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa.c
+++ b/src/gallium/state_trackers/xorg/xorg_exa.c
@@ -433,7 +433,7 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
 
     if (!exa->scrn->is_format_supported(exa->scrn, src_priv->tex->format,
                                         src_priv->tex->target, 0,
-                                        PIPE_BIND_SAMPLER_VIEW, 0))
+                                        PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0))
 	XORG_FALLBACK("pSrc format %s", util_format_name(src_priv->tex->format));
 
     exa->copy.src = src_priv;
@@ -645,7 +645,7 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
 
       if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
                                           priv->tex->target, 0,
-                                          PIPE_BIND_SAMPLER_VIEW, 0))
+                                          PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0))
          XORG_FALLBACK("pSrc format: %s", util_format_name(priv->tex->format));
 
       if (!picture_check_formats(priv, pSrcPicture))
@@ -662,7 +662,7 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
 
       if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
                                           priv->tex->target, 0,
-                                          PIPE_BIND_SAMPLER_VIEW, 0))
+                                          PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0))
          XORG_FALLBACK("pMask format: %s", util_format_name(priv->tex->format));
 
       if (!picture_check_formats(priv, pMaskPicture))
diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c
index 92f1cc5..8d97508 100644
--- a/src/gallium/state_trackers/xorg/xorg_renderer.c
+++ b/src/gallium/state_trackers/xorg/xorg_renderer.c
@@ -524,7 +524,7 @@ renderer_clone_texture(struct xorg_renderer *r,
    /* the coming in texture should already have that invariance */
    debug_assert(screen->is_format_supported(screen, src->format,
                                             PIPE_TEXTURE_2D, 0,
-                                            PIPE_BIND_SAMPLER_VIEW, 0));
+                                            PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0));
 
    format = src->format;
 
@@ -535,7 +535,7 @@ renderer_clone_texture(struct xorg_renderer *r,
    templ.width0 = src->width0;
    templ.height0 = src->height0;
    templ.depth0 = 1;
-   templ.bind = PIPE_BIND_SAMPLER_VIEW;
+   templ.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    pt = screen->resource_create(screen, &templ);
 
diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c
index f98bd93..f30ea96 100644
--- a/src/gallium/state_trackers/xorg/xorg_xv.c
+++ b/src/gallium/state_trackers/xorg/xorg_xv.c
@@ -171,7 +171,7 @@ create_component_texture(struct pipe_context *pipe,
    templ.width0 = width;
    templ.height0 = height;
    templ.depth0 = 1;
-   templ.bind = PIPE_BIND_SAMPLER_VIEW;
+   templ.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    tex = screen->resource_create(screen, &templ);
 
diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c
index 53fbb74..c6cc154 100644
--- a/src/gallium/tests/graw/fs-test.c
+++ b/src/gallium/tests/graw/fs-test.c
@@ -353,7 +353,7 @@ static void init_tex( void )
    templat.depth0 = 1;
    templat.last_level = 0;
    templat.nr_samples = 1;
-   templat.bind = PIPE_BIND_SAMPLER_VIEW;
+   templat.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    
    samptex = screen->resource_create(screen,
diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c
index 6271490..8b7f386 100644
--- a/src/gallium/tests/graw/gs-test.c
+++ b/src/gallium/tests/graw/gs-test.c
@@ -417,7 +417,7 @@ static void init_tex( void )
    templat.depth0 = 1;
    templat.last_level = 0;
    templat.nr_samples = 1;
-   templat.bind = PIPE_BIND_SAMPLER_VIEW;
+   templat.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    
    samptex = screen->resource_create(screen,
diff --git a/src/gallium/tests/graw/quad-tex.c b/src/gallium/tests/graw/quad-tex.c
index c50ef12..05f8249 100644
--- a/src/gallium/tests/graw/quad-tex.c
+++ b/src/gallium/tests/graw/quad-tex.c
@@ -224,7 +224,7 @@ static void init_tex( void )
    templat.depth0 = 1;
    templat.last_level = 0;
    templat.nr_samples = 1;
-   templat.bind = PIPE_BIND_SAMPLER_VIEW;
+   templat.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    
    samptex = screen->resource_create(screen,
diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c
index e1cd814..fe6314f 100644
--- a/src/gallium/tests/graw/vs-test.c
+++ b/src/gallium/tests/graw/vs-test.c
@@ -304,7 +304,7 @@ static void init_tex( void )
    templat.depth0 = 1;
    templat.last_level = 0;
    templat.nr_samples = 1;
-   templat.bind = PIPE_BIND_SAMPLER_VIEW;
+   templat.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
 
    
    samptex = screen->resource_create(screen,
diff --git a/src/gallium/tests/python/tests/surface_copy.py b/src/gallium/tests/python/tests/surface_copy.py
index 7a6ede3..e564f8f 100755
--- a/src/gallium/tests/python/tests/surface_copy.py
+++ b/src/gallium/tests/python/tests/surface_copy.py
@@ -71,7 +71,8 @@ class TextureTest(TestCase):
         level = self.level
         zslice = self.zslice
 
-        bind = PIPE_BIND_SAMPLER_VIEW
+		# XXX: we aren't creating sampler views...
+        bind = PIPE_BIND_SAMPLER_VIEW_ANY
         geom_flags = 0
         sample_count = 0
         if not dev.is_format_supported(format, target, sample_count, bind, geom_flags):
@@ -100,7 +101,7 @@ class TextureTest(TestCase):
             height = dst_surface.height,
             depth = 1, 
             last_level = 0,
-            bind = PIPE_BIND_SAMPLER_VIEW,
+            bind = bind,
         )
 
         src_surface = src_texture.get_surface()
diff --git a/src/gallium/tests/python/tests/texture_blit.py b/src/gallium/tests/python/tests/texture_blit.py
index 58706da..41c7d5b 100755
--- a/src/gallium/tests/python/tests/texture_blit.py
+++ b/src/gallium/tests/python/tests/texture_blit.py
@@ -131,7 +131,7 @@ class TextureColorSampleTest(TestCase):
         minz = 0.0
         maxz = 1.0
 
-        bind = PIPE_BIND_SAMPLER_VIEW
+        bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED
         geom_flags = 0
         sample_count = 0
         if width != height:
@@ -182,7 +182,7 @@ class TextureColorSampleTest(TestCase):
             height = height,
             depth = depth, 
             last_level = last_level,
-            bind = bind,
+            bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED,
         )
         
         expected_rgba = FloatArray(height*width*4) 
@@ -350,7 +350,7 @@ class TextureDepthSampleTest(TestCase):
         minz = 0.0
         maxz = 1.0
 
-        bind = PIPE_BIND_SAMPLER_VIEW
+        bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED
         geom_flags = 0
         sample_count = 0
         if width != height:
diff --git a/src/gallium/tests/python/tests/texture_render.py b/src/gallium/tests/python/tests/texture_render.py
index 23f3d2a..d9a8539 100755
--- a/src/gallium/tests/python/tests/texture_render.py
+++ b/src/gallium/tests/python/tests/texture_render.py
@@ -89,7 +89,7 @@ class TextureTest(TestCase):
             height = dst_surface.height,
             depth = 1, 
             last_level = 0,
-            bind = PIPE_BIND_SAMPLER_VIEW,
+            bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED,
         )
 
         ref_surface = ref_texture.get_surface()
@@ -101,7 +101,7 @@ class TextureTest(TestCase):
             height = dst_surface.height,
             depth = 1, 
             last_level = 0,
-            bind = PIPE_BIND_SAMPLER_VIEW,
+            bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED,
         )
 
         src_surface = src_texture.get_surface()
diff --git a/src/gallium/tests/python/tests/texture_transfer.py b/src/gallium/tests/python/tests/texture_transfer.py
index 65c919b..d2dfc96 100755
--- a/src/gallium/tests/python/tests/texture_transfer.py
+++ b/src/gallium/tests/python/tests/texture_transfer.py
@@ -72,7 +72,7 @@ class TextureTest(TestCase):
         level = self.level
         zslice = self.zslice
 
-        bind = PIPE_BIND_SAMPLER_VIEW
+        bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED
         geom_flags = 0
         sample_count = 0
         if not dev.is_format_supported(format, target, sample_count, bind, geom_flags):
diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c
index 5840098..ca6ecb6 100644
--- a/src/gallium/winsys/radeon/drm/radeon_r300.c
+++ b/src/gallium/winsys/radeon/drm/radeon_r300.c
@@ -38,7 +38,7 @@ static unsigned get_pb_usage_from_create_flags(unsigned bind, unsigned usage,
                 PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT))
         res |= PB_USAGE_GPU_WRITE;
 
-    if (bind & PIPE_BIND_SAMPLER_VIEW)
+    if (bind & PIPE_BIND_SAMPLER_VIEW_ANY)
         res |= PB_USAGE_GPU_READ | PB_USAGE_GPU_WRITE;
 
     if (bind & (PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER))
diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c
index 8a8d175..345001f 100644
--- a/src/mesa/state_tracker/st_atom_pixeltransfer.c
+++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c
@@ -124,11 +124,11 @@ create_color_map_texture(GLcontext *ctx)
 
    /* find an RGBA texture format */
    format = st_choose_format(pipe->screen, GL_RGBA,
-                             PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW);
+                             PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW_NORMALIZED);
 
    /* create texture for color map/table */
    pt = st_texture_create(st, PIPE_TEXTURE_2D, format, 0,
-                          texSize, texSize, 1, PIPE_BIND_SAMPLER_VIEW);
+                          texSize, texSize, 1, PIPE_BIND_SAMPLER_VIEW_NORMALIZED);
    return pt;
 }
 
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index 0b8ecd2..3974640 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -277,7 +277,7 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
     */
    pt = st_texture_create(st, PIPE_TEXTURE_2D, st->bitmap.tex_format,
                           0, width, height, 1,
-                          PIPE_BIND_SAMPLER_VIEW);
+                          PIPE_BIND_SAMPLER_VIEW_NORMALIZED);
    if (!pt) {
       _mesa_unmap_pbo_source(ctx, unpack);
       return NULL;
@@ -544,7 +544,7 @@ reset_cache(struct st_context *st)
                                       st->bitmap.tex_format, 0,
                                       BITMAP_CACHE_WIDTH, BITMAP_CACHE_HEIGHT,
                                       1,
-				      PIPE_BIND_SAMPLER_VIEW);
+				      PIPE_BIND_SAMPLER_VIEW_NORMALIZED);
 }
 
 
@@ -809,15 +809,15 @@ st_init_bitmap(struct st_context *st)
 
    /* find a usable texture format */
    if (screen->is_format_supported(screen, PIPE_FORMAT_I8_UNORM, PIPE_TEXTURE_2D, 0,
-                                   PIPE_BIND_SAMPLER_VIEW, 0)) {
+                                   PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0)) {
       st->bitmap.tex_format = PIPE_FORMAT_I8_UNORM;
    }
    else if (screen->is_format_supported(screen, PIPE_FORMAT_A8_UNORM, PIPE_TEXTURE_2D, 0,
-                                        PIPE_BIND_SAMPLER_VIEW, 0)) {
+                                        PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0)) {
       st->bitmap.tex_format = PIPE_FORMAT_A8_UNORM;
    }
    else if (screen->is_format_supported(screen, PIPE_FORMAT_L8_UNORM, PIPE_TEXTURE_2D, 0,
-                                        PIPE_BIND_SAMPLER_VIEW, 0)) {
+                                        PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0)) {
       st->bitmap.tex_format = PIPE_FORMAT_L8_UNORM;
    }
    else {
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 69a3dd4..350cba1 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -331,7 +331,7 @@ alloc_texture(struct st_context *st, GLsizei width, GLsizei height,
    }
 
    pt = st_texture_create(st, PIPE_TEXTURE_2D, texFormat, 0,
-                          ptw, pth, 1, PIPE_BIND_SAMPLER_VIEW);
+                          ptw, pth, 1, PIPE_BIND_SAMPLER_VIEW_NORMALIZED);
 
    return pt;
 }
@@ -1003,7 +1003,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
    srcFormat = rbRead->texture->format;
 
    if (screen->is_format_supported(screen, srcFormat, PIPE_TEXTURE_2D, sample_count,
-                                   PIPE_BIND_SAMPLER_VIEW, 0)) {
+                                   PIPE_BIND_SAMPLER_VIEW_NORMALIZED, 0)) {
       texFormat = srcFormat;
    }
    else {
@@ -1017,7 +1017,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
       else {
          /* default color format */
          texFormat = st_choose_format(screen, GL_RGBA, PIPE_TEXTURE_2D, 
-                                      sample_count, PIPE_BIND_SAMPLER_VIEW);
+                                      sample_count, PIPE_BIND_SAMPLER_VIEW_NORMALIZED);
          assert(texFormat != PIPE_FORMAT_NONE);
       }
    }
diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c
index 037e576..3af5b1d 100644
--- a/src/mesa/state_tracker/st_cb_eglimage.c
+++ b/src/mesa/state_tracker/st_cb_eglimage.c
@@ -147,7 +147,7 @@ st_egl_image_target_texture_2d(GLcontext *ctx, GLenum target,
    struct pipe_surface *ps;
    unsigned usage;
 
-   usage = PIPE_BIND_SAMPLER_VIEW;
+   usage = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
    ps = st_manager_get_egl_image_surface(st, (void *) image_handle, usage);
    if (ps) {
       st_bind_surface(ctx, target, texObj, texImage, ps);
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 4c3e368..bc0af17 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -217,14 +217,14 @@ default_bindings(struct st_context *st, enum pipe_format format)
    unsigned bindings;
 
    if (util_format_is_depth_or_stencil(format))
-      bindings = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_DEPTH_STENCIL;
+      bindings = PIPE_BIND_SAMPLER_VIEW_ALL | PIPE_BIND_DEPTH_STENCIL;
    else
-      bindings = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
+      bindings = PIPE_BIND_SAMPLER_VIEW_ALL | PIPE_BIND_RENDER_TARGET;
 
    if (screen->is_format_supported(screen, format, target, 0, bindings, geom))
       return bindings;
    else
-      return PIPE_BIND_SAMPLER_VIEW;
+      return PIPE_BIND_SAMPLER_VIEW_ALL;
 }
 
 
@@ -456,7 +456,7 @@ compress_with_blit(GLcontext * ctx,
    templ.depth0 = 1;
    templ.last_level = 0;
    templ.usage = PIPE_USAGE_DEFAULT;
-   templ.bind = PIPE_BIND_SAMPLER_VIEW;
+   templ.bind = PIPE_BIND_SAMPLER_VIEW_NORMALIZED;
    src_tex = screen->resource_create(screen, &templ);
 
    if (!src_tex)
@@ -1602,7 +1602,7 @@ st_copy_texsubimage(GLcontext *ctx,
                texBaseFormat != GL_DEPTH_STENCIL &&
                screen->is_format_supported(screen, src_format,
                                            PIPE_TEXTURE_2D, sample_count,
-                                           PIPE_BIND_SAMPLER_VIEW,
+                                           PIPE_BIND_SAMPLER_VIEW_NORMALIZED,
                                            0) &&
                screen->is_format_supported(screen, dest_format,
                                            PIPE_TEXTURE_2D, 0,
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 90e7867..4384bf5 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -323,7 +323,7 @@ void st_init_extensions(struct st_context *st)
                                    PIPE_BIND_DEPTH_STENCIL, 0) &&
        screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM,
                                    PIPE_TEXTURE_2D, 0,
-                                   PIPE_BIND_SAMPLER_VIEW, 0)) {
+                                   PIPE_BIND_SAMPLER_VIEW_ANY, 0)) {
       ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
    }
    else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED,
@@ -331,24 +331,24 @@ void st_init_extensions(struct st_context *st)
                                         PIPE_BIND_DEPTH_STENCIL, 0) &&
             screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED,
                                         PIPE_TEXTURE_2D, 0,
-                                        PIPE_BIND_SAMPLER_VIEW, 0)) {
+                                        PIPE_BIND_SAMPLER_VIEW_ANY, 0)) {
       ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
    }
 
    /* sRGB support */
    if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB,
                                    PIPE_TEXTURE_2D, 0,
-                                   PIPE_BIND_SAMPLER_VIEW, 0) ||
+                                   PIPE_BIND_SAMPLER_VIEW_ANY, 0) ||
       screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB,
                                    PIPE_TEXTURE_2D, 0,
-                                   PIPE_BIND_SAMPLER_VIEW, 0)) {
+                                   PIPE_BIND_SAMPLER_VIEW_ANY, 0)) {
       ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
    }
 
    /* s3tc support */
    if (screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA,
                                    PIPE_TEXTURE_2D, 0,
-                                   PIPE_BIND_SAMPLER_VIEW, 0) &&
+                                   PIPE_BIND_SAMPLER_VIEW_ANY, 0) &&
        (ctx->Mesa_DXTn ||
         screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA,
                                     PIPE_TEXTURE_2D, 0,
@@ -360,10 +360,10 @@ void st_init_extensions(struct st_context *st)
    /* ycbcr support */
    if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY, 
                                    PIPE_TEXTURE_2D, 0,
-                                   PIPE_BIND_SAMPLER_VIEW, 0) ||
+                                   PIPE_BIND_SAMPLER_VIEW_ANY, 0) ||
        screen->is_format_supported(screen, PIPE_FORMAT_YUYV, 
                                    PIPE_TEXTURE_2D, 0,
-                                   PIPE_BIND_SAMPLER_VIEW, 0)) {
+                                   PIPE_BIND_SAMPLER_VIEW_ANY, 0)) {
       ctx->Extensions.MESA_ycbcr_texture = GL_TRUE;
    }
 
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index c9fa7a6..e2ba006 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -395,7 +395,7 @@ default_srgba_format(struct pipe_screen *screen,
  * the best matching PIPE_FORMAT_x, or PIPE_FORMAT_NONE if there's no match.
  * This is called during glTexImage2D, for example.
  *
- * The bindings parameter typically has PIPE_BIND_SAMPLER_VIEW set, plus
+ * The bindings parameter typically has PIPE_BIND_SAMPLER_VIEW_* set, plus
  * either PIPE_BINDING_RENDER_TARGET or PIPE_BINDING_DEPTH_STENCIL if
  * we want render-to-texture ability.
  *
@@ -529,7 +529,7 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
 
    case GL_COMPRESSED_RGB:
       /* can only sample from compressed formats */
-      if (bindings & ~PIPE_BIND_SAMPLER_VIEW)
+      if (bindings & ~PIPE_BIND_SAMPLER_VIEW_ALL)
          return PIPE_FORMAT_NONE;
       else if (screen->is_format_supported(screen, PIPE_FORMAT_DXT1_RGB,
                                            target, sample_count, bindings,
@@ -541,7 +541,7 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
 
    case GL_COMPRESSED_RGBA:
       /* can only sample from compressed formats */
-      if (bindings & ~PIPE_BIND_SAMPLER_VIEW)
+      if (bindings & ~PIPE_BIND_SAMPLER_VIEW_ALL)
          return PIPE_FORMAT_NONE;
       else if (screen->is_format_supported(screen, PIPE_FORMAT_DXT3_RGBA,
                                            target, sample_count, bindings,
@@ -727,9 +727,9 @@ st_ChooseTextureFormat(GLcontext *ctx, GLint internalFormat,
     */
    if (_mesa_is_depth_format(internalFormat) ||
        _mesa_is_depthstencil_format(internalFormat))
-      bindings = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_DEPTH_STENCIL;
+      bindings = PIPE_BIND_SAMPLER_VIEW_ALL | PIPE_BIND_DEPTH_STENCIL;
    else 
-      bindings = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
+      bindings = PIPE_BIND_SAMPLER_VIEW_ALL | PIPE_BIND_RENDER_TARGET;
 
    pFormat = st_choose_format(screen, internalFormat,
                               PIPE_TEXTURE_2D, 0, bindings);
@@ -737,7 +737,7 @@ st_ChooseTextureFormat(GLcontext *ctx, GLint internalFormat,
    if (pFormat == PIPE_FORMAT_NONE) {
       /* try choosing format again, this time without render target bindings */
       pFormat = st_choose_format(screen, internalFormat,
-                                 PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW);
+                                 PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW_ALL);
    }
 
    if (pFormat == PIPE_FORMAT_NONE) {
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index add6e94..6053f7e 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -75,7 +75,7 @@ st_texture_create(struct st_context *st,
 
    assert(format);
    assert(screen->is_format_supported(screen, format, target, 0,
-                                      PIPE_BIND_SAMPLER_VIEW, 0));
+                                      bind, 0));
 
    memset(&pt, 0, sizeof(pt));
    pt.target = target;
-- 
1.7.0.4



More information about the mesa-dev mailing list