summaryrefslogtreecommitdiffstats
path: root/gfx/angle
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/angle')
-rwxr-xr-xgfx/angle/src/libANGLE/Program.cpp6
-rwxr-xr-xgfx/angle/src/libANGLE/renderer/ProgramImpl.h4
-rwxr-xr-xgfx/angle/src/libANGLE/renderer/d3d/ProgramD3D.h2
3 files changed, 11 insertions, 1 deletions
diff --git a/gfx/angle/src/libANGLE/Program.cpp b/gfx/angle/src/libANGLE/Program.cpp
index 7f4226da1..49a0f9a33 100755
--- a/gfx/angle/src/libANGLE/Program.cpp
+++ b/gfx/angle/src/libANGLE/Program.cpp
@@ -679,6 +679,12 @@ Error Program::link(const ContextState &data)
gatherInterfaceBlockInfo();
+ // Because we do lazy init in assignUniformBlockRegisters,
+ // we must initialize them when linking shaders,
+ // otherwise, we will have no shaders for getting uniform blocks
+ // information from shaders when doing draw calls.
+ mProgram->assignUniformBlockRegisters();
+
mLinked = true;
return NoError();
}
diff --git a/gfx/angle/src/libANGLE/renderer/ProgramImpl.h b/gfx/angle/src/libANGLE/renderer/ProgramImpl.h
index 45ff0a05a..e62623a8d 100755
--- a/gfx/angle/src/libANGLE/renderer/ProgramImpl.h
+++ b/gfx/angle/src/libANGLE/renderer/ProgramImpl.h
@@ -86,6 +86,10 @@ class ProgramImpl : angle::NonCopyable
GLint components,
const GLfloat *coeffs) = 0;
+ virtual void assignUniformBlockRegisters()
+ {
+ }
+
protected:
const gl::ProgramState &mState;
};
diff --git a/gfx/angle/src/libANGLE/renderer/d3d/ProgramD3D.h b/gfx/angle/src/libANGLE/renderer/d3d/ProgramD3D.h
index 88fe4020d..01f3973c5 100755
--- a/gfx/angle/src/libANGLE/renderer/d3d/ProgramD3D.h
+++ b/gfx/angle/src/libANGLE/renderer/d3d/ProgramD3D.h
@@ -231,6 +231,7 @@ class ProgramD3D : public ProgramImpl
const GLfloat *value);
void setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) override;
+ void assignUniformBlockRegisters() override;
const UniformStorageD3D &getVertexUniformStorage() const { return *mVertexUniformStorage; }
const UniformStorageD3D &getFragmentUniformStorage() const { return *mFragmentUniformStorage; }
@@ -350,7 +351,6 @@ class ProgramD3D : public ProgramImpl
void initAttribLocationsToD3DSemantic();
void reset();
- void assignUniformBlockRegisters();
void initUniformBlockInfo();
size_t getUniformBlockInfo(const sh::InterfaceBlock &interfaceBlock);