mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-24 00:54:26 +02:00
Addressing review comments
This commit is contained in:
parent
351f619555
commit
fd501cf3af
3 changed files with 7 additions and 1 deletions
|
@ -71,6 +71,9 @@ GLShader* GLBackend::compileBackendShader(const Shader& shader, Shader::Compilat
|
||||||
if (handler) {
|
if (handler) {
|
||||||
bool retest = true;
|
bool retest = true;
|
||||||
std::string currentSrc = shaderSource;
|
std::string currentSrc = shaderSource;
|
||||||
|
// When a Handler is specified, we can try multiple times to build the shader and let the handler change the source if the compilation fails.
|
||||||
|
// The retest bool is set to false as soon as the compilation succeed to wexit the while loop.
|
||||||
|
// The handler tells us if we should retry or not while returning a modified version of the source.
|
||||||
while (retest) {
|
while (retest) {
|
||||||
bool result = ::gl::compileShader(shaderDomain, currentSrc, shaderDefines, shaderObject.glshader, compilationLogs[version].message);
|
bool result = ::gl::compileShader(shaderDomain, currentSrc, shaderDefines, shaderObject.glshader, compilationLogs[version].message);
|
||||||
compilationLogs[version].compiled = result;
|
compilationLogs[version].compiled = result;
|
||||||
|
|
|
@ -74,6 +74,9 @@ GLShader* GLBackend::compileBackendShader(const Shader& shader, Shader::Compilat
|
||||||
if (handler) {
|
if (handler) {
|
||||||
bool retest = true;
|
bool retest = true;
|
||||||
std::string currentSrc = shaderSource;
|
std::string currentSrc = shaderSource;
|
||||||
|
// When a Handler is specified, we can try multiple times to build the shader and let the handler change the source if the compilation fails.
|
||||||
|
// The retest bool is set to false as soon as the compilation succeed to wexit the while loop.
|
||||||
|
// The handler tells us if we should retry or not while returning a modified version of the source.
|
||||||
while (retest) {
|
while (retest) {
|
||||||
bool result = ::gl::compileShader(shaderDomain, currentSrc, shaderDefines, shaderObject.glshader, compilationLogs[version].message);
|
bool result = ::gl::compileShader(shaderDomain, currentSrc, shaderDefines, shaderObject.glshader, compilationLogs[version].message);
|
||||||
compilationLogs[version].compiled = result;
|
compilationLogs[version].compiled = result;
|
||||||
|
|
|
@ -253,7 +253,7 @@ protected:
|
||||||
|
|
||||||
static ShaderPointer createOrReuseDomainShader(Type type, const Source& source);
|
static ShaderPointer createOrReuseDomainShader(Type type, const Source& source);
|
||||||
|
|
||||||
using ProgramMapKey = glm::uvec3; // THe IDs of the shaders in a progrma make its key
|
using ProgramMapKey = glm::uvec3; // The IDs of the shaders in a program make its key
|
||||||
class ProgramKeyLess {
|
class ProgramKeyLess {
|
||||||
public:
|
public:
|
||||||
bool operator() (const ProgramMapKey& l, const ProgramMapKey& r) const {
|
bool operator() (const ProgramMapKey& l, const ProgramMapKey& r) const {
|
||||||
|
|
Loading…
Reference in a new issue