if (rctx->fixed_func_tcs_shader)
rctx->b.b.delete_tcs_state(&rctx->b.b, rctx->fixed_func_tcs_shader);
+ if (rctx->dummy_pixel_shader) {
+ rctx->b.b.delete_fs_state(&rctx->b.b, rctx->dummy_pixel_shader);
+ }
if (rctx->custom_dsa_flush) {
rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush);
}
r600_begin_new_cs(rctx);
+ rctx->dummy_pixel_shader =
+ util_make_fragment_cloneinput_shader(&rctx->b.b, 0,
+ TGSI_SEMANTIC_GENERIC,
+ TGSI_INTERPOLATE_CONSTANT);
+ rctx->b.b.bind_fs_state(&rctx->b.b, rctx->dummy_pixel_shader);
+
return &rctx->b.b;
fail:
if (!key->vs.as_ls)
key->vs.as_es = (rctx->gs_shader != NULL);
- if (rctx->ps_shader && rctx->ps_shader->current->shader.gs_prim_id_input &&
- !rctx->gs_shader) {
+ if (rctx->ps_shader->current->shader.gs_prim_id_input && !rctx->gs_shader) {
key->vs.as_gs_a = true;
key->vs.prim_id_out = rctx->ps_shader->current->shader.input[rctx->ps_shader->current->shader.ps_prim_id_input].spi_sid;
}
{
struct r600_context *rctx = (struct r600_context *)ctx;
+ if (!state)
+ state = rctx->dummy_pixel_shader;
+
rctx->ps_shader = (struct r600_pipe_shader_selector *)state;
}
}
}
- if (rctx->ps_shader)
- SELECT_SHADER_OR_FAIL(ps);
+ SELECT_SHADER_OR_FAIL(ps);
r600_mark_atom_dirty(rctx, &rctx->shader_stages.atom);
rctx->b.streamout.enabled_stream_buffers_mask = clip_so_current->enabled_stream_buffers_mask;
}
- if (rctx->ps_shader) {
- if (unlikely((ps_dirty || rctx->hw_shader_stages[R600_HW_STAGE_PS].shader != rctx->ps_shader->current ||
- rctx->rasterizer->sprite_coord_enable != rctx->ps_shader->current->sprite_coord_enable ||
- rctx->rasterizer->flatshade != rctx->ps_shader->current->flatshade))) {
+ if (unlikely(ps_dirty || rctx->hw_shader_stages[R600_HW_STAGE_PS].shader != rctx->ps_shader->current ||
+ rctx->rasterizer->sprite_coord_enable != rctx->ps_shader->current->sprite_coord_enable ||
+ rctx->rasterizer->flatshade != rctx->ps_shader->current->flatshade)) {
- if (rctx->cb_misc_state.nr_ps_color_outputs != rctx->ps_shader->current->nr_ps_color_outputs) {
- rctx->cb_misc_state.nr_ps_color_outputs = rctx->ps_shader->current->nr_ps_color_outputs;
- r600_mark_atom_dirty(rctx, &rctx->cb_misc_state.atom);
- }
+ if (rctx->cb_misc_state.nr_ps_color_outputs != rctx->ps_shader->current->nr_ps_color_outputs) {
+ rctx->cb_misc_state.nr_ps_color_outputs = rctx->ps_shader->current->nr_ps_color_outputs;
+ r600_mark_atom_dirty(rctx, &rctx->cb_misc_state.atom);
+ }
- if (rctx->b.chip_class <= R700) {
- bool multiwrite = rctx->ps_shader->current->shader.fs_write_all;
+ if (rctx->b.chip_class <= R700) {
+ bool multiwrite = rctx->ps_shader->current->shader.fs_write_all;
- if (rctx->cb_misc_state.multiwrite != multiwrite) {
- rctx->cb_misc_state.multiwrite = multiwrite;
- r600_mark_atom_dirty(rctx, &rctx->cb_misc_state.atom);
- }
+ if (rctx->cb_misc_state.multiwrite != multiwrite) {
+ rctx->cb_misc_state.multiwrite = multiwrite;
+ r600_mark_atom_dirty(rctx, &rctx->cb_misc_state.atom);
}
+ }
- if (unlikely(!ps_dirty && rctx->rasterizer &&
- ((rctx->rasterizer->sprite_coord_enable != rctx->ps_shader->current->sprite_coord_enable) ||
- (rctx->rasterizer->flatshade != rctx->ps_shader->current->flatshade)))) {
-
- if (rctx->b.chip_class >= EVERGREEN)
- evergreen_update_ps_state(ctx, rctx->ps_shader->current);
- else
- r600_update_ps_state(ctx, rctx->ps_shader->current);
- }
+ if (unlikely(!ps_dirty && rctx->ps_shader && rctx->rasterizer &&
+ ((rctx->rasterizer->sprite_coord_enable != rctx->ps_shader->current->sprite_coord_enable) ||
+ (rctx->rasterizer->flatshade != rctx->ps_shader->current->flatshade)))) {
- r600_mark_atom_dirty(rctx, &rctx->shader_stages.atom);
+ if (rctx->b.chip_class >= EVERGREEN)
+ evergreen_update_ps_state(ctx, rctx->ps_shader->current);
+ else
+ r600_update_ps_state(ctx, rctx->ps_shader->current);
}
- UPDATE_SHADER(R600_HW_STAGE_PS, ps);
+ r600_mark_atom_dirty(rctx, &rctx->shader_stages.atom);
}
+ UPDATE_SHADER(R600_HW_STAGE_PS, ps);
if (rctx->b.chip_class >= EVERGREEN) {
evergreen_update_db_shader_control(rctx);
}
}
- blend_disable = (rctx->dual_src_blend && rctx->ps_shader &&
+ blend_disable = (rctx->dual_src_blend &&
rctx->ps_shader->current->nr_ps_color_outputs < 2);
if (blend_disable != rctx->force_blend_disable) {