aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-12 01:15:59 +0200
committerMarek Olšák <[email protected]>2017-06-22 01:51:02 +0200
commit25723857d95e40147e59e3fda5b5fba1b41ec5a4 (patch)
tree1418e83ece9b85835b2a9bc3efc50d23bafee937 /src/mesa/state_tracker/st_atom_texture.c
parent3ee1c9b1263adcf68ca7c376d29c94a0fc31b2b0 (diff)
st/mesa: samplers only need to track whether GLSL >= 130
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_atom_texture.c')
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index b71b73506f8..cb6b4005fa6 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -58,7 +58,7 @@
void
st_update_single_texture(struct st_context *st,
struct pipe_sampler_view **sampler_view,
- GLuint texUnit, unsigned glsl_version)
+ GLuint texUnit, bool glsl130_or_later)
{
struct gl_context *ctx = st->ctx;
const struct gl_sampler_object *samp;
@@ -88,12 +88,12 @@ st_update_single_texture(struct st_context *st,
/* Check a few pieces of state outside the texture object to see if we
* need to force revalidation.
*/
- if (stObj->prev_glsl_version != glsl_version ||
+ if (stObj->prev_glsl130_or_later != glsl130_or_later ||
stObj->prev_sRGBDecode != samp->sRGBDecode) {
st_texture_release_all_sampler_views(st, stObj);
- stObj->prev_glsl_version = glsl_version;
+ stObj->prev_glsl130_or_later = glsl130_or_later;
stObj->prev_sRGBDecode = samp->sRGBDecode;
}
@@ -102,7 +102,8 @@ st_update_single_texture(struct st_context *st,
stObj->pt->screen->resource_changed(stObj->pt->screen, stObj->pt);
*sampler_view =
- st_get_texture_sampler_view_from_stobj(st, stObj, samp, glsl_version);
+ st_get_texture_sampler_view_from_stobj(st, stObj, samp,
+ glsl130_or_later);
}
@@ -125,17 +126,18 @@ update_textures(struct st_context *st,
unsigned num_textures = 0;
+ /* prog->sh.data is NULL if it's ARB_fragment_program */
+ bool glsl130 = (prog->sh.data ? prog->sh.data->Version : 0) >= 130;
+
/* loop over sampler units (aka tex image units) */
for (unit = 0; samplers_used || unit < old_max;
unit++, samplers_used >>= 1) {
struct pipe_sampler_view *sampler_view = NULL;
if (samplers_used & 1) {
- /* prog->sh.data is NULL if it's ARB_fragment_program */
- unsigned glsl_version = prog->sh.data ? prog->sh.data->Version : 0;
const GLuint texUnit = prog->SamplerUnits[unit];
- st_update_single_texture(st, &sampler_view, texUnit, glsl_version);
+ st_update_single_texture(st, &sampler_view, texUnit, glsl130);
num_textures = unit + 1;
}