mesa: fix glPopAttrib for many texture fields

Move the fields that should be restored by glPopAttrib into the Attrib
structure, which is the only portion of texture objects that is restored
by glPopAttrib. Also moves fields that should not be restored by glPopAttrib
out of the Attrib structure.

This is based on the GL 4.6 Compatibility spec.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>
This commit is contained in:
Marek Olšák
2020-12-19 01:19:35 -05:00
parent 230b46bcee
commit 35be83846e
27 changed files with 159 additions and 148 deletions

View File

@@ -168,7 +168,7 @@ st_convert_sampler(const struct st_context *st,
const GLboolean is_integer = texobj->_IsIntegerFormat;
GLenum texBaseFormat = _mesa_base_tex_image(texobj)->_BaseFormat;
if (texobj->Attrib.StencilSampling)
if (texobj->StencilSampling)
texBaseFormat = GL_STENCIL_INDEX;
if (st->apply_texture_swizzle_to_border_color) {
@@ -212,7 +212,7 @@ st_convert_sampler(const struct st_context *st,
GLenum texBaseFormat = _mesa_base_tex_image(texobj)->_BaseFormat;
if (texBaseFormat == GL_DEPTH_COMPONENT ||
(texBaseFormat == GL_DEPTH_STENCIL && !texobj->Attrib.StencilSampling)) {
(texBaseFormat == GL_DEPTH_STENCIL && !texobj->StencilSampling)) {
sampler->compare_mode = PIPE_TEX_COMPARE_R_TO_TEXTURE;
sampler->compare_func = st_compare_func_to_pipe(msamp->Attrib.CompareFunc);
}