Mesa (master): llvmpipe: Respect pipe_sampler_view::format.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon Apr 12 06:32:48 UTC 2010


Module: Mesa
Branch: master
Commit: d67e3487ac4c678892d0aea535cacfd5f1d86a27
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d67e3487ac4c678892d0aea535cacfd5f1d86a27

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Apr 12 15:16:01 2010 +0900

llvmpipe: Respect pipe_sampler_view::format.

---

 src/gallium/auxiliary/gallivm/lp_bld_sample.c |   10 ++++++++--
 src/gallium/auxiliary/gallivm/lp_bld_sample.h |    3 ++-
 src/gallium/drivers/llvmpipe/lp_state_fs.c    |    2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
index 4004741..eb75b9b 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
@@ -51,9 +51,11 @@
  */
 void
 lp_sampler_static_state(struct lp_sampler_static_state *state,
-                        const struct pipe_resource *texture,
+                        const struct pipe_sampler_view *view,
                         const struct pipe_sampler_state *sampler)
 {
+   const struct pipe_resource *texture = view->texture;
+
    memset(state, 0, sizeof *state);
 
    if(!texture)
@@ -74,7 +76,7 @@ lp_sampler_static_state(struct lp_sampler_static_state *state,
     * regarding 1D/2D/3D/CUBE textures, wrap modes, etc.
     */
 
-   state->format            = texture->format;
+   state->format            = view->format;
    state->target            = texture->target;
    state->pot_width         = util_is_pot(texture->width0);
    state->pot_height        = util_is_pot(texture->height0);
@@ -104,6 +106,10 @@ lp_sampler_static_state(struct lp_sampler_static_state *state,
    state->border_color[1]   = sampler->border_color[1];
    state->border_color[2]   = sampler->border_color[2];
    state->border_color[3]   = sampler->border_color[3];
+
+   /*
+    * FIXME: Handle the remainder of pipe_sampler_view.
+    */
 }
 
 
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h
index 94ebe08..8c1af95 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h
@@ -39,6 +39,7 @@
 #include "gallivm/lp_bld.h"
 
 struct pipe_resource;
+struct pipe_sampler_view;
 struct pipe_sampler_state;
 struct util_format_description;
 struct lp_type;
@@ -130,7 +131,7 @@ struct lp_sampler_dynamic_state
  */
 void
 lp_sampler_static_state(struct lp_sampler_static_state *state,
-                        const struct pipe_resource *texture,
+                        const struct pipe_sampler_view *view,
                         const struct pipe_sampler_state *sampler);
 
 
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index c57b4a4..e82364d 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -1130,7 +1130,7 @@ make_variant_key(struct llvmpipe_context *lp,
 
    for(i = 0; i < PIPE_MAX_SAMPLERS; ++i)
       if(shader->info.file_mask[TGSI_FILE_SAMPLER] & (1 << i))
-         lp_sampler_static_state(&key->sampler[i], lp->fragment_sampler_views[i]->texture, lp->sampler[i]);
+         lp_sampler_static_state(&key->sampler[i], lp->fragment_sampler_views[i], lp->sampler[i]);
 }
 
 




More information about the mesa-commit mailing list