From e5590288b8d801a30a72992b9633909266b08bd4 Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Sun, 18 Oct 2020 12:40:14 -0400 Subject: [PATCH] Rename "texelFetchInvoked" to "texelFetchStaticUse". Technically more precise because something could be statically used and never invoked. Also more consistent with the spec. Bug: angleproject:5176 Change-Id: I70dd0787d67d9f046b7359abb24107cb430f5cae Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2483465 Commit-Queue: Jamie Madill Reviewed-by: Mohan Maiya Reviewed-by: Courtney Goeltzenleuchter --- include/GLSLANG/ShaderVars.h | 2 +- src/compiler/translator/ShaderVars.cpp | 8 ++++---- .../tree_ops/FlagSamplersWithTexelFetch.cpp | 2 +- src/libANGLE/Program.cpp | 12 ++++++------ src/libANGLE/ProgramLinkedResources.cpp | 10 +++++----- src/libANGLE/frame_capture_utils.cpp | 2 +- src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/GLSLANG/ShaderVars.h b/include/GLSLANG/ShaderVars.h index 39d838d6b..c2bb61408 100644 --- a/include/GLSLANG/ShaderVars.h +++ b/include/GLSLANG/ShaderVars.h @@ -201,7 +201,7 @@ struct ShaderVariable bool isSameVaryingAtLinkTime(const ShaderVariable &other) const; // If the variable is a sampler that has ever been statically used with texelFetch - bool texelFetchInvoked; + bool texelFetchStaticUse; protected: bool isSameVariableAtLinkTime(const ShaderVariable &other, diff --git a/src/compiler/translator/ShaderVars.cpp b/src/compiler/translator/ShaderVars.cpp index 9b849cc06..461082a42 100644 --- a/src/compiler/translator/ShaderVars.cpp +++ b/src/compiler/translator/ShaderVars.cpp @@ -48,7 +48,7 @@ ShaderVariable::ShaderVariable(GLenum typeIn) index(-1), interpolation(INTERPOLATION_SMOOTH), isInvariant(false), - texelFetchInvoked(false), + texelFetchStaticUse(false), flattenedOffsetInParentArrays(-1) {} @@ -80,7 +80,7 @@ ShaderVariable::ShaderVariable(const ShaderVariable &other) index(other.index), interpolation(other.interpolation), isInvariant(other.isInvariant), - texelFetchInvoked(other.texelFetchInvoked), + texelFetchStaticUse(other.texelFetchStaticUse), flattenedOffsetInParentArrays(other.flattenedOffsetInParentArrays) {} @@ -106,7 +106,7 @@ ShaderVariable &ShaderVariable::operator=(const ShaderVariable &other) index = other.index; interpolation = other.interpolation; isInvariant = other.isInvariant; - texelFetchInvoked = other.texelFetchInvoked; + texelFetchStaticUse = other.texelFetchStaticUse; return *this; } @@ -120,7 +120,7 @@ bool ShaderVariable::operator==(const ShaderVariable &other) const binding != other.binding || imageUnitFormat != other.imageUnitFormat || offset != other.offset || readonly != other.readonly || writeonly != other.writeonly || index != other.index || interpolation != other.interpolation || - isInvariant != other.isInvariant || texelFetchInvoked != other.texelFetchInvoked) + isInvariant != other.isInvariant || texelFetchStaticUse != other.texelFetchStaticUse) { return false; } diff --git a/src/compiler/translator/tree_ops/FlagSamplersWithTexelFetch.cpp b/src/compiler/translator/tree_ops/FlagSamplersWithTexelFetch.cpp index 44e6159ac..04a223607 100644 --- a/src/compiler/translator/tree_ops/FlagSamplersWithTexelFetch.cpp +++ b/src/compiler/translator/tree_ops/FlagSamplersWithTexelFetch.cpp @@ -68,7 +68,7 @@ class FlagSamplersWithTexelFetchTraverser : public TIntermTraverser if (samplerVariable.name() == uniform.name) { ASSERT(gl::IsSamplerType(uniform.type)); - uniform.texelFetchInvoked = true; + uniform.texelFetchStaticUse = true; break; } } diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp index 29bd6b9ce..bca55cea1 100644 --- a/src/libANGLE/Program.cpp +++ b/src/libANGLE/Program.cpp @@ -889,7 +889,7 @@ void WriteShaderVar(BinaryOutputStream *stream, const sh::ShaderVariable &var) stream->writeInt(var.offset); stream->writeInt(var.readonly); stream->writeInt(var.writeonly); - stream->writeInt(var.texelFetchInvoked); + stream->writeInt(var.texelFetchStaticUse); ASSERT(var.fields.empty()); } @@ -907,11 +907,11 @@ void LoadShaderVar(BinaryInputStream *stream, sh::ShaderVariable *var) var->structName = stream->readString(); var->setParentArrayIndex(stream->readInt()); - var->imageUnitFormat = stream->readInt(); - var->offset = stream->readInt(); - var->readonly = stream->readBool(); - var->writeonly = stream->readBool(); - var->texelFetchInvoked = stream->readBool(); + var->imageUnitFormat = stream->readInt(); + var->offset = stream->readInt(); + var->readonly = stream->readBool(); + var->writeonly = stream->readBool(); + var->texelFetchStaticUse = stream->readBool(); } // VariableLocation implementation. diff --git a/src/libANGLE/ProgramLinkedResources.cpp b/src/libANGLE/ProgramLinkedResources.cpp index 4c7ad3432..136a473b2 100644 --- a/src/libANGLE/ProgramLinkedResources.cpp +++ b/src/libANGLE/ProgramLinkedResources.cpp @@ -469,11 +469,11 @@ class FlattenUniformVisitor : public sh::VariableNameVisitor LinkedUniform linkedUniform(variable.type, variable.precision, fullNameWithArrayIndex, variable.arraySizes, getBinding(), getOffset(), mLocation, -1, sh::kDefaultBlockMemberInfo); - linkedUniform.mappedName = fullMappedNameWithArrayIndex; - linkedUniform.active = mMarkActive; - linkedUniform.staticUse = mMarkStaticUse; - linkedUniform.outerArraySizes = arraySizes; - linkedUniform.texelFetchInvoked = variable.texelFetchInvoked; + linkedUniform.mappedName = fullMappedNameWithArrayIndex; + linkedUniform.active = mMarkActive; + linkedUniform.staticUse = mMarkStaticUse; + linkedUniform.outerArraySizes = arraySizes; + linkedUniform.texelFetchStaticUse = variable.texelFetchStaticUse; if (variable.hasParentArrayIndex()) { linkedUniform.setParentArrayIndex(variable.parentArrayIndex()); diff --git a/src/libANGLE/frame_capture_utils.cpp b/src/libANGLE/frame_capture_utils.cpp index 432dbe71c..53fa60807 100644 --- a/src/libANGLE/frame_capture_utils.cpp +++ b/src/libANGLE/frame_capture_utils.cpp @@ -597,7 +597,7 @@ void SerializeShaderVariable(gl::BinaryOutputStream *bos, const sh::ShaderVariab bos->writeInt(shaderVariable.index); bos->writeEnum(shaderVariable.interpolation); bos->writeInt(shaderVariable.isInvariant); - bos->writeInt(shaderVariable.texelFetchInvoked); + bos->writeInt(shaderVariable.texelFetchStaticUse); } void SerializeShaderVariablesVector(gl::BinaryOutputStream *bos, diff --git a/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp b/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp index 5e417388b..16bdc5bec 100644 --- a/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp +++ b/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp @@ -1428,7 +1428,7 @@ angle::Result ProgramExecutableVk::updateTexturesDescriptorSet(ContextVk *contex vk::ImageHelper &image = textureVk->getImage(); bool shouldUseLinearColorspace = textureVk->shouldUseLinearColorspaceWithTexelFetch( - linearColorspaceWithSampler, samplerUniform.texelFetchInvoked); + linearColorspaceWithSampler, samplerUniform.texelFetchStaticUse); imageInfos[arrayElement].sampler = samplerHelper.get().getHandle(); imageInfos[arrayElement].imageLayout = image.getCurrentLayout();