Commit d645c7b4 authored by James Darpinian's avatar James Darpinian Committed by Commit Bot

gpu: Update swizzles when texture base level changes

When we emulate GL_LUMINANCE_ALPHA using GL_RG and swizzles, we need to
make sure to update the swizzles whenever the base level of the texture
changes, because different levels can have different formats that need
different swizzles.

Fixes WebGL test
conformance2/textures/misc/copy-texture-image-same-texture.html

Bug: 809233
Change-Id: Iccda944688982ca1d67203b885cd3ea5236c7e26
Reviewed-on: https://chromium-review.googlesource.com/c/1356330Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612908}
parent 03b2c573
......@@ -124,10 +124,6 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations):
'texturelodoffset.html',
bug=794335)
self.Fail('conformance2/textures/misc/copy-texture-image-same-texture.html',
['mac', 'linux'], bug=809233)
self.Fail('conformance2/textures/misc/copy-texture-image-same-texture.html',
['win', 'nvidia', 'opengl'], bug=809594)
self.Fail('conformance2/uniforms/' +
'incompatible-texture-type-for-sampler.html',
bug=809237)
......@@ -349,6 +345,8 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations):
['passthrough', 'opengl'], bug=794341)
self.Fail('conformance2/rendering/attrib-type-match.html',
['passthrough', 'opengl'], bug=814905)
self.Fail('conformance2/textures/misc/copy-texture-image-same-texture.html',
['passthrough', 'opengl'], bug=2994) # ANGLE bug
# Passthrough command decoder / OpenGL / Windows
self.Fail('deqp/functional/gles3/fbocompleteness.html',
......@@ -386,8 +384,6 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations):
['win', 'passthrough', 'opengl', 'intel'], bug=884210)
self.Flaky('conformance/glsl/variables/gl-pointcoord.html',
['win', 'passthrough', 'opengl', 'intel'], bug=854100)
self.Fail('conformance2/textures/misc/copy-texture-image-same-texture.html',
['win', 'passthrough', 'opengl', 'intel'], bug=809594)
self.Fail('conformance2/renderbuffers/' +
'multisampled-depth-renderbuffer-initialization.html',
['win', 'passthrough', 'opengl', 'intel'], bug=2760) # ANGLE bug
......@@ -1298,8 +1294,6 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations):
['android', 'qualcomm'])
# Basic failures that need to be investigated on multiple devices
self.Fail('conformance2/textures/misc/copy-texture-image-same-texture.html',
['android'], bug=809233)
self.Fail('conformance2/glsl3/vector-dynamic-indexing-swizzled-lvalue.html',
['android'], bug=709351)
# Video uploads to some texture formats new in WebGL 2.0 are
......
......@@ -1126,12 +1126,14 @@ void Texture::IncAllFramebufferStateChangeCount() {
(*it)->manager()->IncFramebufferStateChangeCount();
}
void Texture::UpdateBaseLevel(GLint base_level) {
void Texture::UpdateBaseLevel(GLint base_level,
const FeatureInfo* feature_info) {
if (unclamped_base_level_ == base_level)
return;
unclamped_base_level_ = base_level;
UpdateNumMipLevels();
ApplyFormatWorkarounds(feature_info);
}
void Texture::UpdateMaxLevel(GLint max_level) {
......@@ -1440,7 +1442,7 @@ GLenum Texture::SetParameteri(
if (param < 0) {
return GL_INVALID_VALUE;
}
UpdateBaseLevel(param);
UpdateBaseLevel(param, feature_info);
break;
case GL_TEXTURE_MAX_LEVEL:
if (param < 0) {
......@@ -1937,7 +1939,7 @@ void Texture::SetCompatibilitySwizzle(const CompatibilitySwizzle* swizzle) {
GetSwizzleForChannel(swizzle_a_, swizzle));
}
void Texture::ApplyFormatWorkarounds(FeatureInfo* feature_info) {
void Texture::ApplyFormatWorkarounds(const FeatureInfo* feature_info) {
if (feature_info->gl_version_info().NeedsLuminanceAlphaEmulation()) {
if (static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size())
return;
......
......@@ -329,7 +329,7 @@ class GPU_GLES2_EXPORT Texture final : public TextureBase {
uint64_t client_tracing_id,
const std::string& dump_name) const;
void ApplyFormatWorkarounds(FeatureInfo* feature_info);
void ApplyFormatWorkarounds(const FeatureInfo* feature_info);
bool EmulatingRGB();
......@@ -575,7 +575,7 @@ class GPU_GLES2_EXPORT Texture final : public TextureBase {
// referencing this texture.
void IncAllFramebufferStateChangeCount();
void UpdateBaseLevel(GLint base_level);
void UpdateBaseLevel(GLint base_level, const FeatureInfo* feature_info);
void UpdateMaxLevel(GLint max_level);
void UpdateNumMipLevels();
......
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