[Mesa-dev] [PATCH 15/24] st/mesa: don't call st_shader_stage_to_ptarget in update_textures
Marek Olšák
maraeo at gmail.com
Mon Jun 12 18:18:46 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
---
src/mesa/state_tracker/st_atom_texture.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index a99bc1a..890e6f5 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -94,32 +94,31 @@ update_single_texture(struct st_context *st,
*sampler_view =
st_get_texture_sampler_view_from_stobj(st, stObj, samp, glsl_version);
return GL_TRUE;
}
static void
update_textures(struct st_context *st,
- gl_shader_stage mesa_shader,
+ enum pipe_shader_type shader_stage,
const struct gl_program *prog,
unsigned max_units,
struct pipe_sampler_view **sampler_views,
unsigned *num_textures)
{
const GLuint old_max = *num_textures;
GLbitfield samplers_used = prog->SamplersUsed;
GLbitfield free_slots = ~prog->SamplersUsed;
GLbitfield external_samplers_used = prog->ExternalSamplersUsed;
GLuint unit;
- enum pipe_shader_type shader_stage = st_shader_stage_to_ptarget(mesa_shader);
if (samplers_used == 0x0 && old_max == 0)
return;
*num_textures = 0;
/* loop over sampler units (aka tex image units) */
for (unit = 0; unit < max_units; unit++, samplers_used >>= 1) {
struct pipe_sampler_view *sampler_view = NULL;
@@ -199,95 +198,95 @@ update_textures(struct st_context *st,
void
st_update_vertex_textures(struct st_context *st)
{
const struct gl_context *ctx = st->ctx;
if (ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits > 0) {
update_textures(st,
- MESA_SHADER_VERTEX,
+ PIPE_SHADER_VERTEX,
ctx->VertexProgram._Current,
ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_VERTEX],
&st->state.num_sampler_views[PIPE_SHADER_VERTEX]);
}
}
void
st_update_fragment_textures(struct st_context *st)
{
const struct gl_context *ctx = st->ctx;
update_textures(st,
- MESA_SHADER_FRAGMENT,
+ PIPE_SHADER_FRAGMENT,
ctx->FragmentProgram._Current,
ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_FRAGMENT],
&st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]);
}
void
st_update_geometry_textures(struct st_context *st)
{
const struct gl_context *ctx = st->ctx;
if (ctx->GeometryProgram._Current) {
update_textures(st,
- MESA_SHADER_GEOMETRY,
+ PIPE_SHADER_GEOMETRY,
ctx->GeometryProgram._Current,
ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_GEOMETRY],
&st->state.num_sampler_views[PIPE_SHADER_GEOMETRY]);
}
}
void
st_update_tessctrl_textures(struct st_context *st)
{
const struct gl_context *ctx = st->ctx;
if (ctx->TessCtrlProgram._Current) {
update_textures(st,
- MESA_SHADER_TESS_CTRL,
+ PIPE_SHADER_TESS_CTRL,
ctx->TessCtrlProgram._Current,
ctx->Const.Program[MESA_SHADER_TESS_CTRL].MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_TESS_CTRL],
&st->state.num_sampler_views[PIPE_SHADER_TESS_CTRL]);
}
}
void
st_update_tesseval_textures(struct st_context *st)
{
const struct gl_context *ctx = st->ctx;
if (ctx->TessEvalProgram._Current) {
update_textures(st,
- MESA_SHADER_TESS_EVAL,
+ PIPE_SHADER_TESS_EVAL,
ctx->TessEvalProgram._Current,
ctx->Const.Program[MESA_SHADER_TESS_EVAL].MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_TESS_EVAL],
&st->state.num_sampler_views[PIPE_SHADER_TESS_EVAL]);
}
}
void
st_update_compute_textures(struct st_context *st)
{
const struct gl_context *ctx = st->ctx;
if (ctx->ComputeProgram._Current) {
update_textures(st,
- MESA_SHADER_COMPUTE,
+ PIPE_SHADER_COMPUTE,
ctx->ComputeProgram._Current,
ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_COMPUTE],
&st->state.num_sampler_views[PIPE_SHADER_COMPUTE]);
}
}
--
2.7.4
More information about the mesa-dev
mailing list