aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_atom_texture.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-10-01 20:12:35 +0200
committermarha <marha@users.sourceforge.net>2014-10-01 20:12:35 +0200
commit19b4b68b35a047a83bd291ee8debac1adb0e946c (patch)
treed4d4520622ecf73fa0d076dc0bf517a1189b7d9f /mesalib/src/mesa/state_tracker/st_atom_texture.c
parent4e080e0165d18887e2a0fccd7f30cf20fd04b178 (diff)
parent438af0c7d4bf60b408b259c88205ff2193195466 (diff)
downloadvcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.tar.gz
vcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.tar.bz2
vcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mesa/main/macros.h xorg-server/dix/registry.c xorg-server/hw/kdrive/ephyr/ephyrinit.c xorg-server/hw/xwin/Makefile.am xorg-server/hw/xwin/glx/.gitignore xorg-server/hw/xwin/glx/gen_gl_wrappers.py xorg-server/hw/xwin/glx/indirect.c xorg-server/hw/xwin/glx/winpriv.c xorg-server/hw/xwin/winclipboardthread.c xorg-server/hw/xwin/windisplay.c xorg-server/hw/xwin/winmultiwindowwm.c xorg-server/hw/xwin/winprefs.c
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom_texture.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_texture.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_texture.c b/mesalib/src/mesa/state_tracker/st_atom_texture.c
index 03d05932a..ed9a44429 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_texture.c
@@ -192,9 +192,9 @@ get_texture_format_swizzle(const struct st_texture_object *stObj)
return swizzle_swizzle(stObj->base._Swizzle, tex_swizzle);
}
-
+
/**
- * Return TRUE if the texture's sampler view swizzle is equal to
+ * Return TRUE if the texture's sampler view swizzle is not equal to
* the texture's swizzle.
*
* \param stObj the st texture object,
@@ -214,9 +214,20 @@ check_sampler_swizzle(const struct st_texture_object *stObj,
static unsigned last_level(struct st_texture_object *stObj)
{
- return MIN2(stObj->base._MaxLevel, stObj->pt->last_level);
+ unsigned ret = MIN2(stObj->base.MinLevel + stObj->base._MaxLevel,
+ stObj->pt->last_level);
+ if (stObj->base.Immutable)
+ ret = MIN2(ret, stObj->base.MinLevel + stObj->base.NumLevels - 1);
+ return ret;
}
+static unsigned last_layer(struct st_texture_object *stObj)
+{
+ if (stObj->base.Immutable)
+ return MIN2(stObj->base.MinLayer + stObj->base.NumLayers - 1,
+ stObj->pt->array_size - 1);
+ return stObj->pt->array_size - 1;
+}
static struct pipe_sampler_view *
st_create_texture_sampler_view_from_stobj(struct pipe_context *pipe,
@@ -249,9 +260,13 @@ st_create_texture_sampler_view_from_stobj(struct pipe_context *pipe,
templ.u.buf.first_element = f;
templ.u.buf.last_element = f + (n - 1);
} else {
- templ.u.tex.first_level = stObj->base.BaseLevel;
+ templ.u.tex.first_level = stObj->base.MinLevel + stObj->base.BaseLevel;
templ.u.tex.last_level = last_level(stObj);
assert(templ.u.tex.first_level <= templ.u.tex.last_level);
+ templ.u.tex.first_layer = stObj->base.MinLayer;
+ templ.u.tex.last_layer = last_layer(stObj);
+ assert(templ.u.tex.first_layer <= templ.u.tex.last_layer);
+ templ.target = gl_target_to_pipe(stObj->base.Target);
}
if (swizzle != SWIZZLE_NOOP) {
@@ -287,8 +302,11 @@ st_get_texture_sampler_view_from_stobj(struct st_context *st,
if (*sv) {
if (check_sampler_swizzle(stObj, *sv) ||
(format != (*sv)->format) ||
- stObj->base.BaseLevel != (*sv)->u.tex.first_level ||
- last_level(stObj) != (*sv)->u.tex.last_level) {
+ gl_target_to_pipe(stObj->base.Target) != (*sv)->target ||
+ stObj->base.MinLevel + stObj->base.BaseLevel != (*sv)->u.tex.first_level ||
+ last_level(stObj) != (*sv)->u.tex.last_level ||
+ stObj->base.MinLayer != (*sv)->u.tex.first_layer ||
+ last_layer(stObj) != (*sv)->u.tex.last_layer) {
pipe_sampler_view_reference(sv, NULL);
}
}