Bug 1405600 - Part 1: Initialize uniform blocks before detaching shaders; r=jgilbert

ANLGE has resolved this issue at 753521

MozReview-Commit-ID: 4fQ1XuGxWLn

--HG--
extra : rebase_source : f82449ebce036a646a0e9281f9cfec4d1b5a9a47
This commit is contained in:
Daosheng Mu 2017-10-30 17:34:37 +08:00
Родитель 93fb9c8b32
Коммит 03cbcf3594
3 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -817,6 +817,12 @@ Error Program::link(const gl::Context *context)
cache->putProgram(programHash, context, this);
}
// Because we do lazy init in ensureUniformBlocksInitialized,
// 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->ensureUniformBlocksInitialized();
double delta = platform->currentTime(platform) - startTime;
int us = static_cast<int>(delta * 1000000.0);
ANGLE_HISTOGRAM_COUNTS("GPU.ANGLE.ProgramCache.ProgramCacheMissTimeUS", us);

Просмотреть файл

@ -110,6 +110,10 @@ class ProgramImpl : angle::NonCopyable
{
}
virtual void ensureUniformBlocksInitialized()
{
}
protected:
const gl::ProgramState &mState;
};

Просмотреть файл

@ -270,6 +270,7 @@ class ProgramD3D : public ProgramImpl
void getUniformuiv(const gl::Context *context, GLint location, GLuint *params) const override;
void setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) override;
void ensureUniformBlocksInitialized() override;
UniformStorageD3D &getVertexUniformStorage() const { return *mVertexUniformStorage.get(); }
UniformStorageD3D &getFragmentUniformStorage() const { return *mFragmentUniformStorage.get(); }
@ -428,7 +429,6 @@ class ProgramD3D : public ProgramImpl
void initAttribLocationsToD3DSemantic(const gl::Context *context);
void reset();
void ensureUniformBlocksInitialized();
void initUniformBlockInfo(const gl::Context *context, gl::Shader *shader);
size_t getUniformBlockInfo(const sh::InterfaceBlock &interfaceBlock);