Commit cd3acf67 by Qin Jiajia Committed by Commit Bot

ES31: Update block members static use

BUG=angleproject:1920 TEST=angle_end2end_tests Change-Id: I90bcd3bf5a078623b3a739615fbc7b157b6fb94c Reviewed-on: https://chromium-review.googlesource.com/808144Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent f2f6d379
...@@ -209,7 +209,8 @@ class InterfaceBlockLinker : angle::NonCopyable ...@@ -209,7 +209,8 @@ class InterfaceBlockLinker : angle::NonCopyable
const std::string &mappedPrefix, const std::string &mappedPrefix,
int blockIndex, int blockIndex,
bool singleEntryForTopLevelArray, bool singleEntryForTopLevelArray,
int topLevelArraySize) const; int topLevelArraySize,
GLenum shaderType) const;
template <typename VarT> template <typename VarT>
void defineBlockMember(const GetBlockMemberInfo &getMemberInfo, void defineBlockMember(const GetBlockMemberInfo &getMemberInfo,
const VarT &field, const VarT &field,
...@@ -217,15 +218,20 @@ class InterfaceBlockLinker : angle::NonCopyable ...@@ -217,15 +218,20 @@ class InterfaceBlockLinker : angle::NonCopyable
const std::string &fullMappedName, const std::string &fullMappedName,
int blockIndex, int blockIndex,
bool singleEntryForTopLevelArray, bool singleEntryForTopLevelArray,
int topLevelArraySize) const; int topLevelArraySize,
GLenum shaderType) const;
virtual void defineBlockMemberImpl(const sh::ShaderVariable &field, virtual void defineBlockMemberImpl(const sh::ShaderVariable &field,
const std::string &fullName, const std::string &fullName,
const std::string &fullMappedName, const std::string &fullMappedName,
int blockIndex, int blockIndex,
const sh::BlockMemberInfo &memberInfo, const sh::BlockMemberInfo &memberInfo,
int topLevelArraySize) const = 0; int topLevelArraySize,
GLenum shaderType) const = 0;
virtual size_t getCurrentBlockMemberIndex() const = 0; virtual size_t getCurrentBlockMemberIndex() const = 0;
virtual void updateBlockMemberStaticUsedImpl(const std::string &fullName,
GLenum shaderType,
bool staticUse) const = 0;
using ShaderBlocks = std::pair<GLenum, const std::vector<sh::InterfaceBlock> *>; using ShaderBlocks = std::pair<GLenum, const std::vector<sh::InterfaceBlock> *>;
std::vector<ShaderBlocks> mShaderBlocks; std::vector<ShaderBlocks> mShaderBlocks;
...@@ -241,7 +247,8 @@ class InterfaceBlockLinker : angle::NonCopyable ...@@ -241,7 +247,8 @@ class InterfaceBlockLinker : angle::NonCopyable
const std::string &mappedPrefix, const std::string &mappedPrefix,
int blockIndex, int blockIndex,
bool singleEntryForTopLevelArray, bool singleEntryForTopLevelArray,
int topLevelArraySize) const; int topLevelArraySize,
GLenum shaderType) const;
}; };
class UniformBlockLinker final : public InterfaceBlockLinker class UniformBlockLinker final : public InterfaceBlockLinker
...@@ -257,8 +264,12 @@ class UniformBlockLinker final : public InterfaceBlockLinker ...@@ -257,8 +264,12 @@ class UniformBlockLinker final : public InterfaceBlockLinker
const std::string &fullMappedName, const std::string &fullMappedName,
int blockIndex, int blockIndex,
const sh::BlockMemberInfo &memberInfo, const sh::BlockMemberInfo &memberInfo,
int topLevelArraySize) const override; int topLevelArraySize,
GLenum shaderType) const override;
size_t getCurrentBlockMemberIndex() const override; size_t getCurrentBlockMemberIndex() const override;
void updateBlockMemberStaticUsedImpl(const std::string &fullName,
GLenum shaderType,
bool staticUse) const override;
std::vector<LinkedUniform> *mUniformsOut; std::vector<LinkedUniform> *mUniformsOut;
}; };
...@@ -275,8 +286,12 @@ class ShaderStorageBlockLinker final : public InterfaceBlockLinker ...@@ -275,8 +286,12 @@ class ShaderStorageBlockLinker final : public InterfaceBlockLinker
const std::string &fullMappedName, const std::string &fullMappedName,
int blockIndex, int blockIndex,
const sh::BlockMemberInfo &memberInfo, const sh::BlockMemberInfo &memberInfo,
int topLevelArraySize) const override; int topLevelArraySize,
GLenum shaderType) const override;
size_t getCurrentBlockMemberIndex() const override; size_t getCurrentBlockMemberIndex() const override;
void updateBlockMemberStaticUsedImpl(const std::string &fullName,
GLenum shaderType,
bool staticUse) const override;
std::vector<BufferVariable> *mBufferVariablesOut; std::vector<BufferVariable> *mBufferVariablesOut;
}; };
......
...@@ -660,10 +660,9 @@ TEST_P(ProgramInterfaceTestES31, GetBufferVariableProperties) ...@@ -660,10 +660,9 @@ TEST_P(ProgramInterfaceTestES31, GetBufferVariableProperties)
EXPECT_EQ(14, params[5]); // name_length EXPECT_EQ(14, params[5]); // name_length
EXPECT_LE(0, params[6]); // offset EXPECT_LE(0, params[6]); // offset
// TODO(jiajia.qin@intel.com): Enable them once the block member staticUse are implemented. EXPECT_EQ(1, params[7]); // referenced_by_vertex_shader
// EXPECT_EQ(1, params[7]); // referenced_by_vertex_shader EXPECT_EQ(1, params[8]); // referenced_by_fragment_shader
// EXPECT_EQ(1, params[8]); // referenced_by_fragment_shader EXPECT_EQ(0, params[9]); // referenced_by_compute_shader
// EXPECT_EQ(0, params[9]); // referenced_by_compute_shader
EXPECT_EQ(1, params[10]); // top_level_array_size EXPECT_EQ(1, params[10]); // top_level_array_size
EXPECT_LE(0, params[11]); // top_level_array_stride EXPECT_LE(0, params[11]); // top_level_array_stride
...@@ -691,10 +690,9 @@ TEST_P(ProgramInterfaceTestES31, GetBufferVariableProperties) ...@@ -691,10 +690,9 @@ TEST_P(ProgramInterfaceTestES31, GetBufferVariableProperties)
EXPECT_EQ(8, params[5]); // name_length EXPECT_EQ(8, params[5]); // name_length
EXPECT_LE(0, params[6]); // offset EXPECT_LE(0, params[6]); // offset
// TODO(jiajia.qin@intel.com): Enable them once the block member staticUse are implemented. EXPECT_EQ(1, params[7]); // referenced_by_vertex_shader
// EXPECT_EQ(1, params[7]); // referenced_by_vertex_shader EXPECT_EQ(0, params[8]); // referenced_by_fragment_shader
// EXPECT_EQ(0, params[8]); // referenced_by_fragment_shader EXPECT_EQ(0, params[9]); // referenced_by_compute_shader
// EXPECT_EQ(0, params[9]); // referenced_by_compute_shader
EXPECT_EQ(2, params[10]); // top_level_array_size EXPECT_EQ(2, params[10]); // top_level_array_size
EXPECT_EQ(80, params[11]); // top_level_array_stride EXPECT_EQ(80, params[11]); // top_level_array_stride
......
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