aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-27 16:07:00 -0400
committerAlyssa Rosenzweig <[email protected]>2020-05-27 16:49:44 -0400
commit55e3305a5b0bd47874e99b3dd090929fc3cbfd0e (patch)
treee2801051b58ee6252243446c44a17844b0f1b9b6 /src
parent0e88dff374bb72a1fb28941029726e2b79ad2784 (diff)
panfrost: Document Midgard Inf/NaN suppress bit
We should probably not be setting this.. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5232>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_cmdstream.c5
-rw-r--r--src/panfrost/include/panfrost-job.h11
-rw-r--r--src/panfrost/pandecode/decode.c1
3 files changed, 16 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 733351eee23..fa5c7e2da5d 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -346,7 +346,10 @@ panfrost_shader_meta_init(struct panfrost_context *ctx,
meta->midgard1.uniform_count = MIN2(ss->uniform_count,
ss->uniform_cutoff);
meta->midgard1.work_count = ss->work_reg_count;
- meta->midgard1.flags_hi = 0x8; /* XXX */
+
+ /* TODO: This is not conformant on ES3 */
+ meta->midgard1.flags_hi = MALI_SUPPRESS_INF_NAN;
+
meta->midgard1.flags_lo = 0x220;
meta->midgard1.uniform_buffer_count = panfrost_ubo_count(ctx, st);
}
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index 1234d3bbfa9..177242d42a9 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -415,6 +415,17 @@ enum mali_format {
/* Should be set when the fragment shader updates the stencil value. */
#define MALI_WRITES_S (1 << 2)
+/* Mode to suppress generation of Infinity and NaN values by clamping inf
+ * (-inf) to MAX_FLOAT (-MIN_FLOAT) and flushing NaN to 0.0
+ *
+ * Compare suppress_inf/suppress_nan flags on the Bifrost clause header for the
+ * same functionality.
+ *
+ * This is not conformant on GLES3 or OpenCL, but is optional on GLES2, where
+ * it works around app bugs (e.g. in glmark2-es2 -bterrain with FP16).
+ */
+#define MALI_SUPPRESS_INF_NAN (1 << 3)
+
/* The raw Midgard blend payload can either be an equation or a shader
* address, depending on the context */
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c
index 1bd1273f735..77134cddbd4 100644
--- a/src/panfrost/pandecode/decode.c
+++ b/src/panfrost/pandecode/decode.c
@@ -273,6 +273,7 @@ static const struct pandecode_flag_info shader_midgard1_flag_lo_info [] = {
static const struct pandecode_flag_info shader_midgard1_flag_hi_info [] = {
FLAG_INFO(WRITES_S),
+ FLAG_INFO(SUPPRESS_INF_NAN),
{}
};
#undef FLAG_INFO