static inline void
nv50_stage_sampler_states_bind(struct nv50_context *nv50, int s,
- unsigned nr, void **hwcso)
+ unsigned nr, void **hwcsos)
{
unsigned highest_found = 0;
unsigned i;
assert(nr <= PIPE_MAX_SAMPLERS);
for (i = 0; i < nr; ++i) {
+ struct nv50_tsc_entry *hwcso = hwcsos ? nv50_tsc_entry(hwcsos[i]) : NULL;
struct nv50_tsc_entry *old = nv50->samplers[s][i];
- if (hwcso[i])
+ if (hwcso)
highest_found = i;
- nv50->samplers[s][i] = nv50_tsc_entry(hwcso[i]);
+ nv50->samplers[s][i] = hwcso;
if (old)
nv50_screen_tsc_unlock(nv50->screen, old);
}
assert(nr <= PIPE_MAX_SAMPLERS);
for (i = 0; i < nr; ++i) {
+ struct pipe_sampler_view *view = views ? views[i] : NULL;
struct nv50_tic_entry *old = nv50_tic_entry(nv50->textures[s][i]);
if (old)
nv50_screen_tic_unlock(nv50->screen, old);
- if (views[i] && views[i]->texture) {
- struct pipe_resource *res = views[i]->texture;
+ if (view && view->texture) {
+ struct pipe_resource *res = view->texture;
if (res->target == PIPE_BUFFER &&
(res->flags & PIPE_RESOURCE_FLAG_MAP_COHERENT))
nv50->textures_coherent[s] |= 1 << i;
nv50->textures_coherent[s] &= ~(1 << i);
}
- pipe_sampler_view_reference(&nv50->textures[s][i], views[i]);
+ pipe_sampler_view_reference(&nv50->textures[s][i], view);
}
assert(nv50->num_textures[s] <= PIPE_MAX_SAMPLERS);
static inline void
nvc0_stage_sampler_states_bind(struct nvc0_context *nvc0,
unsigned s,
- unsigned nr, void **hwcso)
+ unsigned nr, void **hwcsos)
{
unsigned highest_found = 0;
unsigned i;
for (i = 0; i < nr; ++i) {
+ struct nv50_tsc_entry *hwcso = hwcsos ? nv50_tsc_entry(hwcsos[i]) : NULL;
struct nv50_tsc_entry *old = nvc0->samplers[s][i];
- if (hwcso[i])
+ if (hwcso)
highest_found = i;
- if (hwcso[i] == old)
+ if (hwcso == old)
continue;
nvc0->samplers_dirty[s] |= 1 << i;
- nvc0->samplers[s][i] = nv50_tsc_entry(hwcso[i]);
+ nvc0->samplers[s][i] = hwcso;
if (old)
nvc0_screen_tsc_unlock(nvc0->screen, old);
}
unsigned i;
for (i = 0; i < nr; ++i) {
+ struct pipe_sampler_view *view = views ? views[i] : NULL;
struct nv50_tic_entry *old = nv50_tic_entry(nvc0->textures[s][i]);
- if (views[i] == nvc0->textures[s][i])
+ if (view == nvc0->textures[s][i])
continue;
nvc0->textures_dirty[s] |= 1 << i;
- if (views[i] && views[i]->texture) {
- struct pipe_resource *res = views[i]->texture;
+ if (view && view->texture) {
+ struct pipe_resource *res = view->texture;
if (res->target == PIPE_BUFFER &&
(res->flags & PIPE_RESOURCE_FLAG_MAP_COHERENT))
nvc0->textures_coherent[s] |= 1 << i;
nvc0_screen_tic_unlock(nvc0->screen, old);
}
- pipe_sampler_view_reference(&nvc0->textures[s][i], views[i]);
+ pipe_sampler_view_reference(&nvc0->textures[s][i], view);
}
for (i = nr; i < nvc0->num_textures[s]; ++i) {