do {
if (var->cso) {
- if (This->base.device->context.cso_shader.ps == var->cso)
+ if (This->base.device->context.cso_shader.ps == var->cso) {
+ /* unbind because it is illegal to delete something bound */
pipe->bind_fs_state(pipe, NULL);
+ /* This will rebind cso_shader.ps in case somehow actually
+ * an identical shader with same cso is bound */
+ This->base.device->context.commit |= NINE_STATE_COMMIT_PS;
+ }
pipe->delete_fs_state(pipe, var->cso);
FREE(var->const_ranges);
}
} while (var);
if (This->ff_cso) {
- if (This->ff_cso == This->base.device->context.cso_shader.ps)
+ if (This->ff_cso == This->base.device->context.cso_shader.ps) {
pipe->bind_fs_state(pipe, NULL);
+ This->base.device->context.commit |= NINE_STATE_COMMIT_PS;
+ }
pipe->delete_fs_state(pipe, This->ff_cso);
}
}
do {
if (var->cso) {
- if (This->base.device->context.cso_shader.vs == var->cso)
+ if (This->base.device->context.cso_shader.vs == var->cso) {
+ /* unbind because it is illegal to delete something bound */
pipe->bind_vs_state(pipe, NULL);
+ /* This will rebind cso_shader.vs in case somehow actually
+ * an identical shader with same cso is bound */
+ This->base.device->context.commit |= NINE_STATE_COMMIT_VS;
+ }
pipe->delete_vs_state(pipe, var->cso);
FREE(var->const_ranges);
}
}
if (This->ff_cso) {
- if (This->ff_cso == This->base.device->context.cso_shader.vs)
+ if (This->ff_cso == This->base.device->context.cso_shader.vs) {
pipe->bind_vs_state(pipe, NULL);
+ This->base.device->context.commit |= NINE_STATE_COMMIT_VS;
+ }
pipe->delete_vs_state(pipe, This->ff_cso);
}
}