[Piglit] [PATCH] dsa_texture-storage immut remove level_max check
Liam Middlebrook
lmiddlebrook at nvidia.com
Wed Jul 8 16:34:23 PDT 2015
bump
On 06/23/2015 10:43 AM, Liam Middlebrook wrote:
> From a5b8064d066b6829b7eb81d0b6440ce61ea2cad5 Mon Sep 17 00:00:00 2001
> From: Liam Middlebrook <lmiddlebrook at nvidia.com>
> Date: Tue, 23 Jun 2015 09:24:57 -0700
> Subject: [PATCH] dsa_texture-storage immut remove level_max check
>
> Removes the level_max related checks for the arb_direct_state_access
> texture-storage immutability test. These checks were added because of a
> confusion with the ARB_texture_storage extension. The union of this
> extension
> along with the OpenGL Core Profile Specification, isn't always the
> most clear if
> not read as a whole.
>
> The test originally stated that max level must be checked due to the
> following
> language from the spec.
>
> "However, if TEXTURE_IMMUTABLE_FORMAT is
> TRUE, then level_base is clamped to the range [0, <levels> - 1] and
> level_max is then clamped to the range [level_base, <levels> - 1],
> where <levels> is the parameter passed the call to TexStorage* for
> the texture object."
>
> This citation was missing the context in which that "clamping clause"
> was added
> to. Reading directly before that, the spec states:
>
> "In section 3.8.6 (Texture Parameters), after the sentence
>
> 'In the remainder of section 3.8, denote by lod_min, lod_max,
> level_base, and level_max the values of the texture parameters
> TEXTURE_MIN_LOD, TEXTURE_MAX_LOD, TEXTURE_BASE_LEVEL, and
> TEXTURE_MAX_LEVEL respectively.'"
>
> This means that the clamping is only respective to sections of the
> spec that
> mention lod_min, lod_max, level_base, or level_max after section 3.8.6
> (or
> whatever section it may occur in for later versions of the
> specification).
>
> In the OpenGL 4.5 Core Profile Specification this addition appears in
> the ending
> of section 8.11 on page 229. In this context it is changed to cover the
> remainder of chapter 8. Right before this is stated is where the
> behavior for
> Tex*Parameter{if} is defined.
>
> The remaining references to lod_min, lod_max, level_base, and
> level_max are made
> in the following sections.
> 8.14 - Texture Minification
> 8.15 - Texture Magnification
> 8.17 - Texture Completeness
>
> The references listed above only refer to reading the clamped values
> of lod_min,
> lod_max, level_base, and level_max.
> ---
> tests/spec/arb_direct_state_access/texture-storage.c | 17
> -----------------
> 1 file changed, 17 deletions(-)
>
> diff --git a/tests/spec/arb_direct_state_access/texture-storage.c
> b/tests/spec/arb_direct_state_access/texture-storage.c
> index 16bd39d..8bdef8b 100644
> --- a/tests/spec/arb_direct_state_access/texture-storage.c
> +++ b/tests/spec/arb_direct_state_access/texture-storage.c
> @@ -535,7 +535,6 @@ static bool
> test_immutablity(GLenum target)
> {
> GLuint tex;
> - GLint level;
> GLint immutable_format;
>
> bool pass = true;
> @@ -544,8 +543,6 @@ test_immutablity(GLenum target)
> glBindTextureUnit(0, tex);
>
> glTextureStorage2D(tex, 3, GL_RGBA8, 256, 256);
> - glTextureParameteri(tex, GL_TEXTURE_MAX_LEVEL, 4);
> - glGetTextureParameteriv(tex, GL_TEXTURE_MAX_LEVEL, &level);
> glGetTextureParameteriv(tex, GL_TEXTURE_IMMUTABLE_FORMAT,
> &immutable_format);
>
> @@ -554,20 +551,6 @@ test_immutablity(GLenum target)
> "GL_TRUE after glTextureStorage2D\n", TestName);
> pass = false;
> }
> - if (level != 2) {
> - /* The ARB_texture_storage spec says:
> - *
> - * "However, if TEXTURE_IMMUTABLE_FORMAT is TRUE, then
> - * level_base is clamped to the range [0, <levels> - 1]
> - * and level_max is then clamped to the range [level_base,
> - * <levels> - 1], where <levels> is the parameter passed
> - * the call to TexStorage* for the texture object"
> - */
> - printf("%s: GL_TEXTURE_MAX_LEVEL changed to %d, which is "
> - "outside the clamp range for immutables\n",
> - TestName, level);
> - pass = false;
> - }
>
> /* Other immutable tests happen per-format above */
>
More information about the Piglit
mailing list