Commit d51c7fa6 by Nicolas Capens Committed by Nicolas Capens

Fix completeness test of OpenGL ES immutable textures

Immutable textures created with glTexStorage*() are always mipmap and sampler complete. The spec states that "Array levels k where k < levelbase or k > q arebinsignificant to the definition ofcompleteness." Where q is no larger than levelmax, which is in turn limited to levelimmut - 1 which was specified at glTexStorage. Change-Id: Ieaa6be856fd35cf2827e753d7c777ebf784027ef Tests: dEQP-GLES* Fixes: b/152740217 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43188 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 99257618
...@@ -720,6 +720,11 @@ bool Texture2D::isBaseLevelDefined() const ...@@ -720,6 +720,11 @@ bool Texture2D::isBaseLevelDefined() const
// Tests for 2D texture sampling completeness. [OpenGL ES 3.0.5] section 3.8.13 page 160. // Tests for 2D texture sampling completeness. [OpenGL ES 3.0.5] section 3.8.13 page 160.
bool Texture2D::isSamplerComplete(Sampler *sampler) const bool Texture2D::isSamplerComplete(Sampler *sampler) const
{ {
if(mImmutableFormat == GL_TRUE)
{
return true;
}
if(!isBaseLevelDefined()) if(!isBaseLevelDefined())
{ {
return false; return false;
...@@ -1104,6 +1109,11 @@ bool TextureCubeMap::isBaseLevelDefined() const ...@@ -1104,6 +1109,11 @@ bool TextureCubeMap::isBaseLevelDefined() const
// Tests for cube map sampling completeness. [OpenGL ES 3.0.5] section 3.8.13 page 161. // Tests for cube map sampling completeness. [OpenGL ES 3.0.5] section 3.8.13 page 161.
bool TextureCubeMap::isSamplerComplete(Sampler *sampler) const bool TextureCubeMap::isSamplerComplete(Sampler *sampler) const
{ {
if(mImmutableFormat == GL_TRUE)
{
return true;
}
if(!isBaseLevelDefined()) if(!isBaseLevelDefined())
{ {
return false; return false;
...@@ -1738,6 +1748,11 @@ bool Texture3D::isBaseLevelDefined() const ...@@ -1738,6 +1748,11 @@ bool Texture3D::isBaseLevelDefined() const
// Tests for 3D texture sampling completeness. [OpenGL ES 3.0.5] section 3.8.13 page 160. // Tests for 3D texture sampling completeness. [OpenGL ES 3.0.5] section 3.8.13 page 160.
bool Texture3D::isSamplerComplete(Sampler *sampler) const bool Texture3D::isSamplerComplete(Sampler *sampler) const
{ {
if(mImmutableFormat == GL_TRUE)
{
return true;
}
if(!isBaseLevelDefined()) if(!isBaseLevelDefined())
{ {
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment