boolean has_geometry_shader;
boolean has_streamout;
- struct sampler_info fragment_samplers;
- struct sampler_info vertex_samplers;
+ struct sampler_info samplers[PIPE_SHADER_TYPES];
uint nr_vertex_buffers;
struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS];
*/
void cso_release_all( struct cso_context *ctx )
{
- unsigned i;
- struct sampler_info *info;
+ unsigned i, shader;
if (ctx->pipe) {
ctx->pipe->bind_blend_state( ctx->pipe, NULL );
}
/* free fragment samplers, views */
- info = &ctx->fragment_samplers;
- for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
- pipe_sampler_view_reference(&info->views[i], NULL);
- pipe_sampler_view_reference(&info->views_saved[i], NULL);
- }
-
- /* free vertex samplers, views */
- info = &ctx->vertex_samplers;
- for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
- pipe_sampler_view_reference(&info->views[i], NULL);
- pipe_sampler_view_reference(&info->views_saved[i], NULL);
+ for (shader = 0; shader < Elements(ctx->samplers); shader++) {
+ struct sampler_info *info = &ctx->samplers[shader];
+ for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+ pipe_sampler_view_reference(&info->views[i], NULL);
+ pipe_sampler_view_reference(&info->views_saved[i], NULL);
+ }
}
util_unreference_framebuffer_state(&ctx->fb);
enum pipe_error
cso_single_sampler(struct cso_context *ctx,
+ unsigned shader_stage,
unsigned idx,
const struct pipe_sampler_state *templ)
{
- return single_sampler(ctx, &ctx->fragment_samplers, idx, templ);
-}
-
-enum pipe_error
-cso_single_vertex_sampler(struct cso_context *ctx,
- unsigned idx,
- const struct pipe_sampler_state *templ)
-{
- return single_sampler(ctx, &ctx->vertex_samplers, idx, templ);
+ return single_sampler(ctx, &ctx->samplers[shader_stage], idx, templ);
}
static void
-single_sampler_done(struct cso_context *ctx,
- struct sampler_info *info)
+single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
{
+ struct sampler_info *info = &ctx->samplers[shader_stage];
unsigned i;
/* find highest non-null sampler */
info->nr_samplers * sizeof(void *));
info->hw.nr_samplers = info->nr_samplers;
- if (info == &ctx->fragment_samplers) {
+ switch (shader_stage) {
+ case PIPE_SHADER_FRAGMENT:
ctx->pipe->bind_fragment_sampler_states(ctx->pipe,
info->nr_samplers,
info->samplers);
- }
- else if (info == &ctx->vertex_samplers) {
+ break;
+ case PIPE_SHADER_VERTEX:
ctx->pipe->bind_vertex_sampler_states(ctx->pipe,
info->nr_samplers,
info->samplers);
- }
- else {
- assert(0);
+ break;
+ case PIPE_SHADER_GEOMETRY:
+ ctx->pipe->bind_geometry_sampler_states(ctx->pipe,
+ info->nr_samplers,
+ info->samplers);
+ break;
+ default:
+ assert(!"bad shader type in single_sampler_done()");
}
}
}
void
-cso_single_sampler_done( struct cso_context *ctx )
-{
- single_sampler_done(ctx, &ctx->fragment_samplers);
-}
-
-void
-cso_single_vertex_sampler_done(struct cso_context *ctx)
+cso_single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
{
- single_sampler_done(ctx, &ctx->vertex_samplers);
+ single_sampler_done(ctx, shader_stage);
}
* last one. Done to always try to set as many samplers
* as possible.
*/
-static enum pipe_error
-set_samplers(struct cso_context *ctx,
- struct sampler_info *info,
- unsigned nr,
- const struct pipe_sampler_state **templates)
+enum pipe_error
+cso_set_samplers(struct cso_context *ctx,
+ unsigned shader_stage,
+ unsigned nr,
+ const struct pipe_sampler_state **templates)
{
+ struct sampler_info *info = &ctx->samplers[shader_stage];
unsigned i;
enum pipe_error temp, error = PIPE_OK;
error = temp;
}
- single_sampler_done(ctx, info);
+ single_sampler_done(ctx, shader_stage);
return error;
}
-enum pipe_error
-cso_set_samplers(struct cso_context *ctx,
- unsigned nr,
- const struct pipe_sampler_state **templates)
-{
- return set_samplers(ctx, &ctx->fragment_samplers, nr, templates);
-}
-
-enum pipe_error
-cso_set_vertex_samplers(struct cso_context *ctx,
- unsigned nr,
- const struct pipe_sampler_state **templates)
-{
- return set_samplers(ctx, &ctx->vertex_samplers, nr, templates);
-}
-
-
-
-static void
-save_samplers(struct cso_context *ctx, struct sampler_info *info)
+void
+cso_save_samplers(struct cso_context *ctx, unsigned shader_stage)
{
+ struct sampler_info *info = &ctx->samplers[shader_stage];
info->nr_samplers_saved = info->nr_samplers;
memcpy(info->samplers_saved, info->samplers, sizeof(info->samplers));
}
-void
-cso_save_samplers(struct cso_context *ctx)
-{
- save_samplers(ctx, &ctx->fragment_samplers);
-}
void
-cso_save_vertex_samplers(struct cso_context *ctx)
-{
- save_samplers(ctx, &ctx->vertex_samplers);
-}
-
-
-
-static void
-restore_samplers(struct cso_context *ctx, struct sampler_info *info)
+cso_restore_samplers(struct cso_context *ctx, unsigned shader_stage)
{
+ struct sampler_info *info = &ctx->samplers[shader_stage];
info->nr_samplers = info->nr_samplers_saved;
memcpy(info->samplers, info->samplers_saved, sizeof(info->samplers));
- single_sampler_done(ctx, info);
+ single_sampler_done(ctx, shader_stage);
}
-void
-cso_restore_samplers(struct cso_context *ctx)
-{
- restore_samplers(ctx, &ctx->fragment_samplers);
-}
void
-cso_restore_vertex_samplers(struct cso_context *ctx)
+cso_set_sampler_views(struct cso_context *ctx,
+ unsigned shader_stage,
+ unsigned count,
+ struct pipe_sampler_view **views)
{
- restore_samplers(ctx, &ctx->vertex_samplers);
-}
-
-
-
-static void
-set_sampler_views(struct cso_context *ctx,
- struct sampler_info *info,
- void (*set_views)(struct pipe_context *,
- unsigned num_views,
- struct pipe_sampler_view **),
- uint count,
- struct pipe_sampler_view **views)
-{
- uint i;
+ struct sampler_info *info = &ctx->samplers[shader_stage];
+ unsigned i;
/* reference new views */
for (i = 0; i < count; i++) {
info->nr_views = count;
/* bind the new sampler views */
- set_views(ctx->pipe, count, info->views);
+ switch (shader_stage) {
+ case PIPE_SHADER_FRAGMENT:
+ ctx->pipe->set_fragment_sampler_views(ctx->pipe, count, info->views);
+ break;
+ case PIPE_SHADER_VERTEX:
+ ctx->pipe->set_vertex_sampler_views(ctx->pipe, count, info->views);
+ break;
+ case PIPE_SHADER_GEOMETRY:
+ ctx->pipe->set_geometry_sampler_views(ctx->pipe, count, info->views);
+ break;
+ default:
+ assert(!"bad shader type in cso_set_sampler_views()");
+ }
}
-void
-cso_set_fragment_sampler_views(struct cso_context *ctx,
- uint count,
- struct pipe_sampler_view **views)
-{
- set_sampler_views(ctx, &ctx->fragment_samplers,
- ctx->pipe->set_fragment_sampler_views,
- count, views);
-}
void
-cso_set_vertex_sampler_views(struct cso_context *ctx,
- uint count,
- struct pipe_sampler_view **views)
-{
- set_sampler_views(ctx, &ctx->vertex_samplers,
- ctx->pipe->set_vertex_sampler_views,
- count, views);
-}
-
-
-
-static void
-save_sampler_views(struct cso_context *ctx,
- struct sampler_info *info)
+cso_save_sampler_views(struct cso_context *ctx, unsigned shader_stage)
{
- uint i;
+ struct sampler_info *info = &ctx->samplers[shader_stage];
+ unsigned i;
info->nr_views_saved = info->nr_views;
}
}
-void
-cso_save_fragment_sampler_views(struct cso_context *ctx)
-{
- save_sampler_views(ctx, &ctx->fragment_samplers);
-}
void
-cso_save_vertex_sampler_views(struct cso_context *ctx)
+cso_restore_sampler_views(struct cso_context *ctx, unsigned shader_stage)
{
- save_sampler_views(ctx, &ctx->vertex_samplers);
-}
+ struct sampler_info *info = &ctx->samplers[shader_stage];
+ unsigned i, nr_saved = info->nr_views_saved;
-
-static void
-restore_sampler_views(struct cso_context *ctx,
- struct sampler_info *info,
- void (*set_views)(struct pipe_context *,
- unsigned num_views,
- struct pipe_sampler_view **))
-{
- uint i;
-
- for (i = 0; i < info->nr_views_saved; i++) {
+ for (i = 0; i < nr_saved; i++) {
pipe_sampler_view_reference(&info->views[i], NULL);
/* move the reference from one pointer to another */
info->views[i] = info->views_saved[i];
}
/* bind the old/saved sampler views */
- set_views(ctx->pipe, info->nr_views_saved, info->views);
+ switch (shader_stage) {
+ case PIPE_SHADER_FRAGMENT:
+ ctx->pipe->set_fragment_sampler_views(ctx->pipe, nr_saved, info->views);
+ break;
+ case PIPE_SHADER_VERTEX:
+ ctx->pipe->set_vertex_sampler_views(ctx->pipe, nr_saved, info->views);
+ break;
+ case PIPE_SHADER_GEOMETRY:
+ ctx->pipe->set_geometry_sampler_views(ctx->pipe, nr_saved, info->views);
+ break;
+ default:
+ assert(!"bad shader type in cso_restore_sampler_views()");
+ }
- info->nr_views = info->nr_views_saved;
+ info->nr_views = nr_saved;
info->nr_views_saved = 0;
}
-void
-cso_restore_fragment_sampler_views(struct cso_context *ctx)
-{
- restore_sampler_views(ctx, &ctx->fragment_samplers,
- ctx->pipe->set_fragment_sampler_views);
-}
-
-void
-cso_restore_vertex_sampler_views(struct cso_context *ctx)
-{
- restore_sampler_views(ctx, &ctx->vertex_samplers,
- ctx->pipe->set_vertex_sampler_views);
-}
-
void
cso_set_stream_outputs(struct cso_context *ctx,
void cso_restore_rasterizer(struct cso_context *cso);
-
-enum pipe_error cso_set_samplers( struct cso_context *cso,
- unsigned count,
- const struct pipe_sampler_state **states );
-void cso_save_samplers(struct cso_context *cso);
-void cso_restore_samplers(struct cso_context *cso);
-
-/* Alternate interface to support state trackers that like to modify
- * samplers one at a time:
- */
-enum pipe_error cso_single_sampler( struct cso_context *cso,
- unsigned nr,
- const struct pipe_sampler_state *states );
-
-void cso_single_sampler_done( struct cso_context *cso );
-
-enum pipe_error cso_set_vertex_samplers(struct cso_context *cso,
- unsigned count,
- const struct pipe_sampler_state **states);
+enum pipe_error
+cso_set_samplers(struct cso_context *cso,
+ unsigned shader_stage,
+ unsigned count,
+ const struct pipe_sampler_state **states);
void
-cso_save_vertex_samplers(struct cso_context *cso);
+cso_save_samplers(struct cso_context *cso, unsigned shader_stage);
void
-cso_restore_vertex_samplers(struct cso_context *cso);
+cso_restore_samplers(struct cso_context *cso, unsigned shader_stage);
+/* Alternate interface to support state trackers that like to modify
+ * samplers one at a time:
+ */
enum pipe_error
-cso_single_vertex_sampler(struct cso_context *cso,
- unsigned nr,
- const struct pipe_sampler_state *states);
+cso_single_sampler(struct cso_context *cso,
+ unsigned shader_stage,
+ unsigned count,
+ const struct pipe_sampler_state *states);
void
-cso_single_vertex_sampler_done(struct cso_context *cso);
+cso_single_sampler_done(struct cso_context *cso, unsigned shader_stage);
enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
void cso_restore_stream_outputs(struct cso_context *ctx);
+/*
+ * We don't provide shader caching in CSO. Most of the time the api provides
+ * object semantics for shaders anyway, and the cases where it doesn't
+ * (eg mesa's internally-generated texenv programs), it will be up to
+ * the state tracker to implement their own specialized caching.
+ */
+
enum pipe_error cso_set_fragment_shader_handle(struct cso_context *ctx,
void *handle );
void cso_delete_fragment_shader(struct cso_context *ctx, void *handle );
cso_restore_clip(struct cso_context *cso);
-/* fragment sampler view state */
-
-/*
- * We don't provide shader caching in CSO. Most of the time the api provides
- * object semantics for shaders anyway, and the cases where it doesn't
- * (eg mesa's internally-generated texenv programs), it will be up to
- * the state tracker to implement their own specialized caching.
- */
-
-void
-cso_set_fragment_sampler_views(struct cso_context *cso,
- uint count,
- struct pipe_sampler_view **views);
+/* sampler view state */
void
-cso_save_fragment_sampler_views(struct cso_context *cso);
+cso_set_sampler_views(struct cso_context *cso,
+ unsigned shader_stage,
+ unsigned count,
+ struct pipe_sampler_view **views);
void
-cso_restore_fragment_sampler_views(struct cso_context *cso);
-
-
-/* vertex sampler view state */
+cso_save_sampler_views(struct cso_context *cso, unsigned shader_stage);
void
-cso_set_vertex_sampler_views(struct cso_context *cso,
- uint count,
- struct pipe_sampler_view **views);
+cso_restore_sampler_views(struct cso_context *cso, unsigned shader_stage);
-void
-cso_save_vertex_sampler_views(struct cso_context *cso);
-void
-cso_restore_vertex_sampler_views(struct cso_context *cso);
/* drawing */
pp_filter_set_fb(p);
pp_filter_misc_state(p);
- cso_single_sampler(p->cso, 0, &p->sampler_point);
- cso_single_sampler_done(p->cso);
- cso_set_fragment_sampler_views(p->cso, 1, &p->view);
+ cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 0, &p->sampler_point);
+ cso_single_sampler_done(p->cso, PIPE_SHADER_FRAGMENT);
+ cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 1, &p->view);
cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][0]);
cso_set_fragment_shader_handle(p->cso, ppq->shaders[n][1]);
util_destroy_blit(ppq->p->blitctx);
- cso_set_fragment_sampler_views(ppq->p->cso, 0, NULL);
+ cso_set_sampler_views(ppq->p->cso, PIPE_SHADER_FRAGMENT, 0, NULL);
cso_release_all(ppq->p->cso);
for (i = 0; i < ppq->n_filters; i++) {
p->pipe->clear(p->pipe, PIPE_CLEAR_STENCIL | PIPE_CLEAR_COLOR,
&p->clear_color, 0, 0);
- cso_single_sampler(p->cso, 0, &p->sampler_point);
- cso_single_sampler_done(p->cso);
- cso_set_fragment_sampler_views(p->cso, 1, &p->view);
+ cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 0, &p->sampler_point);
+ cso_single_sampler_done(p->cso, PIPE_SHADER_FRAGMENT);
+ cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 1, &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]);
pp_filter_set_clear_fb(p);
- cso_single_sampler(p->cso, 0, &p->sampler_point);
- cso_single_sampler(p->cso, 1, &p->sampler_point);
- cso_single_sampler(p->cso, 2, &p->sampler);
- cso_single_sampler_done(p->cso);
+ cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 0, &p->sampler_point);
+ cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 1, &p->sampler_point);
+ cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 2, &p->sampler);
+ cso_single_sampler_done(p->cso, PIPE_SHADER_FRAGMENT);
arr[0] = p->view;
- cso_set_fragment_sampler_views(p->cso, 3, arr);
+ cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 3, arr);
cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][0]); /* passvs */
cso_set_fragment_shader_handle(p->cso, ppq->shaders[n][3]);
u_sampler_view_default_template(&v_tmp, in, in->format);
arr[0] = p->pipe->create_sampler_view(p->pipe, in, &v_tmp);
- cso_single_sampler(p->cso, 0, &p->sampler_point);
- cso_single_sampler(p->cso, 1, &p->sampler_point);
- cso_single_sampler_done(p->cso);
+ cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 0, &p->sampler_point);
+ cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 1, &p->sampler_point);
+ cso_single_sampler_done(p->cso, PIPE_SHADER_FRAGMENT);
arr[1] = p->view;
- cso_set_fragment_sampler_views(p->cso, 2, arr);
+ cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 2, arr);
cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][1]); /* offsetvs */
cso_set_fragment_shader_handle(p->cso, ppq->shaders[n][4]);
cso_save_blend(ctx->cso);
cso_save_depth_stencil_alpha(ctx->cso);
cso_save_rasterizer(ctx->cso);
- cso_save_samplers(ctx->cso);
- cso_save_fragment_sampler_views(ctx->cso);
+ cso_save_samplers(ctx->cso, PIPE_SHADER_FRAGMENT);
+ cso_save_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT);
cso_save_stream_outputs(ctx->cso);
cso_save_viewport(ctx->cso);
cso_save_framebuffer(ctx->cso);
* we blit.
*/
if (blit_depth && blit_stencil) {
- cso_single_sampler(ctx->cso, 0, &ctx->sampler);
+ cso_single_sampler(ctx->cso, PIPE_SHADER_FRAGMENT, 0, &ctx->sampler);
/* don't filter stencil */
ctx->sampler.min_img_filter = PIPE_TEX_FILTER_NEAREST;
ctx->sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
- cso_single_sampler(ctx->cso, 1, &ctx->sampler);
+ cso_single_sampler(ctx->cso, PIPE_SHADER_FRAGMENT, 1, &ctx->sampler);
cso_set_depth_stencil_alpha(ctx->cso, &ctx->dsa_write_depthstencil);
set_depthstencil_fragment_shader(ctx, sampler_view->texture->target);
}
else if (blit_depth) {
- cso_single_sampler(ctx->cso, 0, &ctx->sampler);
+ cso_single_sampler(ctx->cso, PIPE_SHADER_FRAGMENT, 0, &ctx->sampler);
cso_set_depth_stencil_alpha(ctx->cso, &ctx->dsa_write_depth);
set_depth_fragment_shader(ctx, sampler_view->texture->target);
}
/* don't filter stencil */
ctx->sampler.min_img_filter = PIPE_TEX_FILTER_NEAREST;
ctx->sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
- cso_single_sampler(ctx->cso, 0, &ctx->sampler);
+ cso_single_sampler(ctx->cso, PIPE_SHADER_FRAGMENT, 0, &ctx->sampler);
cso_set_depth_stencil_alpha(ctx->cso, &ctx->dsa_write_stencil);
set_stencil_fragment_shader(ctx, sampler_view->texture->target);
}
else { /* color */
- cso_single_sampler(ctx->cso, 0, &ctx->sampler);
+ cso_single_sampler(ctx->cso, PIPE_SHADER_FRAGMENT, 0, &ctx->sampler);
cso_set_depth_stencil_alpha(ctx->cso, &ctx->dsa_keep_depthstencil);
set_fragment_shader(ctx, writemask, sampler_view->texture->target);
}
- cso_single_sampler_done(ctx->cso);
+ cso_single_sampler_done(ctx->cso, PIPE_SHADER_FRAGMENT);
/* textures */
if (blit_depth && blit_stencil) {
views[0] = sampler_view;
views[1] = pipe->create_sampler_view(pipe, views[0]->texture, &templ);
- cso_set_fragment_sampler_views(ctx->cso, 2, views);
+ cso_set_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT, 2, views);
pipe_sampler_view_reference(&views[1], NULL);
}
else {
- cso_set_fragment_sampler_views(ctx->cso, 1, &sampler_view);
+ cso_set_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT, 1, &sampler_view);
}
/* viewport */
cso_restore_blend(ctx->cso);
cso_restore_depth_stencil_alpha(ctx->cso);
cso_restore_rasterizer(ctx->cso);
- cso_restore_samplers(ctx->cso);
- cso_restore_fragment_sampler_views(ctx->cso);
+ cso_restore_samplers(ctx->cso, PIPE_SHADER_FRAGMENT);
+ cso_restore_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT);
cso_restore_viewport(ctx->cso);
cso_restore_framebuffer(ctx->cso);
cso_restore_fragment_shader(ctx->cso);
cso_save_blend(ctx->cso);
cso_save_depth_stencil_alpha(ctx->cso);
cso_save_rasterizer(ctx->cso);
- cso_save_samplers(ctx->cso);
- cso_save_fragment_sampler_views(ctx->cso);
+ cso_save_samplers(ctx->cso, PIPE_SHADER_FRAGMENT);
+ cso_save_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT);
cso_save_stream_outputs(ctx->cso);
cso_save_viewport(ctx->cso);
cso_save_framebuffer(ctx->cso);
ctx->sampler.normalized_coords = normalized;
ctx->sampler.min_img_filter = filter;
ctx->sampler.mag_img_filter = filter;
- cso_single_sampler(ctx->cso, 0, &ctx->sampler);
- cso_single_sampler_done(ctx->cso);
+ cso_single_sampler(ctx->cso, PIPE_SHADER_FRAGMENT, 0, &ctx->sampler);
+ cso_single_sampler_done(ctx->cso, PIPE_SHADER_FRAGMENT);
/* viewport */
ctx->viewport.scale[0] = 0.5f * dst->width;
cso_set_viewport(ctx->cso, &ctx->viewport);
/* texture */
- cso_set_fragment_sampler_views(ctx->cso, 1, &src_sampler_view);
+ cso_set_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT, 1, &src_sampler_view);
/* shaders */
set_fragment_shader(ctx, TGSI_WRITEMASK_XYZW,
cso_restore_blend(ctx->cso);
cso_restore_depth_stencil_alpha(ctx->cso);
cso_restore_rasterizer(ctx->cso);
- cso_restore_samplers(ctx->cso);
- cso_restore_fragment_sampler_views(ctx->cso);
+ cso_restore_samplers(ctx->cso, PIPE_SHADER_FRAGMENT);
+ cso_restore_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT);
cso_restore_viewport(ctx->cso);
cso_restore_framebuffer(ctx->cso);
cso_restore_fragment_shader(ctx->cso);
cso_save_blend(ctx->cso);
cso_save_depth_stencil_alpha(ctx->cso);
cso_save_rasterizer(ctx->cso);
- cso_save_samplers(ctx->cso);
- cso_save_fragment_sampler_views(ctx->cso);
+ cso_save_samplers(ctx->cso, PIPE_SHADER_FRAGMENT);
+ cso_save_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT);
cso_save_stream_outputs(ctx->cso);
cso_save_framebuffer(ctx->cso);
cso_save_fragment_shader(ctx->cso);
*/
ctx->sampler.min_lod = ctx->sampler.max_lod = (float) srcLevel;
ctx->sampler.lod_bias = (float) srcLevel;
- cso_single_sampler(ctx->cso, 0, &ctx->sampler);
- cso_single_sampler_done(ctx->cso);
+ cso_single_sampler(ctx->cso, PIPE_SHADER_FRAGMENT, 0, &ctx->sampler);
+ cso_single_sampler_done(ctx->cso, PIPE_SHADER_FRAGMENT);
- cso_set_fragment_sampler_views(ctx->cso, 1, &psv);
+ cso_set_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT, 1, &psv);
/* quad coords in clip coords */
offset = set_vertex_data(ctx,
cso_restore_blend(ctx->cso);
cso_restore_depth_stencil_alpha(ctx->cso);
cso_restore_rasterizer(ctx->cso);
- cso_restore_samplers(ctx->cso);
- cso_restore_fragment_sampler_views(ctx->cso);
+ cso_restore_samplers(ctx->cso, PIPE_SHADER_FRAGMENT);
+ cso_restore_sampler_views(ctx->cso, PIPE_SHADER_FRAGMENT);
cso_restore_framebuffer(ctx->cso);
cso_restore_fragment_shader(ctx->cso);
cso_restore_vertex_shader(ctx->cso);
st->state.num_vertex_samplers = su + 1;
- cso_single_vertex_sampler(st->cso_context, su, sampler);
+ cso_single_sampler(st->cso_context, PIPE_SHADER_VERTEX, su, sampler);
} else {
- cso_single_vertex_sampler(st->cso_context, su, NULL);
+ cso_single_sampler(st->cso_context, PIPE_SHADER_VERTEX, su, NULL);
}
}
- cso_single_vertex_sampler_done(st->cso_context);
+ cso_single_sampler_done(st->cso_context, PIPE_SHADER_VERTEX);
}
st->state.num_samplers = su + 1;
/*printf("%s su=%u non-null\n", __FUNCTION__, su);*/
- cso_single_sampler(st->cso_context, su, sampler);
+ cso_single_sampler(st->cso_context, PIPE_SHADER_FRAGMENT, su, sampler);
}
else if (samplers_used != 0 || su < old_max) {
/*printf("%s su=%u null\n", __FUNCTION__, su);*/
- cso_single_sampler(st->cso_context, su, NULL);
+ cso_single_sampler(st->cso_context, PIPE_SHADER_FRAGMENT, su, NULL);
} else {
/* if we've reset all the old views and we have no more new ones */
break;
}
}
- cso_single_sampler_done(st->cso_context);
+ cso_single_sampler_done(st->cso_context, PIPE_SHADER_FRAGMENT);
}
if (ctx->Const.MaxVertexTextureImageUnits > 0) {
GLuint numUnits = MIN2(st->state.num_vertex_textures,
ctx->Const.MaxVertexTextureImageUnits);
- cso_set_vertex_sampler_views(st->cso_context,
- numUnits,
- st->state.sampler_vertex_views);
+ cso_set_sampler_views(st->cso_context,
+ PIPE_SHADER_VERTEX,
+ numUnits,
+ st->state.sampler_vertex_views);
}
}
pipe_sampler_view_reference(&st->state.sampler_views[su], sampler_view);
}
- cso_set_fragment_sampler_views(st->cso_context,
- st->state.num_textures,
- st->state.sampler_views);
+ cso_set_sampler_views(st->cso_context,
+ PIPE_SHADER_FRAGMENT,
+ st->state.num_textures,
+ st->state.sampler_views);
}
assert(height <= (GLsizei)maxSize);
cso_save_rasterizer(cso);
- cso_save_samplers(cso);
- cso_save_fragment_sampler_views(cso);
+ cso_save_samplers(cso, PIPE_SHADER_FRAGMENT);
+ cso_save_sampler_views(cso, PIPE_SHADER_FRAGMENT);
cso_save_viewport(cso);
cso_save_fragment_shader(cso);
cso_save_stream_outputs(cso);
}
samplers[fpv->bitmap_sampler] =
&st->bitmap.samplers[sv->texture->target != PIPE_TEXTURE_RECT];
- cso_set_samplers(cso, num, (const struct pipe_sampler_state **) samplers);
+ cso_set_samplers(cso, PIPE_SHADER_FRAGMENT, num,
+ (const struct pipe_sampler_state **) samplers);
}
/* user textures, plus the bitmap texture */
uint num = MAX2(fpv->bitmap_sampler + 1, st->state.num_textures);
memcpy(sampler_views, st->state.sampler_views, sizeof(sampler_views));
sampler_views[fpv->bitmap_sampler] = sv;
- cso_set_fragment_sampler_views(cso, num, sampler_views);
+ cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, num, sampler_views);
}
/* viewport state: viewport matching window dims */
/* restore state */
cso_restore_rasterizer(cso);
- cso_restore_samplers(cso);
- cso_restore_fragment_sampler_views(cso);
+ cso_restore_samplers(cso, PIPE_SHADER_FRAGMENT);
+ cso_restore_sampler_views(cso, PIPE_SHADER_FRAGMENT);
cso_restore_viewport(cso);
cso_restore_fragment_shader(cso);
cso_restore_vertex_shader(cso);
cso_save_rasterizer(cso);
cso_save_viewport(cso);
- cso_save_samplers(cso);
- cso_save_fragment_sampler_views(cso);
+ cso_save_samplers(cso, PIPE_SHADER_FRAGMENT);
+ cso_save_sampler_views(cso, PIPE_SHADER_FRAGMENT);
cso_save_fragment_shader(cso);
cso_save_stream_outputs(cso);
cso_save_vertex_shader(cso);
sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
sampler.normalized_coords = normalized;
- cso_single_sampler(cso, 0, &sampler);
+ cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, 0, &sampler);
if (num_sampler_view > 1) {
- cso_single_sampler(cso, 1, &sampler);
+ cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, 1, &sampler);
}
- cso_single_sampler_done(cso);
+ cso_single_sampler_done(cso, PIPE_SHADER_FRAGMENT);
}
/* viewport state: viewport matching window dims */
cso_set_stream_outputs(st->cso_context, 0, NULL, 0);
/* texture state: */
- cso_set_fragment_sampler_views(cso, num_sampler_view, sv);
+ cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, num_sampler_view, sv);
/* Compute Gallium window coords (y=0=top) with pixel zoom.
* Recall that these coords are transformed by the current
/* restore state */
cso_restore_rasterizer(cso);
cso_restore_viewport(cso);
- cso_restore_samplers(cso);
- cso_restore_fragment_sampler_views(cso);
+ cso_restore_samplers(cso, PIPE_SHADER_FRAGMENT);
+ cso_restore_sampler_views(cso, PIPE_SHADER_FRAGMENT);
cso_restore_fragment_shader(cso);
cso_restore_vertex_shader(cso);
cso_restore_geometry_shader(cso);