Commit 1c08cbb3 by Jiawei Shao Committed by Commit Bot

Clean up link validations on interface blocks

This patch intends to clean up the link validations on interface blocks for better implementing program linking with geoemtry shader. 1. Move three interface block validation functions to the anonymous namespace of Program.cpp instead of the member function of class Program. 2. Use IsActiveInterfaceBlock everywhere we need to know if an interface block is active or not. BUG=angleproject:1941 Change-Id: Ic868d015e45f04d57ba382a2b447be00952fa4fc Reviewed-on: https://chromium-review.googlesource.com/965395 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJiajia Qin <jiajia.qin@intel.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 5ae6ee45
......@@ -166,6 +166,8 @@ void LogLinkMismatch(InfoLog &infoLog,
GLenum shaderType1,
GLenum shaderType2);
bool IsActiveInterfaceBlock(const sh::InterfaceBlock &interfaceBlock);
// Struct used for correlating uniforms/elements of uniform arrays to handles
struct VariableLocation
{
......@@ -627,12 +629,6 @@ class Program final : angle::NonCopyable, public LabeledObject
GLuint getTransformFeedbackVaryingResourceIndex(const GLchar *name) const;
const TransformFeedbackVarying &getTransformFeedbackVaryingResource(GLuint index) const;
static LinkMismatchError LinkValidateInterfaceBlockFields(
const sh::InterfaceBlockField &blockField1,
const sh::InterfaceBlockField &blockField2,
bool webglCompatibility,
std::string *mismatchedBlockFieldName);
void addRef();
void release(const Context *context);
unsigned int getRefCount() const;
......@@ -710,13 +706,6 @@ class Program final : angle::NonCopyable, public LabeledObject
bool linkValidateShaders(const Context *context, InfoLog &infoLog);
bool linkAttributes(const Context *context, InfoLog &infoLog);
static bool ValidateGraphicsInterfaceBlocks(
const std::vector<sh::InterfaceBlock> &vertexInterfaceBlocks,
const std::vector<sh::InterfaceBlock> &fragmentInterfaceBlocks,
InfoLog &infoLog,
bool webglCompatibility,
sh::BlockType blockType,
GLuint maxCombinedInterfaceBlocks);
bool linkInterfaceBlocks(const Context *context, InfoLog &infoLog);
bool linkVaryings(const Context *context, InfoLog &infoLog) const;
......@@ -728,11 +717,6 @@ class Program final : angle::NonCopyable, public LabeledObject
void updateLinkedShaderStages();
static LinkMismatchError AreMatchingInterfaceBlocks(const sh::InterfaceBlock &interfaceBlock1,
const sh::InterfaceBlock &interfaceBlock2,
bool webglCompatibility,
std::string *mismatchedBlockFieldName);
static LinkMismatchError LinkValidateVaryings(const sh::Varying &outputVarying,
const sh::Varying &inputVarying,
int shaderVersion,
......
......@@ -814,8 +814,7 @@ void InterfaceBlockLinker::linkBlocks(const GetBlockSize &getBlockSize,
for (const auto &block : *shaderBlocks.second)
{
// Only 'packed' blocks are allowed to be considered inactive.
if (!block.staticUse && block.layout == sh::BLOCKLAYOUT_PACKED)
if (!IsActiveInterfaceBlock(block))
continue;
if (visitedList.count(block.name) > 0)
......
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