static void upload_wm_state(struct brw_context *brw) { struct gl_context *ctx = &brw->ctx; /* BRW_NEW_FS_PROG_DATA */ const struct brw_wm_prog_data *prog_data = brw->wm.prog_data; /* _NEW_BUFFERS */ const bool multisampled_fbo = _mesa_geometric_samples(ctx->DrawBuffer) > 1; /* BRW_NEW_FS_PROG_DATA | _NEW_COLOR */ const bool dual_src_blend_enable = prog_data->dual_src_blend && (ctx->Color.BlendEnabled & 1) && ctx->Color.Blend[0]._UsesDualSrc; /* _NEW_COLOR, _NEW_MULTISAMPLE */ const bool kill_enable = prog_data->uses_kill || ctx->Color.AlphaEnabled || ctx->Multisample.SampleAlphaToCoverage || prog_data->uses_omask; /* Rendering against the gl-context is always taken into account. */ const bool statistic_enable = true; /* _NEW_LINE | _NEW_POLYGON | _NEW_BUFFERS | _NEW_COLOR | * _NEW_MULTISAMPLE */ gen6_upload_wm_state(brw, prog_data, &brw->wm.base, multisampled_fbo, dual_src_blend_enable, kill_enable, brw_color_buffer_write_enabled(brw), ctx->Multisample.Enabled, ctx->Line.StippleFlag, ctx->Polygon.StippleFlag, statistic_enable); }
static void upload_wm_state(struct brw_context *brw) { struct gl_context *ctx = &brw->ctx; /* BRW_NEW_FRAGMENT_PROGRAM */ const struct brw_fragment_program *fp = brw_fragment_program_const(brw->fragment_program); /* BRW_NEW_FS_PROG_DATA */ const struct brw_wm_prog_data *prog_data = brw->wm.prog_data; /* _NEW_BUFFERS */ const bool multisampled_fbo = _mesa_geometric_samples(ctx->DrawBuffer) > 1; /* In case of non 1x per sample shading, only one of SIMD8 and SIMD16 * should be enabled. We do 'SIMD16 only' dispatch if a SIMD16 shader * is successfully compiled. In majority of the cases that bring us * better performance than 'SIMD8 only' dispatch. */ const int min_inv_per_frag = _mesa_get_min_invocations_per_fragment( ctx, brw->fragment_program, false); /* BRW_NEW_FS_PROG_DATA | _NEW_COLOR */ const bool dual_src_blend_enable = prog_data->dual_src_blend && (ctx->Color.BlendEnabled & 1) && ctx->Color.Blend[0]._UsesDualSrc; /* _NEW_COLOR, _NEW_MULTISAMPLE */ const bool kill_enable = prog_data->uses_kill || ctx->Color.AlphaEnabled || ctx->Multisample.SampleAlphaToCoverage || prog_data->uses_omask; /* Rendering against the gl-context is always taken into account. */ const bool statistic_enable = true; /* _NEW_LINE | _NEW_POLYGON | _NEW_BUFFERS | _NEW_COLOR | * _NEW_MULTISAMPLE */ gen6_upload_wm_state(brw, fp, prog_data, &brw->wm.base, multisampled_fbo, min_inv_per_frag, dual_src_blend_enable, kill_enable, brw_color_buffer_write_enabled(brw), ctx->Multisample.Enabled, ctx->Line.StippleFlag, ctx->Polygon.StippleFlag, statistic_enable); }