+ pan_pack(shader_meta_t.cpu, STATE, cfg) {
+ cfg.shader.shader = pool->dev->blit_shaders.loads[loc][T][ms];
+ cfg.shader.varying_count = 1;
+ cfg.shader.texture_count = 1;
+ cfg.shader.sampler_count = 1;
+
+ cfg.properties = properties.opaque[0];
+
+ cfg.multisample_misc.sample_mask = 0xFFFF;
+ cfg.multisample_misc.multisample_enable = ms;
+ cfg.multisample_misc.evaluate_per_sample = ms;
+ cfg.multisample_misc.depth_write_mask = (loc == FRAG_RESULT_DEPTH);
+ cfg.multisample_misc.depth_function = MALI_FUNC_ALWAYS;
+
+ cfg.stencil_mask_misc.stencil_enable = (loc == FRAG_RESULT_STENCIL);
+ cfg.stencil_mask_misc.stencil_mask_front = 0xFF;
+ cfg.stencil_mask_misc.stencil_mask_back = 0xFF;
+ cfg.stencil_mask_misc.unknown_1 = 0x7;
+
+ cfg.stencil_front.compare_function = MALI_FUNC_ALWAYS;
+ cfg.stencil_front.stencil_fail = MALI_STENCIL_OP_REPLACE;
+ cfg.stencil_front.depth_fail = MALI_STENCIL_OP_REPLACE;
+ cfg.stencil_front.depth_pass = MALI_STENCIL_OP_REPLACE;
+
+ cfg.stencil_back = cfg.stencil_front;
+
+ if (pool->dev->quirks & MIDGARD_SFBD) {
+ cfg.stencil_mask_misc.sfbd_write_enable = true;
+ cfg.stencil_mask_misc.sfbd_dither_disable = true;
+ cfg.stencil_mask_misc.sfbd_srgb = srgb;
+ cfg.multisample_misc.sfbd_blend_shader = blend_shader;
+ memcpy(&cfg.sfbd_blend, &replace, sizeof(replace));
+ } else if (!(pool->dev->quirks & IS_BIFROST)) {
+ memcpy(&cfg.sfbd_blend, &blend_shader, sizeof(blend_shader));
+ }