void si_pm4_sh_data_end(struct si_pm4_state *state, unsigned reg)
{
unsigned offs = state->last_pm4 + 1;
+
+ /* Bail if no data was added */
+ if (state->ndw == offs) {
+ state->ndw--;
+ return;
+ }
+
si_pm4_cmd_end(state, false);
si_pm4_cmd_begin(state, PKT3_SET_SH_REG_OFFSET);
si_pm4_sh_data_begin(pm4);
for (i = 0; i < count; i++) {
- struct r600_resource_texture *tex = (void *)resource[i]->base.texture;
-
pipe_sampler_view_reference(
(struct pipe_sampler_view **)&rctx->ps_samplers.views[i],
views[i]);
- si_pm4_add_bo(pm4, &tex->resource, RADEON_USAGE_READ);
+ if (views[i]) {
+ struct r600_resource_texture *tex = (void *)resource[i]->base.texture;
+
+ si_pm4_add_bo(pm4, &tex->resource, RADEON_USAGE_READ);
- for (j = 0; j < Elements(resource[i]->state); ++j) {
- si_pm4_sh_data_add(pm4, resource[i]->state[j]);
+ for (j = 0; j < Elements(resource[i]->state); ++j) {
+ si_pm4_sh_data_add(pm4, resource[i]->state[j]);
+ }
}
}