diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h index 7a120b6..06fb798 100644 --- a/src/mesa/drivers/common/meta_blit.c +++ b/src/mesa/drivers/common/meta_blit.c @@ -344,6 +344,57 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, vec4_prefix = ""; } + + /* All of the non-depth resolve blits need to factor in the number of color + * draw buffers so that the source values can be broadcast correctly. + * + * Eventually this needs to expand to all non-depth blits. See + * https://bugs.freedesktop.org/show_bug.cgi?id=94128. It seems like + * before that happens the blit_msaa_shader enum should be reorganized as a + * bitfield to describe the blit using values that can easily be extracted + * from the shader index. + * + * Scaled blits are handled elsewhere. + */ + switch (shader_index) { + case BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE: + case BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE: + case BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE: + case BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE: + case BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE: + case BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT: + case BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT: + case BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT: + case BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT: + case BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT: + case BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT: + case BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT: + case BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT: + case BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT: + case BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT: + case BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE: + case BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE: + case BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE: + case BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE: + case BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE: + case BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT: + case BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT: + case BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT: + case BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT: + case BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT: + case BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT: + case BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT: + case BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT: + case BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT: + case BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT: + assert(drawFb->_NumColorDrawBuffers > 0); + assert(!dst_is_msaa); + break; + default: + break; + }; + if (blit->msaa_shaders[shader_index]) { _mesa_UseProgram(blit->msaa_shaders[shader_index]); return;