summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_util.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2018-11-19 10:24:40 -0500
committerRob Clark <[email protected]>2018-11-27 15:44:02 -0500
commitd47d77d49d59cb25656480c745977f35a0f55d70 (patch)
tree0d8a69f7e9c75c5a2a51a9347143d7ba98c0a681 /src/gallium/drivers/freedreno/freedreno_util.h
parent2773919f06fe1c590eff8e777709099174b7fb1c (diff)
freedreno/a6xx: set guardband clip
On older gens, the CLIP_ADJ bitfields were actually 3.6 fixed point. Which might make more sense. Although this formula comes up with values pretty close to what blob does for various viewport sizes (for at least a5xx and a6xx), and seems to work. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_util.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h
index e03f37dd627..125ad83523c 100644
--- a/src/gallium/drivers/freedreno/freedreno_util.h
+++ b/src/gallium/drivers/freedreno/freedreno_util.h
@@ -194,6 +194,18 @@ fd_half_precision(struct pipe_framebuffer_state *pfb)
return true;
}
+/* Note sure if this is same on all gens, but seems to be same on the later
+ * gen's
+ */
+static inline unsigned
+fd_calc_guardband(unsigned x)
+{
+ float l = log2(x);
+ if (l <= 8)
+ return 511;
+ return 511 - ((l - 8) * 65);
+}
+
#define LOG_DWORDS 0
static inline void emit_marker(struct fd_ringbuffer *ring, int scratch_idx);