Mesa (master): panfrost: Add the lod_bias field

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 21 06:23:19 UTC 2019


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Wed Nov 20 09:26:48 2019 -0500

panfrost: Add the lod_bias field

Enough trial and error ... just think even *more* Midgard about where
this field might be!

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

---

 src/gallium/drivers/panfrost/pan_context.c | 1 +
 src/panfrost/include/panfrost-job.h        | 3 ++-
 src/panfrost/pandecode/decode.c            | 3 +++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index bae8527d87e..08b208b703a 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1824,6 +1824,7 @@ panfrost_create_sampler_state(
                 },
                 .min_lod = FIXED_16(cso->min_lod),
                 .max_lod = FIXED_16(cso->max_lod),
+                .lod_bias = FIXED_16(cso->lod_bias),
                 .seamless_cube_map = cso->seamless_cube_map,
         };
 
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index d9a3fe9327e..06a45d186d3 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -1280,12 +1280,13 @@ FIXED_16(float x)
 }
 
 struct mali_sampler_descriptor {
-        uint32_t filter_mode;
+        uint16_t filter_mode;
 
         /* Fixed point. Upper 8-bits is before the decimal point, although it
          * caps [0-31]. Lower 8-bits is after the decimal point: int(round(x *
          * 256)) */
 
+        uint16_t lod_bias;
         uint16_t min_lod;
         uint16_t max_lod;
 
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c
index 70a3a355cb7..847a0d7e7b0 100644
--- a/src/panfrost/pandecode/decode.c
+++ b/src/panfrost/pandecode/decode.c
@@ -2464,6 +2464,9 @@ pandecode_vertex_tiler_postfix_pre(
                                 pandecode_prop("min_lod = FIXED_16(%f)", DECODE_FIXED_16(s->min_lod));
                                 pandecode_prop("max_lod = FIXED_16(%f)", DECODE_FIXED_16(s->max_lod));
 
+                                if (s->lod_bias)
+                                        pandecode_prop("lod_bias = FIXED_16(%f)", DECODE_FIXED_16(s->lod_bias));
+
                                 pandecode_prop("wrap_s = %s", pandecode_wrap_mode(s->wrap_s));
                                 pandecode_prop("wrap_t = %s", pandecode_wrap_mode(s->wrap_t));
                                 pandecode_prop("wrap_r = %s", pandecode_wrap_mode(s->wrap_r));




More information about the mesa-commit mailing list