On Tue, Apr 19, 2016 at 10:09 AM, Ilia Mirkin <imir...@alum.mit.edu> wrote: > atic void >> +fd4_set_sampler_views(struct pipe_context *pctx, unsigned shader, >> + unsigned start, unsigned nr, >> + struct pipe_sampler_view **views) >> +{ >> + struct fd_context *ctx = fd_context(pctx); >> + struct fd4_context *fd4_ctx = fd4_context(ctx); >> + uint16_t lower_srgb = 0; >> + unsigned i; >> + >> + for (i = 0; i < nr; i++) { >> + if (views[i]) { >> + struct fd4_pipe_sampler_view *view = >> + fd4_pipe_sampler_view(views[i]); >> + if (view->lower_srgb) >> + lower_srgb |= (1 << i); >> + } >> + } >> + >> + fd_set_sampler_views(pctx, shader, start, nr, views); >> + >> + if (shader == PIPE_SHADER_FRAGMENT) { >> + fd4_ctx->flower_srgb = lower_srgb; >> + } else if (shader == PIPE_SHADER_VERTEX) { >> + fd4_ctx->vlower_srgb = lower_srgb; >> + } > > I think you want something a bit more complex... the API allows start > != 0, and nr != 16. So you need to mask out the relevant bits, and > shift lower_srgb into the right spot.
api does.. but implementation does not.. no idea why the start param is passed in, but we assert(start==0) for both sampler states and views (where we do a similar thing).. a3ed98f seems to indicate that start is expected to be zero. I guess we'll have to fix that up in a number of places eventually but it at least shouldn't be a problem right now. BR, -R _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev