ctx->pipe->bind_sampler_states(ctx->pipe, sh, 0, maxsam, zeros);
}
if (maxview > 0) {
- ctx->pipe->set_sampler_views(ctx->pipe, sh, 0, maxview, views);
+ ctx->pipe->set_sampler_views(ctx->pipe, sh, 0, maxview, 0, views);
}
if (maxssbo > 0) {
ctx->pipe->set_shader_buffers(ctx->pipe, sh, 0, maxssbo, ssbos, 0);
void (*driver_set_sampler_views)(struct pipe_context *,
enum pipe_shader_type shader,
unsigned start, unsigned count,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **);
void (*driver_set_polygon_stipple)(struct pipe_context *,
num_samplers, pstip->state.samplers);
pstip->driver_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
- num_sampler_views, pstip->state.sampler_views);
+ num_sampler_views, 0, pstip->state.sampler_views);
draw->suspend_flushing = FALSE;
pstip->state.samplers);
pstip->driver_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
- pstip->num_sampler_views,
+ pstip->num_sampler_views, 0,
pstip->state.sampler_views);
draw->suspend_flushing = FALSE;
pstip_set_sampler_views(struct pipe_context *pipe,
enum pipe_shader_type shader,
unsigned start, unsigned num,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
pipe_sampler_view_reference(&pstip->state.sampler_views[start + i],
views[i]);
}
+ for (; i < num + unbind_num_trailing_slots; i++) {
+ pipe_sampler_view_reference(&pstip->state.sampler_views[start + i],
+ NULL);
+ }
pstip->num_sampler_views = num;
}
/* pass-through */
- pstip->driver_set_sampler_views(pstip->pipe, shader, start, num, views);
+ pstip->driver_set_sampler_views(pstip->pipe, shader, start, num,
+ unbind_num_trailing_slots, views);
}
dd_context_set_sampler_views(struct pipe_context *_pipe,
enum pipe_shader_type shader,
unsigned start, unsigned num,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct dd_context *dctx = dd_context(_pipe);
safe_memcpy(&dctx->draw_state.sampler_views[shader][start], views,
sizeof(views[0]) * num);
- pipe->set_sampler_views(pipe, shader, start, num, views);
+ safe_memcpy(&dctx->draw_state.sampler_views[shader][start + num], views,
+ sizeof(views[0]) * unbind_num_trailing_slots);
+ pipe->set_sampler_views(pipe, shader, start, num,
+ unbind_num_trailing_slots, views);
}
static void
static void noop_set_sampler_views(struct pipe_context *ctx,
enum pipe_shader_type shader,
unsigned start, unsigned count,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
}
enum pipe_shader_type shader,
unsigned start,
unsigned num,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **_views)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
views = unwrapped_views;
}
- pipe->set_sampler_views(pipe, shader, start, num, views);
+ pipe->set_sampler_views(pipe, shader, start, num,
+ unbind_num_trailing_slots, views);
mtx_unlock(&rb_pipe->call_mutex);
}
enum pipe_shader_type shader,
unsigned start,
unsigned num,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct trace_context *tr_ctx = trace_context(_pipe);
trace_dump_arg(uint, shader);
trace_dump_arg(uint, start);
trace_dump_arg(uint, num);
+ trace_dump_arg(uint, unbind_num_trailing_slots);
trace_dump_arg_array(ptr, views, num);
- pipe->set_sampler_views(pipe, shader, start, num, views);
+ pipe->set_sampler_views(pipe, shader, start, num,
+ unbind_num_trailing_slots, views);
trace_dump_call_end();
}
cso_set_vertex_shader_handle(cso, hud->vs);
cso_set_vertex_elements(cso, &hud->velems);
cso_set_render_condition(cso, NULL, FALSE, 0);
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1,
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0,
&hud->font_sampler_view);
cso_set_samplers(cso, PIPE_SHADER_FRAGMENT, 1, sampler_states);
pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 0, false, &hud->constbuf);
/* Unbind resources that we have bound. */
pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 0, false, NULL);
pipe->set_vertex_buffers(pipe, 0, 0, 1, NULL);
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, NULL);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 0, 1, NULL);
/* restore states not restored by cso */
if (hud->st) {
pp_filter_misc_state(p);
cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 1, samplers);
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &p->view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, &p->view);
cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][0]);
cso_set_fragment_shader_handle(p->cso, ppq->shaders[n][1]);
const struct pipe_sampler_state *samplers[] = {&p->sampler_point};
cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 1, samplers);
}
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &p->view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, &p->view);
cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][1]); /* offsetvs */
cso_set_fragment_shader_handle(p->cso, ppq->shaders[n][2]);
}
arr[0] = p->view;
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 3, arr);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 3, 0, arr);
cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][0]); /* passvs */
cso_set_fragment_shader_handle(p->cso, ppq->shaders[n][3]);
}
arr[1] = p->view;
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 2, arr);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 2, 0, arr);
cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][1]); /* offsetvs */
cso_set_fragment_shader_handle(p->cso, ppq->shaders[n][4]);
pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 0, false, NULL);
pipe->set_constant_buffer(pipe, PIPE_SHADER_FRAGMENT, 0, false, NULL);
pipe->set_vertex_buffers(pipe, 0, 0, 1, NULL);
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 3, NULL);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 0, 3, NULL);
/* restore states not restored by cso */
if (ppq->p->st) {
/* Fragment sampler views. */
pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
- ctx->base.saved_num_sampler_views,
+ ctx->base.saved_num_sampler_views, 0,
ctx->base.saved_sampler_views);
for (i = 0; i < ctx->base.saved_num_sampler_views; i++)
views[0] = src;
views[1] = pipe->create_sampler_view(pipe, src->texture, &templ);
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 2, views);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 2, 0, views);
pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0, 2, samplers);
pipe_sampler_view_reference(&views[1], NULL);
view = pipe->create_sampler_view(pipe, src->texture, &templ);
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, &view);
pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT,
0, 1, &sampler_state);
pipe_sampler_view_reference(&view, NULL);
} else {
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &src);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, &src);
pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT,
0, 1, &sampler_state);
}
src_templ.format = format;
src_view = pipe->create_sampler_view(pipe, tex, &src_templ);
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &src_view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, &src_view);
do_blits(ctx, dst_view, &dstbox, src_view, tex->width0, tex->height0,
&srcbox, is_depth, false);
true);
}
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &src_view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, &src_view);
pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &ctx->sampler_state);
unsigned stencil_bits =
u_sampler_view_default_template(&src_templ, src, src->format);
src_templ.format = util_format_linear(blit_info->src.format);
src_view = ctx->create_sampler_view(ctx, src, &src_templ);
- ctx->set_sampler_views(ctx, PIPE_SHADER_COMPUTE, 0, 1, &src_view);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_COMPUTE, 0, 1, 0, &src_view);
if (!*compute_state)
*compute_state = blit_compute_shader(ctx);
ctx->set_shader_images(ctx, PIPE_SHADER_COMPUTE, 0, 0, 1, NULL);
ctx->set_constant_buffer(ctx, PIPE_SHADER_COMPUTE, 0, false, NULL);
- ctx->set_sampler_views(ctx, PIPE_SHADER_COMPUTE, 0, 1, NULL);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_COMPUTE, 0, 0, 1, NULL);
pipe_sampler_view_reference(&src_view, NULL);
ctx->delete_sampler_state(ctx, sampler_state_p);
ctx->bind_compute_state(ctx, NULL);
PIPE_FORMAT_R8G8B8A8_UNORM, 0);
util_set_common_states_and_clear(cso, ctx, cb);
- ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, NULL);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 0, 1, NULL);
/* Fragment shader. */
fs = util_make_fragment_tex_shader(ctx, tgsi_tex_target,
templ.swizzle_b = PIPE_SWIZZLE_Z;
templ.swizzle_a = PIPE_SWIZZLE_W;
view = ctx->create_sampler_view(ctx, cb, &templ);
- ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, &view);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &view);
/* Fragment shader. */
if (num_samples > 1) {
}
struct tc_sampler_views {
- ubyte shader, start, count;
+ ubyte shader, start, count, unbind_num_trailing_slots;
struct pipe_sampler_view *slot[0]; /* more will be allocated if needed */
};
struct tc_sampler_views *p = (struct tc_sampler_views *)payload;
unsigned count = p->count;
- pipe->set_sampler_views(pipe, p->shader, p->start, p->count, p->slot);
+ pipe->set_sampler_views(pipe, p->shader, p->start, p->count,
+ p->unbind_num_trailing_slots, p->slot);
for (unsigned i = 0; i < count; i++)
pipe_sampler_view_reference(&p->slot[i], NULL);
}
tc_set_sampler_views(struct pipe_context *_pipe,
enum pipe_shader_type shader,
unsigned start, unsigned count,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
- if (!count)
+ if (!count && !unbind_num_trailing_slots)
return;
struct threaded_context *tc = threaded_context(_pipe);
p->shader = shader;
p->start = start;
p->count = count;
+ p->unbind_num_trailing_slots = unbind_num_trailing_slots;
if (views) {
for (unsigned i = 0; i < count; i++) {
filter->pipe->bind_sampler_states(filter->pipe, PIPE_SHADER_FRAGMENT,
0, 1, &filter->sampler);
filter->pipe->set_sampler_views(filter->pipe, PIPE_SHADER_FRAGMENT,
- 0, 1, &src);
+ 0, 1, 0, &src);
filter->pipe->bind_vs_state(filter->pipe, filter->vs);
filter->pipe->bind_fs_state(filter->pipe, filter->fs);
filter->pipe->set_framebuffer_state(filter->pipe, &fb_state);
c->pipe->bind_sampler_states(c->pipe, PIPE_SHADER_COMPUTE, 0,
num_sampler_views, layer->samplers);
c->pipe->set_sampler_views(c->pipe, PIPE_SHADER_COMPUTE, 0,
- num_sampler_views, samplers);
+ num_sampler_views, 0, samplers);
cs_launch(c, layer->cs, &(drawn.area));
/* Unbind. */
c->pipe->set_shader_images(c->pipe, PIPE_SHADER_COMPUTE, 0, 0, 1, NULL);
c->pipe->set_constant_buffer(c->pipe, PIPE_SHADER_COMPUTE, 0, false, NULL);
- c->pipe->set_sampler_views(c->pipe, PIPE_SHADER_FRAGMENT, 0,
+ c->pipe->set_sampler_views(c->pipe, PIPE_SHADER_FRAGMENT, 0, 0,
num_sampler_views, NULL);
c->pipe->bind_compute_state(c->pipe, NULL);
c->pipe->bind_sampler_states(c->pipe, PIPE_SHADER_COMPUTE, 0,
c->pipe->bind_sampler_states(c->pipe, PIPE_SHADER_FRAGMENT, 0,
num_sampler_views, layer->samplers);
c->pipe->set_sampler_views(c->pipe, PIPE_SHADER_FRAGMENT, 0,
- num_sampler_views, samplers);
+ num_sampler_views, 0, samplers);
util_draw_arrays(c->pipe, PIPE_PRIM_QUADS, vb_index * 4, 4);
vb_index++;
sampler_views[1] = prev_sv[k];
sampler_views[2] = cur_sv[k];
sampler_views[3] = next_sv[k];
- filter->pipe->set_sampler_views(filter->pipe, PIPE_SHADER_FRAGMENT, 0, 4, sampler_views);
+ filter->pipe->set_sampler_views(filter->pipe, PIPE_SHADER_FRAGMENT, 0, 4, 0, sampler_views);
/* blit current field */
fb_state.cbufs[0] = blit_surf;
idct->pipe->bind_sampler_states(idct->pipe, PIPE_SHADER_FRAGMENT,
0, 2, idct->samplers);
- idct->pipe->set_sampler_views(idct->pipe, PIPE_SHADER_FRAGMENT, 0, 2,
+ idct->pipe->set_sampler_views(idct->pipe, PIPE_SHADER_FRAGMENT, 0, 2, 0,
buffer->sampler_views.stage[0]);
/* mismatch control */
idct->pipe->bind_sampler_states(idct->pipe, PIPE_SHADER_FRAGMENT,
0, 2, idct->samplers);
idct->pipe->set_sampler_views(idct->pipe, PIPE_SHADER_FRAGMENT,
- 0, 2, buffer->sampler_views.stage[1]);
+ 0, 2, 0, buffer->sampler_views.stage[1]);
}
filter->pipe->bind_sampler_states(filter->pipe, PIPE_SHADER_FRAGMENT,
0, 1, &filter->sampler);
filter->pipe->set_sampler_views(filter->pipe, PIPE_SHADER_FRAGMENT,
- 0, 1, &src);
+ 0, 1, 0, &src);
filter->pipe->bind_vs_state(filter->pipe, filter->vs);
filter->pipe->bind_fs_state(filter->pipe, filter->fs);
filter->pipe->set_framebuffer_state(filter->pipe, &fb_state);
renderer->pipe->bind_fs_state(renderer->pipe, renderer->fs_ref);
renderer->pipe->set_sampler_views(renderer->pipe, PIPE_SHADER_FRAGMENT,
- 0, 1, &ref);
+ 0, 1, 0, &ref);
renderer->pipe->bind_sampler_states(renderer->pipe, PIPE_SHADER_FRAGMENT,
0, 1, &renderer->sampler_ref);
filter->pipe->bind_sampler_states(filter->pipe, PIPE_SHADER_FRAGMENT,
0, 1, &filter->sampler);
filter->pipe->set_sampler_views(filter->pipe, PIPE_SHADER_FRAGMENT,
- 0, 1, &src);
+ 0, 1, 0, &src);
filter->pipe->bind_vs_state(filter->pipe, filter->vs);
filter->pipe->bind_fs_state(filter->pipe, filter->fs);
filter->pipe->set_framebuffer_state(filter->pipe, &fb_state);
vl_idct_prepare_stage2(i ? &dec->idct_c : &dec->idct_y, &buf->idct[plane]);
else {
dec->context->set_sampler_views(dec->context,
- PIPE_SHADER_FRAGMENT, 0, 1,
+ PIPE_SHADER_FRAGMENT, 0, 1, 0,
&mc_source_sv[plane]);
dec->context->bind_sampler_states(dec->context,
PIPE_SHADER_FRAGMENT,
zscan->pipe->set_framebuffer_state(zscan->pipe, &buffer->fb_state);
zscan->pipe->set_viewport_states(zscan->pipe, 0, 1, &buffer->viewport);
zscan->pipe->set_sampler_views(zscan->pipe, PIPE_SHADER_FRAGMENT,
- 0, 3, &buffer->src);
+ 0, 3, 0, &buffer->src);
zscan->pipe->bind_vs_state(zscan->pipe, zscan->vs);
zscan->pipe->bind_fs_state(zscan->pipe, zscan->fs);
util_draw_arrays_instanced(zscan->pipe, PIPE_PRIM_QUADS, 0, 4, 0, num_instances);
void *sampler_state = get_sampler_state(ctx);
util_blit_save_state(ctx);
- pctx->set_sampler_views(pctx, PIPE_SHADER_FRAGMENT, 0, 1, &src_view);
+ pctx->set_sampler_views(pctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &src_view);
pctx->bind_sampler_states(pctx, PIPE_SHADER_FRAGMENT, 0, 1, &sampler_state);
util_blitter_custom_shader(ctx->blitter, dst_surf,
get_stencil_resolve_vs(ctx),
enum pipe_shader_type shader_type,
unsigned start_slot,
unsigned num_views,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct d3d12_context *ctx = d3d12_context(pctx);
- assert(views);
unsigned shader_bit = (1 << shader_type);
ctx->has_int_samplers &= ~shader_bit;
swizzle_state.swizzle_a = ss->swizzle_override_a;
}
}
+
+ for (unsigned i = 0; i < unbind_num_trailing_slots; i++)
+ pipe_sampler_view_reference(
+ &ctx->sampler_views[shader_type][start_slot + num_views + i], NULL);
+
ctx->num_sampler_views[shader_type] = start_slot + num_views;
ctx->shader_dirty[shader_type] |= D3D12_SHADER_DIRTY_SAMPLER_VIEWS;
}
static void
etna_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
unsigned start_slot, unsigned num_views,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct etna_context *ctx = etna_context(pctx);
static void
fd2_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
- unsigned start, unsigned nr,
+ unsigned start, unsigned nr, unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
if (shader == PIPE_SHADER_FRAGMENT) {
ctx->dirty |= FD_DIRTY_TEXSTATE;
}
- fd_set_sampler_views(pctx, shader, start, nr, views);
+ fd_set_sampler_views(pctx, shader, start, nr, unbind_num_trailing_slots, views);
}
/* map gallium sampler-id to hw const-idx.. adreno uses a flat address
static void
fd4_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
- unsigned start, unsigned nr,
+ unsigned start, unsigned nr, unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct fd_context *ctx = fd_context(pctx);
}
}
- fd_set_sampler_views(pctx, shader, start, nr, views);
+ fd_set_sampler_views(pctx, shader, start, nr, unbind_num_trailing_slots, views);
if (shader == PIPE_SHADER_FRAGMENT) {
fd4_ctx->fastc_srgb = astc_srgb;
static void
fd5_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
- unsigned start, unsigned nr,
+ unsigned start, unsigned nr, unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct fd_context *ctx = fd_context(pctx);
}
}
- fd_set_sampler_views(pctx, shader, start, nr, views);
+ fd_set_sampler_views(pctx, shader, start, nr, unbind_num_trailing_slots, views);
if (shader == PIPE_SHADER_FRAGMENT) {
fd5_ctx->fastc_srgb = astc_srgb;
}
static void set_sampler_views(struct fd_texture_stateobj *tex,
- unsigned start, unsigned nr, struct pipe_sampler_view **views)
+ unsigned start, unsigned nr,
+ unsigned unbind_num_trailing_slots,
+ struct pipe_sampler_view **views)
{
unsigned i;
unsigned samplers = 0;
tex->valid_textures &= ~(1 << p);
}
}
+ for (; i < nr + unbind_num_trailing_slots; i++) {
+ unsigned p = i + start;
+ pipe_sampler_view_reference(&tex->textures[p], NULL);
+ tex->valid_textures &= ~(1 << p);
+ }
tex->num_textures = util_last_bit(tex->valid_textures);
void
fd_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
- unsigned start, unsigned nr,
+ unsigned start, unsigned nr, unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct fd_context *ctx = fd_context(pctx);
- set_sampler_views(&ctx->tex[shader], start, nr, views);
+ set_sampler_views(&ctx->tex[shader], start, nr, unbind_num_trailing_slots, views);
ctx->dirty_shader[shader] |= FD_DIRTY_SHADER_TEX;
ctx->dirty |= FD_DIRTY_TEX;
}
void fd_set_sampler_views(struct pipe_context *pctx,
enum pipe_shader_type shader,
unsigned start, unsigned nr,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views);
void fd_texture_init(struct pipe_context *pctx);
assert(num <= PIPE_MAX_SAMPLERS);
/* Check for no-op */
- if (num == i915->num_fragment_sampler_views &&
+ if (views && num == i915->num_fragment_sampler_views &&
!memcmp(i915->fragment_sampler_views, views, num * sizeof(struct pipe_sampler_view *)))
return;
assert(num <= ARRAY_SIZE(i915->vertex_sampler_views));
/* Check for no-op */
- if (num == i915->num_vertex_sampler_views &&
+ if (views && num == i915->num_vertex_sampler_views &&
!memcmp(i915->vertex_sampler_views, views, num * sizeof(struct pipe_sampler_view *))) {
return;
}
static void
i915_set_sampler_views(struct pipe_context *pipe, enum pipe_shader_type shader,
- unsigned start, unsigned num,
+ unsigned start, unsigned num, unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
assert(start == 0);
iris_set_sampler_views(struct pipe_context *ctx,
enum pipe_shader_type p_stage,
unsigned start, unsigned count,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct iris_context *ice = (struct iris_context *) ctx;
gl_shader_stage stage = stage_from_pipe(p_stage);
struct iris_shader_state *shs = &ice->state.shaders[stage];
+ unsigned i;
shs->bound_sampler_views &= ~u_bit_consecutive(start, count);
- for (unsigned i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
struct pipe_sampler_view *pview = views ? views[i] : NULL;
pipe_sampler_view_reference((struct pipe_sampler_view **)
&shs->textures[start + i], pview);
&view->surface_state, view->res->bo);
}
}
+ for (; i < count + unbind_num_trailing_slots; i++) {
+ pipe_sampler_view_reference((struct pipe_sampler_view **)
+ &shs->textures[start + i], NULL);
+ }
ice->state.stage_dirty |= (IRIS_STAGE_DIRTY_BINDINGS_VS << stage);
ice->state.dirty |=
lima_set_sampler_views(struct pipe_context *pctx,
enum pipe_shader_type shader,
unsigned start, unsigned nr,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct lima_context *ctx = lima_context(pctx);
enum pipe_shader_type shader,
unsigned start,
unsigned num,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
view);
}
+ for (; i < num + unbind_num_trailing_slots; i++) {
+ pipe_sampler_view_reference(&llvmpipe->sampler_views[shader][start + i],
+ NULL);
+ }
+
/* find highest non-null sampler_views[] entry */
{
unsigned j = MAX2(llvmpipe->num_sampler_views[shader], start + num);
static void
nv30_set_sampler_views(struct pipe_context *pipe, enum pipe_shader_type shader,
unsigned start, unsigned nr,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
assert(start == 0);
static void
nv50_set_sampler_views(struct pipe_context *pipe, enum pipe_shader_type shader,
unsigned start, unsigned nr,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
assert(start == 0);
static void
nvc0_set_sampler_views(struct pipe_context *pipe, enum pipe_shader_type shader,
unsigned start, unsigned nr,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
const unsigned s = nvc0_shader_stage(shader);
struct pipe_context *pctx,
enum pipe_shader_type shader,
unsigned start_slot, unsigned num_views,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct panfrost_context *ctx = pan_context(pctx);
static void r300_set_sampler_views(struct pipe_context* pipe,
enum pipe_shader_type shader,
unsigned start, unsigned count,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view** views)
{
struct r300_context* r300 = r300_context(pipe);
static void r600_set_sampler_views(struct pipe_context *pipe,
enum pipe_shader_type shader,
unsigned start, unsigned count,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct r600_context *rctx = (struct r600_context *) pipe;
}
static void si_set_sampler_views(struct pipe_context *ctx, enum pipe_shader_type shader,
- unsigned start, unsigned count, struct pipe_sampler_view **views)
+ unsigned start, unsigned count,
+ unsigned unbind_num_trailing_slots,
+ struct pipe_sampler_view **views)
{
struct si_context *sctx = (struct si_context *)ctx;
int i;
- if (!count || shader >= SI_NUM_SHADERS)
+ if ((!count && !unbind_num_trailing_slots) || shader >= SI_NUM_SHADERS)
return;
if (views) {
si_set_sampler_view(sctx, shader, start + i, NULL, false);
}
+ for (; i < count + unbind_num_trailing_slots; i++)
+ si_set_sampler_view(sctx, shader, start + i, NULL, false);
+
si_update_shader_needs_decompress_mask(sctx, shader);
}
enum pipe_shader_type shader,
unsigned start,
unsigned num,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views);
/* sampler view state */
softpipe_set_sampler_views(&softpipe->pipe, PIPE_SHADER_FRAGMENT,
- unit, 1, &softpipe->pstipple.sampler_view);
+ unit, 1, 0, &softpipe->pstipple.sampler_view);
softpipe->dirty |= SP_NEW_SAMPLER;
}
enum pipe_shader_type shader,
unsigned start,
unsigned num,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
memset(sp_sviewdst, 0, sizeof(*sp_sviewsrc));
}
}
+ for (; i < num + unbind_num_trailing_slots; i++) {
+ struct pipe_sampler_view **pview = &softpipe->sampler_views[shader][start + i];
+ pipe_sampler_view_reference(pview, NULL);
+ sp_tex_tile_cache_set_sampler_view(softpipe->tex_cache[shader][start + i],
+ NULL);
+ }
/* find highest non-null sampler_views[] entry */
enum pipe_shader_type shader,
unsigned start,
unsigned num,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct svga_context *svga = svga_context(pipe);
}
}
+ for (; i < num + unbind_num_trailing_slots; i++) {
+ if (svga->curr.sampler_views[shader][start + i]) {
+ pipe_sampler_view_reference(&svga->curr.sampler_views[shader][start + i],
+ NULL);
+ any_change = TRUE;
+ }
+ }
+
if (!any_change) {
goto done;
}
enum pipe_shader_type shader,
unsigned start,
unsigned num,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct swr_context *ctx = swr_context(pipe);
pipe_sampler_view_reference(&ctx->sampler_views[shader][start + i],
views[i]);
}
+ for (; i < num + unbind_num_trailing_slots; i++) {
+ pipe_sampler_view_reference(&ctx->sampler_views[shader][start + i],
+ NULL);
+ }
ctx->dirty |= SWR_NEW_SAMPLER_VIEW;
}
static void
tegra_set_sampler_views(struct pipe_context *pcontext, unsigned shader,
unsigned start_slot, unsigned num_views,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **pviews)
{
struct pipe_sampler_view *views[PIPE_MAX_SHADER_SAMPLER_VIEWS];
views[i] = tegra_sampler_view_unwrap(pviews[i]);
context->gpu->set_sampler_views(context->gpu, shader, start_slot,
- num_views, views);
+ num_views, unbind_num_trailing_slots,
+ views);
}
static void
v3d_set_sampler_views(struct pipe_context *pctx,
enum pipe_shader_type shader,
unsigned start, unsigned nr,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct v3d_context *v3d = v3d_context(pctx);
/* Unbind the textures, to make sure we don't try to recurse into the
* shadow blit.
*/
- pctx->set_sampler_views(pctx, PIPE_SHADER_FRAGMENT, 0, 0, NULL);
+ pctx->set_sampler_views(pctx, PIPE_SHADER_FRAGMENT, 0, 0, 0, NULL);
pctx->bind_sampler_states(pctx, PIPE_SHADER_FRAGMENT, 0, 0, NULL);
util_blitter_custom_shader(vc4->blitter, dst_surf,
vc4_set_sampler_views(struct pipe_context *pctx,
enum pipe_shader_type shader,
unsigned start, unsigned nr,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct vc4_context *vc4 = vc4_context(pctx);
enum pipe_shader_type shader_type,
unsigned start_slot,
unsigned num_views,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct virgl_context *vctx = virgl_context(ctx);
virgl_encode_set_sampler_views(vctx, shader_type,
start_slot, num_views, (struct virgl_sampler_view **)binding->views);
virgl_attach_res_sampler_views(vctx, shader_type);
+
+ if (unbind_num_trailing_slots) {
+ virgl_set_sampler_views(ctx, shader_type, start_slot + num_views,
+ unbind_num_trailing_slots, 0, NULL);
+ }
}
static void
enum pipe_shader_type shader_type,
unsigned start_slot,
unsigned num_views,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views)
{
struct zink_context *ctx = zink_context(pctx);
- for (unsigned i = 0; i < num_views; ++i) {
+ unsigned i;
+
+ for (i = 0; i < num_views; ++i) {
struct pipe_sampler_view *pview = views ? views[i] : NULL;
pipe_sampler_view_reference(
&ctx->sampler_views[shader_type][start_slot + i],
pview);
}
+ for (; i < num_views + unbind_num_trailing_slots; ++i) {
+ pipe_sampler_view_reference(
+ &ctx->sampler_views[shader_type][start_slot + i],
+ NULL);
+ }
ctx->num_sampler_views[shader_type] = start_slot + num_views;
}
exec.samplers.data());
q.pipe->set_sampler_views(q.pipe, PIPE_SHADER_COMPUTE, 0,
- exec.sviews.size(), exec.sviews.data());
+ exec.sviews.size(), 0, exec.sviews.data());
q.pipe->set_shader_images(q.pipe, PIPE_SHADER_COMPUTE, 0,
exec.iviews.size(), 0, exec.iviews.data());
q.pipe->set_compute_resources(q.pipe, 0, exec.resources.size(),
q.pipe->set_shader_images(q.pipe, PIPE_SHADER_COMPUTE, 0,
0, exec.iviews.size(), NULL);
q.pipe->set_sampler_views(q.pipe, PIPE_SHADER_COMPUTE, 0,
- exec.sviews.size(), NULL);
+ 0, exec.sviews.size(), NULL);
q.pipe->bind_sampler_states(q.pipe, PIPE_SHADER_COMPUTE, 0,
exec.samplers.size(), NULL);
if (state->sv_dirty[PIPE_SHADER_COMPUTE]) {
state->pctx->set_sampler_views(state->pctx, PIPE_SHADER_COMPUTE, 0, state->num_sampler_views[PIPE_SHADER_COMPUTE],
- state->sv[PIPE_SHADER_COMPUTE]);
+ 0, state->sv[PIPE_SHADER_COMPUTE]);
state->sv_dirty[PIPE_SHADER_COMPUTE] = false;
}
continue;
state->pctx->set_sampler_views(state->pctx, sh, 0, state->num_sampler_views[sh],
- state->sv[sh]);
+ 0, state->sv[sh]);
state->sv_dirty[sh] = false;
}
context->bound_samplers_mask_ps |= (1 << s);
}
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num_textures, view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num_textures, 0, view);
if (commit_samplers)
cso_single_sampler_done(context->cso, PIPE_SHADER_FRAGMENT);
context->bound_samplers_mask_vs |= (1 << i);
}
- pipe->set_sampler_views(pipe, PIPE_SHADER_VERTEX, 0, num_textures, view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_VERTEX, 0, num_textures, 0, view);
if (commit_samplers)
cso_single_sampler_done(context->cso, PIPE_SHADER_VERTEX);
cso_set_samplers(cso, PIPE_SHADER_VERTEX, 0, NULL);
cso_set_samplers(cso, PIPE_SHADER_FRAGMENT, 0, NULL);
- pipe->set_sampler_views(pipe, PIPE_SHADER_VERTEX, 0, NINE_MAX_SAMPLERS_VS, NULL);
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, NINE_MAX_SAMPLERS_PS, NULL);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_VERTEX, 0, 0, NINE_MAX_SAMPLERS_VS, NULL);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 0, NINE_MAX_SAMPLERS_PS, NULL);
pipe->set_vertex_buffers(pipe, 0, 0, device->caps.MaxStreams, NULL);
cso_set_samplers(ctx->cso, PIPE_SHADER_FRAGMENT, num_samplers,
(const struct pipe_sampler_state **)samplers);
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num_samplers,
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num_samplers, 0,
ctx->bound_sampler_views);
ctx->num_bound_samplers = num_samplers;
}
renderer_bind_destination(ctx, ctx->srf);
bind_solid_blend_state(ctx);
cso_set_samplers(ctx->cso, PIPE_SHADER_FRAGMENT, 0, NULL);
- ctx->pipe->set_sampler_views(ctx->pipe, PIPE_SHADER_FRAGMENT, 0, XA_MAX_SAMPLERS, NULL);
+ ctx->pipe->set_sampler_views(ctx->pipe, PIPE_SHADER_FRAGMENT, 0, 0, XA_MAX_SAMPLERS, NULL);
shader = xa_shaders_get(ctx->shaders, vs_traits, fs_traits);
cso_set_vertex_shader_handle(ctx->cso, shader.vs);
u_sampler_view_default_template(&templ,
src_texture, src_texture->format);
src_view = pipe->create_sampler_view(pipe, src_texture, &templ);
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &src_view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, &src_view);
pipe_sampler_view_reference(&src_view, NULL);
}
}
r->num_bound_samplers = 3;
cso_set_samplers(r->cso, PIPE_SHADER_FRAGMENT, 3, (const struct pipe_sampler_state **)samplers);
- r->pipe->set_sampler_views(r->pipe, PIPE_SHADER_FRAGMENT, 0, 3, r->bound_sampler_views);
+ r->pipe->set_sampler_views(r->pipe, PIPE_SHADER_FRAGMENT, 0, 3, 0, r->bound_sampler_views);
}
static void
void (*set_sampler_views)(struct pipe_context *,
enum pipe_shader_type shader,
unsigned start_slot, unsigned num_views,
+ unsigned unbind_num_trailing_slots,
struct pipe_sampler_view **views);
void (*set_tess_state)(struct pipe_context *,
if (sv == NULL)
exit(5);
- ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
memset(&sampler_desc, 0, sizeof sampler_desc);
if (sv == NULL)
exit(5);
- ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
memset(&sampler_desc, 0, sizeof sampler_desc);
if (sv == NULL)
exit(5);
- ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
memset(&sampler_desc, 0, sizeof sampler_desc);
PIPE_FORMAT_B8G8R8A8_UNORM, tex2d);
sv = graw_util_create_simple_sampler_view(&info, texture);
- info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv);
+ info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
sampler = graw_util_create_simple_sampler(&info,
PIPE_TEX_WRAP_REPEAT,
info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0);
- info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, &linear_sv);
+ info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &linear_sv);
set_vertices(vertices1, 4);
util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4);
- info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, &srgb_sv);
+ info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &srgb_sv);
set_vertices(vertices2, 4);
util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4);
if (sv == NULL)
exit(5);
- info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv);
+ info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
sampler = graw_util_create_simple_sampler(&info,
PIPE_TEX_WRAP_REPEAT,
if (sv == NULL)
exit(5);
- ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
memset(&sampler_desc, 0, sizeof sampler_desc);
assert(ctx->view[i]);
}
- pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, i, ctx->view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, i, 0, ctx->view);
}
static void destroy_sampler_views(struct context *ctx)
struct pipe_context *pipe = ctx->pipe;
int i;
- pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, MAX_RESOURCES, NULL);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, 0, MAX_RESOURCES, NULL);
for (i = 0; i < MAX_RESOURCES; ++i) {
if (ctx->view[i]) {
cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 1, samplers);
/* texture sampler view */
- p->pipe->set_sampler_views(p->pipe, PIPE_SHADER_FRAGMENT, 0, 1, &p->view);
+ p->pipe->set_sampler_views(p->pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, &p->view);
/* shaders */
cso_set_fragment_shader_handle(p->cso, p->fs);
for (unsigned i = 0; i < num_unbind; i++)
pipe_sampler_view_reference(&sampler_views[num_textures + i], NULL);
- pipe->set_sampler_views(pipe, shader_stage, 0, num_textures + num_unbind,
+ pipe->set_sampler_views(pipe, shader_stage, 0, num_textures, num_unbind,
sampler_views);
st->state.num_sampler_views[shader_stage] = num_textures;
}
memcpy(sampler_views, st->state.frag_sampler_views,
sizeof(sampler_views));
sampler_views[fpv->bitmap_sampler] = sv;
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num, sampler_views);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num, 0,
+ sampler_views);
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT] =
MAX2(st->state.num_sampler_views[PIPE_SHADER_FRAGMENT], num);
}
/* Unbind all because st/mesa won't do it if the current shader doesn't
* use them.
*/
- static struct pipe_sampler_view *null[PIPE_MAX_SAMPLERS];
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 0,
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT],
- null);
+ NULL);
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT] = 0;
st->dirty |= ST_NEW_VERTEX_ARRAYS |
sampler_views[fpv->drawpix_sampler] = sv[0];
if (sv[1])
sampler_views[fpv->pixelmap_sampler] = sv[1];
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num, sampler_views);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num, 0,
+ sampler_views);
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT] =
MAX2(st->state.num_sampler_views[PIPE_SHADER_FRAGMENT], num);
} else {
/* drawing a depth/stencil image */
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num_sampler_view, sv);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num_sampler_view,
+ 0, sv);
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT] =
MAX2(st->state.num_sampler_views[PIPE_SHADER_FRAGMENT], num_sampler_view);
}
/* Unbind all because st/mesa won't do it if the current shader doesn't
* use them.
*/
- static struct pipe_sampler_view *null[PIPE_MAX_SAMPLERS];
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 0,
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT],
- null);
+ NULL);
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT] = 0;
st->dirty |= ST_NEW_VERTEX_ARRAYS |
if (sampler_view == NULL)
goto fail;
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &sampler_view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0,
+ &sampler_view);
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT] =
MAX2(st->state.num_sampler_views[PIPE_SHADER_FRAGMENT], 1);
/* Unbind all because st/mesa won't do it if the current shader doesn't
* use them.
*/
- static struct pipe_sampler_view *null[PIPE_MAX_SAMPLERS];
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 0,
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT],
- null);
+ NULL);
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT] = 0;
pipe->set_shader_images(pipe, PIPE_SHADER_FRAGMENT, 0, 0, 1, NULL);
if (sampler_view == NULL)
goto fail;
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &sampler_view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0,
+ &sampler_view);
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT] =
MAX2(st->state.num_sampler_views[PIPE_SHADER_FRAGMENT], 1);
/* Unbind all because st/mesa won't do it if the current shader doesn't
* use them.
*/
- static struct pipe_sampler_view *null[PIPE_MAX_SAMPLERS];
- pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 0,
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT],
- null);
+ NULL);
st->state.num_sampler_views[PIPE_SHADER_FRAGMENT] = 0;
st->dirty |= ST_NEW_VERTEX_ARRAYS |