mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
ANGLE: Initialize uniform blocks before detaching shaders
This resolves #668
This commit is contained in:
parent
9724a0f080
commit
a7f344c724
3 changed files with 11 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,10 @@ class ProgramImpl : angle::NonCopyable
|
|||
GLint components,
|
||||
const GLfloat *coeffs) = 0;
|
||||
|
||||
virtual void assignUniformBlockRegisters()
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
const gl::ProgramState &mState;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue