#include "main/mtypes.h"
#include "main/glformats.h"
#include "main/samplerobj.h"
+#include "main/teximage.h"
#include "main/texobj.h"
#include "st_context.h"
const struct gl_texture_object *texobj;
struct gl_context *ctx = st->ctx;
struct gl_sampler_object *msamp;
- const struct gl_texture_image *teximg;
GLenum texBaseFormat;
texobj = ctx->Texture.Unit[texUnit]._Current;
texobj = _mesa_get_fallback_texture(ctx, TEXTURE_2D_INDEX);
}
- teximg = texobj->Image[0][texobj->BaseLevel];
- texBaseFormat = teximg ? teximg->_BaseFormat : GL_RGBA;
+ texBaseFormat = _mesa_texture_base_format(texobj);
msamp = _mesa_get_samplerobj(ctx, texUnit);
GLuint unit;
GLbitfield samplers_used;
const GLuint old_max = *num_samplers;
+ const struct pipe_sampler_state *states[PIPE_MAX_SAMPLERS];
samplers_used = prog->SamplersUsed;
const GLuint texUnit = prog->SamplerUnits[unit];
convert_sampler(st, sampler, texUnit);
-
+ states[unit] = sampler;
*num_samplers = unit + 1;
-
- cso_single_sampler(st->cso_context, shader_stage, unit, sampler);
}
else if (samplers_used != 0 || unit < old_max) {
- cso_single_sampler(st->cso_context, shader_stage, unit, NULL);
+ states[unit] = NULL;
}
else {
/* if we've reset all the old samplers and we have no more new ones */
}
}
- cso_single_sampler_done(st->cso_context, shader_stage);
+ cso_set_samplers(st->cso_context, shader_stage, *num_samplers, states);
}
st->state.samplers[PIPE_SHADER_GEOMETRY],
&st->state.num_samplers[PIPE_SHADER_GEOMETRY]);
}
+ if (ctx->TessCtrlProgram._Current) {
+ update_shader_samplers(st,
+ PIPE_SHADER_TESS_CTRL,
+ &ctx->TessCtrlProgram._Current->Base,
+ ctx->Const.Program[MESA_SHADER_TESS_CTRL].MaxTextureImageUnits,
+ st->state.samplers[PIPE_SHADER_TESS_CTRL],
+ &st->state.num_samplers[PIPE_SHADER_TESS_CTRL]);
+ }
+ if (ctx->TessEvalProgram._Current) {
+ update_shader_samplers(st,
+ PIPE_SHADER_TESS_EVAL,
+ &ctx->TessEvalProgram._Current->Base,
+ ctx->Const.Program[MESA_SHADER_TESS_EVAL].MaxTextureImageUnits,
+ st->state.samplers[PIPE_SHADER_TESS_EVAL],
+ &st->state.num_samplers[PIPE_SHADER_TESS_EVAL]);
+ }
}