Mesa (master): pipe_sampler_state:: compare_mode is not a boolean enable flag.

Michał Król michal at kemper.freedesktop.org
Wed Jan 6 15:11:41 UTC 2010


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

Author: Michal Krol <michal at vmware.com>
Date:   Wed Jan  6 14:12:10 2010 +0100

pipe_sampler_state::compare_mode is not a boolean enable flag.

It's a 1-bit enum.

---

 src/gallium/drivers/llvmpipe/lp_bld_sample.c     |    4 ++--
 src/gallium/drivers/llvmpipe/lp_bld_sample_soa.c |    2 +-
 src/gallium/drivers/llvmpipe/lp_state_fs.c       |    4 ++--
 src/gallium/drivers/llvmpipe/lp_tex_sample_c.c   |    4 ++--
 src/gallium/drivers/softpipe/sp_tex_sample.c     |    2 +-
 src/gallium/drivers/trace/tr_dump_state.c        |    2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_bld_sample.c b/src/gallium/drivers/llvmpipe/lp_bld_sample.c
index af70ddc..9003e10 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_sample.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_sample.c
@@ -69,8 +69,8 @@ lp_sampler_static_state(struct lp_sampler_static_state *state,
    state->min_img_filter    = sampler->min_img_filter;
    state->min_mip_filter    = sampler->min_mip_filter;
    state->mag_img_filter    = sampler->mag_img_filter;
-   if(sampler->compare_mode) {
-      state->compare_mode      = sampler->compare_mode;
+   state->compare_mode      = sampler->compare_mode;
+   if(sampler->compare_mode != PIPE_TEX_COMPARE_NONE) {
       state->compare_func      = sampler->compare_func;
    }
    state->normalized_coords = sampler->normalized_coords;
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_sample_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_sample_soa.c
index c46fef5..5ee8d55 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_sample_soa.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_sample_soa.c
@@ -488,7 +488,7 @@ lp_build_sample_compare(struct lp_build_sample_context *bld,
    LLVMValueRef res;
    unsigned chan;
 
-   if(!bld->static_state->compare_mode)
+   if(bld->static_state->compare_mode == PIPE_TEX_COMPARE_NONE)
       return;
 
    /* TODO: Compare before swizzling, to avoid redundant computations */
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index f2b8c36..47078fb 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -453,8 +453,8 @@ generate_fragment(struct llvmpipe_context *lp,
                          debug_dump_tex_mipfilter(key->sampler[i].min_mip_filter, TRUE));
             debug_printf("  .mag_img_filter = %s\n",
                          debug_dump_tex_filter(key->sampler[i].mag_img_filter, TRUE));
-            if(key->sampler[i].compare_mode)
-               debug_printf("  .compare_mode = %s\n", debug_dump_func(key->sampler[i].compare_func, TRUE));
+            if(key->sampler[i].compare_mode != PIPE_TEX_COMPARE_NONE)
+               debug_printf("  .compare_func = %s\n", debug_dump_func(key->sampler[i].compare_func, TRUE));
             debug_printf("  .normalized_coords = %u\n", key->sampler[i].normalized_coords);
             debug_printf("  .prefilter = %u\n", key->sampler[i].prefilter);
          }
diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample_c.c b/src/gallium/drivers/llvmpipe/lp_tex_sample_c.c
index eaff6d5..ccc8c8c 100644
--- a/src/gallium/drivers/llvmpipe/lp_tex_sample_c.c
+++ b/src/gallium/drivers/llvmpipe/lp_tex_sample_c.c
@@ -1520,7 +1520,7 @@ lp_get_samples(struct tgsi_sampler *tgsi_sampler,
    if (texture->target == PIPE_TEXTURE_2D &&
        sampler->min_img_filter == sampler->mag_img_filter &&
        sampler->wrap_s == sampler->wrap_t &&
-       sampler->compare_mode == FALSE &&
+       sampler->compare_mode == PIPE_TEX_COMPARE_NONE &&
        sampler->normalized_coords) 
    {
       if (sampler->min_mip_filter == PIPE_TEX_MIPFILTER_NONE) {
@@ -1567,7 +1567,7 @@ lp_get_samples(struct tgsi_sampler *tgsi_sampler,
                     sampler->min_mip_filter, PIPE_TEX_MIPFILTER_NONE,
                     sampler->min_img_filter, sampler->mag_img_filter,
                     sampler->wrap_s, sampler->wrap_t,
-                    sampler->compare_mode, FALSE,
+                    sampler->compare_mode, PIPE_TEX_COMPARE_NONE,
                     sampler->normalized_coords, TRUE);
    }
 
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index e26153b..903d21a 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -1862,7 +1862,7 @@ sp_create_sampler_varient( const struct pipe_sampler_state *sampler,
       break;
    }
 
-   if (sampler->compare_mode != FALSE) {
+   if (sampler->compare_mode != PIPE_TEX_COMPARE_NONE) {
       samp->compare = sample_compare;
    }
    else {
diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c
index 0102cc1..86237e0 100644
--- a/src/gallium/drivers/trace/tr_dump_state.c
+++ b/src/gallium/drivers/trace/tr_dump_state.c
@@ -409,7 +409,7 @@ void trace_dump_sampler_state(const struct pipe_sampler_state *state)
    trace_dump_member(uint, state, min_img_filter);
    trace_dump_member(uint, state, min_mip_filter);
    trace_dump_member(uint, state, mag_img_filter);
-   trace_dump_member(bool, state, compare_mode);
+   trace_dump_member(uint, state, compare_mode);
    trace_dump_member(uint, state, compare_func);
    trace_dump_member(bool, state, normalized_coords);
    trace_dump_member(uint, state, prefilter);




More information about the mesa-commit mailing list