struct fd_texture_stateobj *tex, unsigned samp_id, texmask emitted)
{
unsigned const_idx = fd2_get_const_idx(ctx, tex, samp_id);
+ static const struct fd2_sampler_stateobj dummy_sampler = {};
struct fd2_sampler_stateobj *sampler;
struct fd2_pipe_sampler_view *view;
if (emitted & (1 << const_idx))
return 0;
- sampler = fd2_sampler_stateobj(tex->samplers[samp_id]);
+ sampler = tex->samplers[samp_id] ?
+ fd2_sampler_stateobj(tex->samplers[samp_id]) :
+ &dummy_sampler;
view = fd2_pipe_sampler_view(tex->textures[samp_id]);
OUT_PKT3(ring, CP_SET_CONSTANT, 7);
OUT_RING(ring, CP_LOAD_STATE_1_STATE_TYPE(ST_SHADER) |
CP_LOAD_STATE_1_EXT_SRC_ADDR(0));
for (i = 0; i < tex->num_samplers; i++) {
- struct fd3_sampler_stateobj *sampler =
- fd3_sampler_stateobj(tex->samplers[i]);
+ static const struct fd3_sampler_stateobj dummy_sampler = {};
+ struct fd3_sampler_stateobj *sampler = tex->samplers[i] ?
+ fd3_sampler_stateobj(tex->samplers[i]) :
+ &dummy_sampler;
OUT_RING(ring, sampler->texsamp0);
OUT_RING(ring, sampler->texsamp1);
}