PIPE_SHADER_FRAGMENT,
&ctx->FragmentProgram._Current->Base,
ctx->Const.MaxTextureImageUnits,
- st->state.fragment_samplers,
- &st->state.num_fragment_samplers);
+ st->state.samplers[PIPE_SHADER_FRAGMENT],
+ &st->state.num_samplers[PIPE_SHADER_FRAGMENT]);
update_shader_samplers(st,
PIPE_SHADER_VERTEX,
&ctx->VertexProgram._Current->Base,
ctx->Const.MaxVertexTextureImageUnits,
- st->state.vertex_samplers,
- &st->state.num_vertex_samplers);
+ st->state.samplers[PIPE_SHADER_VERTEX],
+ &st->state.num_samplers[PIPE_SHADER_VERTEX]);
/*
update_shader_samplers(st,
PIPE_SHADER_GEOMETRY,
&ctx->GeometryProgram._Current->Base,
ctx->Const.MaxGeometryTextureImageUnits,
- st->state.geometry_samplers,
- &st->state.num_geometry_samplers);
+ st->state.samplers[PIPE_SHADER_GEOMETRY],
+ &st->state.num_samplers[PIPE_SHADER_GEOMETRY]);
*/
}
PIPE_SHADER_VERTEX,
&ctx->VertexProgram._Current->Base,
ctx->Const.MaxVertexTextureImageUnits,
- st->state.vertex_sampler_views,
- &st->state.num_vertex_textures);
+ st->state.sampler_views[PIPE_SHADER_VERTEX],
+ &st->state.num_sampler_views[PIPE_SHADER_VERTEX]);
}
}
PIPE_SHADER_FRAGMENT,
&ctx->FragmentProgram._Current->Base,
ctx->Const.MaxTextureImageUnits,
- st->state.fragment_sampler_views,
- &st->state.num_fragment_textures);
+ st->state.sampler_views[PIPE_SHADER_FRAGMENT],
+ &st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]);
}
/* user samplers, plus our bitmap sampler */
{
struct pipe_sampler_state *samplers[PIPE_MAX_SAMPLERS];
- uint num = MAX2(fpv->bitmap_sampler + 1, st->state.num_fragment_samplers);
+ uint num = MAX2(fpv->bitmap_sampler + 1,
+ st->state.num_samplers[PIPE_SHADER_FRAGMENT]);
uint i;
- for (i = 0; i < st->state.num_fragment_samplers; i++) {
- samplers[i] = &st->state.fragment_samplers[i];
+ for (i = 0; i < st->state.num_samplers[PIPE_SHADER_FRAGMENT]; i++) {
+ samplers[i] = &st->state.samplers[PIPE_SHADER_FRAGMENT][i];
}
samplers[fpv->bitmap_sampler] =
&st->bitmap.samplers[sv->texture->target != PIPE_TEXTURE_RECT];
{
struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
uint num = MAX2(fpv->bitmap_sampler + 1,
- st->state.num_fragment_textures);
- memcpy(sampler_views, st->state.fragment_sampler_views,
+ st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]);
+ memcpy(sampler_views, st->state.sampler_views[PIPE_SHADER_FRAGMENT],
sizeof(sampler_views));
sampler_views[fpv->bitmap_sampler] = sv;
cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, num, sampler_views);
static void st_destroy_context_priv( struct st_context *st )
{
- uint i;
+ uint shader, i;
st_destroy_atoms( st );
st_destroy_draw( st );
st_destroy_drawpix(st);
st_destroy_drawtex(st);
- for (i = 0; i < Elements(st->state.fragment_sampler_views); i++) {
- pipe_sampler_view_release(st->pipe,
- &st->state.fragment_sampler_views[i]);
- }
-
- for (i = 0; i < Elements(st->state.vertex_sampler_views); i++) {
- pipe_sampler_view_release(st->pipe,
- &st->state.vertex_sampler_views[i]);
+ for (shader = 0; shader < Elements(st->state.sampler_views); shader++) {
+ for (i = 0; i < Elements(st->state.sampler_views[0]); i++) {
+ pipe_sampler_view_release(st->pipe,
+ &st->state.sampler_views[shader][i]);
+ }
}
if (st->default_texture) {
struct pipe_blend_state blend;
struct pipe_depth_stencil_alpha_state depth_stencil;
struct pipe_rasterizer_state rasterizer;
- struct pipe_sampler_state fragment_samplers[PIPE_MAX_SAMPLERS];
- struct pipe_sampler_state vertex_samplers[PIPE_MAX_SAMPLERS];
+ struct pipe_sampler_state samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
+ GLuint num_samplers[PIPE_SHADER_TYPES];
+ struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
+ GLuint num_sampler_views[PIPE_SHADER_TYPES];
struct pipe_clip_state clip;
struct {
void *ptr;
unsigned size;
} constants[PIPE_SHADER_TYPES];
struct pipe_framebuffer_state framebuffer;
- struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
- struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_SAMPLERS];
struct pipe_scissor_state scissor;
struct pipe_viewport_state viewport;
unsigned sample_mask;
- GLuint num_fragment_samplers;
- GLuint num_vertex_samplers;
- GLuint num_fragment_textures;
- GLuint num_vertex_textures;
-
GLuint poly_stipple[32]; /**< In OpenGL's bottom-to-top order */
GLuint fb_orientation;