mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
FIxed the problem on Mac, by removing all of the gpuConfig includesgit status
q :q wq
This commit is contained in:
parent
14f4c9c6c0
commit
fbf21cb089
4 changed files with 25 additions and 16 deletions
|
@ -27,7 +27,7 @@ class GLBackend : public Backend {
|
|||
friend class Context;
|
||||
static void init();
|
||||
static Backend* createBackend();
|
||||
static bool makeProgram(Shader& shader, const Shader::BindingSet& bindings = Shader::BindingSet());
|
||||
static bool makeProgram(Shader& shader, const Shader::BindingSet& bindings);
|
||||
|
||||
explicit GLBackend(bool syncCache);
|
||||
GLBackend();
|
||||
|
@ -95,9 +95,9 @@ public:
|
|||
|
||||
#if (GPU_TRANSFORM_PROFILE == GPU_CORE)
|
||||
#else
|
||||
GLuint _transformObject_model = -1;
|
||||
GLuint _transformCamera_viewInverse = -1;
|
||||
GLuint _transformCamera_viewport = -1;
|
||||
GLint _transformObject_model = -1;
|
||||
GLint _transformCamera_viewInverse = -1;
|
||||
GLint _transformCamera_viewport = -1;
|
||||
#endif
|
||||
|
||||
GLShader();
|
||||
|
|
|
@ -541,7 +541,12 @@ ElementResource getFormatFromGLUniform(GLenum gltype) {
|
|||
};
|
||||
|
||||
|
||||
int makeUniformSlots(GLuint glprogram, const Shader::BindingSet& slotBindings, Shader::SlotSet& uniforms, Shader::SlotSet& textures, Shader::SlotSet& samplers) {
|
||||
int makeUniformSlots(GLuint glprogram, const Shader::BindingSet& slotBindings,
|
||||
Shader::SlotSet& uniforms, Shader::SlotSet& textures, Shader::SlotSet& samplers
|
||||
#if (GPU_FEATURE_PROFILE == GPU_LEGACY)
|
||||
, Shader::SlotSet& fakeBuffers
|
||||
#endif
|
||||
) {
|
||||
GLint uniformsCount = 0;
|
||||
|
||||
#if (GPU_FEATURE_PROFILE == GPU_LEGACY)
|
||||
|
@ -582,6 +587,15 @@ int makeUniformSlots(GLuint glprogram, const Shader::BindingSet& slotBindings, S
|
|||
}
|
||||
|
||||
if (elementResource._resource == Resource::BUFFER) {
|
||||
#if (GPU_FEATURE_PROFILE == GPU_LEGACY)
|
||||
// if in legacy profile, we fake the uniform buffer with an array
|
||||
// this is where we detect it assuming it's explicitely assinged a binding
|
||||
auto requestedBinding = slotBindings.find(std::string(sname));
|
||||
if (requestedBinding != slotBindings.end()) {
|
||||
// found one buffer!
|
||||
fakeBuffers.insert(Shader::Slot(sname, location, elementResource._element, elementResource._resource));
|
||||
}
|
||||
#endif
|
||||
uniforms.insert(Shader::Slot(sname, location, elementResource._element, elementResource._resource));
|
||||
} else {
|
||||
// For texture/Sampler, the location is the actual binding value
|
||||
|
@ -736,8 +750,12 @@ bool GLBackend::makeProgram(Shader& shader, const Shader::BindingSet& slotBindin
|
|||
Shader::SlotSet uniforms;
|
||||
Shader::SlotSet textures;
|
||||
Shader::SlotSet samplers;
|
||||
#if (GPU_FEATURE_PROFILE == GPU_CORE)
|
||||
makeUniformSlots(object->_program, slotBindings, uniforms, textures, samplers);
|
||||
|
||||
#else
|
||||
makeUniformSlots(object->_program, slotBindings, uniforms, textures, samplers, buffers);
|
||||
#endif
|
||||
|
||||
Shader::SlotSet inputs;
|
||||
makeInputSlots(object->_program, slotBindings, inputs);
|
||||
|
||||
|
|
|
@ -614,13 +614,8 @@ void DeferredLightingEffect::loadLightProgram(const char* vertSource, const char
|
|||
locations.texcoordMat = program->getUniforms().findLocation("texcoordMat");
|
||||
locations.coneParam = program->getUniforms().findLocation("coneParam");
|
||||
|
||||
#if (GPU_FEATURE_PROFILE == GPU_CORE)
|
||||
locations.lightBufferUnit = program->getBuffers().findLocation("lightBuffer");
|
||||
locations.atmosphereBufferUnit = program->getBuffers().findLocation("atmosphereBufferUnit");
|
||||
#else
|
||||
locations.lightBufferUnit = program->getUniforms().findLocation("lightBuffer");
|
||||
locations.atmosphereBufferUnit = program->getUniforms().findLocation("atmosphereBufferUnit");
|
||||
#endif
|
||||
|
||||
auto state = std::make_shared<gpu::State>();
|
||||
if (lightVolume) {
|
||||
|
|
|
@ -187,13 +187,9 @@ void Model::RenderPipelineLib::initLocations(gpu::ShaderPointer& program, Model:
|
|||
locations.specularTextureUnit = program->getTextures().findLocation("specularMap");
|
||||
locations.emissiveTextureUnit = program->getTextures().findLocation("emissiveMap");
|
||||
|
||||
#if (GPU_FEATURE_PROFILE == GPU_CORE)
|
||||
locations.materialBufferUnit = program->getBuffers().findLocation("materialBuffer");
|
||||
locations.lightBufferUnit = program->getBuffers().findLocation("lightBuffer");
|
||||
#else
|
||||
locations.materialBufferUnit = program->getUniforms().findLocation("materialBuffer");
|
||||
locations.lightBufferUnit = program->getUniforms().findLocation("lightBuffer");
|
||||
#endif
|
||||
|
||||
locations.clusterMatrices = program->getUniforms().findLocation("clusterMatrices");
|
||||
|
||||
locations.clusterIndices = program->getInputs().findLocation("clusterIndices");;
|
||||
|
|
Loading…
Reference in a new issue