panfrost_prepare_midgard_fs_state(ctx, blend_shaders, state);
bool msaa = rast->multisample;
- state->multisample_misc.multisample_enable = msaa;
state->multisample_misc.sample_mask = msaa ? ctx->sample_mask : 0xFFFF;
state->multisample_misc.evaluate_per_sample =
msaa && (ctx->min_samples > 1);
- state->multisample_misc.fixed_function_near_discard = rast->depth_clip_near;
- state->multisample_misc.fixed_function_far_discard = rast->depth_clip_far;
- state->multisample_misc.shader_depth_range_fixed = true;
-
state->stencil_mask_misc.alpha_to_coverage = alpha_to_coverage;
- state->stencil_mask_misc.depth_range_1 = rast->offset_tri;
- state->stencil_mask_misc.depth_range_2 = rast->offset_tri;
- state->stencil_mask_misc.single_sampled_lines = !rast->multisample;
state->depth_units = rast->offset_units * 2.0f;
state->depth_factor = rast->offset_scale;
state->alpha_reference = zsa->base.alpha_ref_value;
}
-
static void
panfrost_emit_frag_shader(struct panfrost_context *ctx,
struct mali_renderer_state_packed *fragmeta,
{
struct panfrost_device *dev = pan_device(ctx->base.screen);
const struct panfrost_zsa_state *zsa = ctx->depth_stencil;
+ const struct panfrost_rasterizer *rast = ctx->rasterizer;
struct panfrost_shader_state *fs =
panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
pan_merge(rsd, fs->partial_rsd, RENDERER_STATE);
/* Word 8, 9 Misc state */
- rsd.opaque[8] |= zsa->rsd_depth.opaque[0];
- rsd.opaque[9] |= zsa->rsd_stencil.opaque[0];
+ rsd.opaque[8] |= zsa->rsd_depth.opaque[0]
+ | rast->multisample.opaque[0];
+
+ rsd.opaque[9] |= zsa->rsd_stencil.opaque[0]
+ | rast->stencil_misc.opaque[0];
/* Word 10, 11 Stencil Front and Back */
rsd.opaque[10] |= zsa->stencil_front.opaque[0];
/* Gauranteed with the core GL call, so don't expose ARB_polygon_offset */
assert(cso->offset_clamp == 0.0);
+ pan_pack(&so->multisample, MULTISAMPLE_MISC, cfg) {
+ cfg.multisample_enable = cso->multisample;
+ cfg.fixed_function_near_discard = cso->depth_clip_near;
+ cfg.fixed_function_far_discard = cso->depth_clip_far;
+ cfg.shader_depth_range_fixed = true;
+ }
+
+ pan_pack(&so->stencil_misc, STENCIL_MASK_MISC, cfg) {
+ cfg.depth_range_1 = cso->offset_tri;
+ cfg.depth_range_2 = cso->offset_tri;
+ cfg.single_sampled_lines = !cso->multisample;
+ }
+
return so;
}