summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2019-11-04 11:57:22 +0100
committerBoris Brezillon <[email protected]>2019-11-04 16:14:09 +0100
commit28440820eff55d412fbce3243c24bc9f58c3b8e6 (patch)
tree150ae1f0d7853ca41f6e6cad9a9ee3fc6a8dd383 /src
parent71634b10032d48dd43941390e556a89fe5d858f6 (diff)
panfrost: MALI_DEPTH_TEST is actually MALI_DEPTH_WRITEMASK
MALI_DEPTH_TEST should only be set when depth->writemask is true, not when the depth test is enabled. Let's rename the flag and patch panfrost_bind_depth_stencil_state() to do the right thing. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c3
-rw-r--r--src/panfrost/include/panfrost-job.h2
-rw-r--r--src/panfrost/pandecode/decode.c4
3 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 69b3b96295d..285936c5c26 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2346,7 +2346,8 @@ panfrost_bind_depth_stencil_state(struct pipe_context *pipe,
ctx->fragment_shader_core.stencil_mask_back = depth_stencil->stencil[back_index].writemask;
/* Depth state (TODO: Refactor) */
- SET_BIT(ctx->fragment_shader_core.unknown2_3, MALI_DEPTH_TEST, depth_stencil->depth.enabled);
+ SET_BIT(ctx->fragment_shader_core.unknown2_3, MALI_DEPTH_WRITEMASK,
+ depth_stencil->depth.writemask);
int func = depth_stencil->depth.enabled ? depth_stencil->depth.func : PIPE_FUNC_ALWAYS;
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index 2e766a0c56f..286c663e41e 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -123,7 +123,7 @@ enum mali_alt_func {
#define MALI_GET_DEPTH_FUNC(flags) ((flags >> 8) & 0x7)
#define MALI_DEPTH_FUNC_MASK MALI_DEPTH_FUNC(0x7)
-#define MALI_DEPTH_TEST (1 << 11)
+#define MALI_DEPTH_WRITEMASK (1 << 11)
/* Next flags to unknown2_4 */
#define MALI_STENCIL_TEST (1 << 0)
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c
index 9beb1049a69..a310582ebe8 100644
--- a/src/panfrost/pandecode/decode.c
+++ b/src/panfrost/pandecode/decode.c
@@ -223,7 +223,7 @@ static const struct pandecode_flag_info u3_flag_info[] = {
FLAG_INFO(HAS_MSAA),
FLAG_INFO(CAN_DISCARD),
FLAG_INFO(HAS_BLEND_SHADER),
- FLAG_INFO(DEPTH_TEST),
+ FLAG_INFO(DEPTH_WRITEMASK),
{}
};
@@ -2141,7 +2141,7 @@ pandecode_vertex_tiler_postfix_pre(
/* We're not quite sure what these flags mean without the depth test, if anything */
- if (unknown2_3 & (MALI_DEPTH_TEST | MALI_DEPTH_FUNC_MASK)) {
+ if (unknown2_3 & (MALI_DEPTH_WRITEMASK | MALI_DEPTH_FUNC_MASK)) {
const char *func = pandecode_func(MALI_GET_DEPTH_FUNC(unknown2_3));
unknown2_3 &= ~MALI_DEPTH_FUNC_MASK;