Commit 46e98004 authored by Rob Clark's avatar Rob Clark 💬 Committed by Marge Bot
Browse files

freedreno/a6xx: Fix 3dmark misrendering with unwritten MRTs



Fixes an issue with 3dmark caused by a shader that only writes mrt0 in a
renderpass that has two color buffers bound, resulting in mrt1 getting
random/undefined values.
Signed-off-by: Rob Clark's avatarRob Clark <robdclark@chromium.org>
Part-of: <!8685>
parent aa1ddb6f
Pipeline #261537 waiting for manual action with stages
......@@ -1003,6 +1003,8 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit)
if (blend->use_dual_src_blend)
mrt_components |= 0xf << 4;
mrt_components &= prog->mrt_components;
OUT_REG(ring, A6XX_SP_FS_RENDER_COMPONENTS(.dword = mrt_components));
OUT_REG(ring, A6XX_RB_RENDER_COMPONENTS(.dword = mrt_components));
......
......@@ -786,6 +786,14 @@ setup_stateobj(struct fd_ringbuffer *ring, struct fd_context *ctx,
for (i = 0; i < 8; i++) {
OUT_RING(ring, A6XX_SP_FS_OUTPUT_REG_REGID(color_regid[i]) |
COND(color_regid[i] & HALF_REG_ID, A6XX_SP_FS_OUTPUT_REG_HALF_PRECISION));
if (VALIDREG(color_regid[i])) {
state->mrt_components |= 0xf << (i * 4);
}
}
/* dual source blending has an extra fs output in the 2nd slot */
if (fs_has_dual_src_color) {
state->mrt_components |= 0xf << 4;
}
OUT_PKT4(ring, REG_A6XX_VPC_VS_PACK, 1);
......
......@@ -49,6 +49,13 @@ struct fd6_program_state {
struct fd_ringbuffer *binning_stateobj;
struct fd_ringbuffer *streamout_stateobj;
struct fd_ringbuffer *stateobj;
/**
* Output components from frag shader. It is possible to have
* a fragment shader that only writes a subset of the bound
* render targets.
*/
uint32_t mrt_components;
};
static inline struct fd6_program_state *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment