mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 09:24:06 +02:00
fixes for glsl mac
This commit is contained in:
parent
d3edd14638
commit
d7ad5a35d6
2 changed files with 14 additions and 13 deletions
|
@ -494,13 +494,13 @@ void GLBackend::do_setUniformBuffer(Batch& batch, uint32 paramOffset) {
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
GLfloat* data = (GLfloat*) (uniformBuffer->getData() + rangeStart);
|
GLfloat* data = (GLfloat*) (uniformBuffer->getData() + rangeStart);
|
||||||
glUniform4fv(slot, rangeSize / sizeof(GLfloat[4]), data);
|
glUniform4fv(slot, rangeSize / sizeof(GLfloat[4]), data);
|
||||||
|
|
||||||
|
// NOT working so we ll stick to the uniform float array until we move to core profile
|
||||||
|
// GLuint bo = getBufferID(*uniformBuffer);
|
||||||
|
//glUniformBufferEXT(_shader._program, slot, bo);
|
||||||
#else
|
#else
|
||||||
GLuint bo = getBufferID(*uniformBuffer);
|
GLuint bo = getBufferID(*uniformBuffer);
|
||||||
glBindBufferRange(GL_UNIFORM_BUFFER, slot, bo, rangeStart, rangeSize);
|
glBindBufferRange(GL_UNIFORM_BUFFER, slot, bo, rangeStart, rangeSize);
|
||||||
|
|
||||||
// glUniformBufferEXT(_shader._program, slot, bo);
|
|
||||||
|
|
||||||
//glBindBufferBase(GL_UNIFORM_BUFFER, slot, bo);
|
|
||||||
#endif
|
#endif
|
||||||
CHECK_GL_ERROR();
|
CHECK_GL_ERROR();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,17 @@ Material getMaterial() {
|
||||||
Material mat;
|
Material mat;
|
||||||
mat._diffuse = materialBuffer[0];
|
mat._diffuse = materialBuffer[0];
|
||||||
mat._specular = materialBuffer[1];
|
mat._specular = materialBuffer[1];
|
||||||
return mat;
|
return mat;
|
||||||
}
|
}
|
||||||
|
<!/* tryed and failed...
|
||||||
|
bindable uniform struct {
|
||||||
|
Material mat;
|
||||||
|
} materialBuffer;
|
||||||
|
|
||||||
|
Material getMaterial() {
|
||||||
|
return materialBuffer.mat;
|
||||||
|
}
|
||||||
|
*/!>
|
||||||
<@else@>
|
<@else@>
|
||||||
uniform vec4 materialBuffer[2];
|
uniform vec4 materialBuffer[2];
|
||||||
Material getMaterial() {
|
Material getMaterial() {
|
||||||
|
@ -48,14 +57,6 @@ Material getMaterial() {
|
||||||
}
|
}
|
||||||
<@endif@>
|
<@endif@>
|
||||||
|
|
||||||
<!/*
|
|
||||||
bindable uniform struct {
|
|
||||||
Material mat;
|
|
||||||
} materialBuffer;
|
|
||||||
|
|
||||||
Material getMaterial() {
|
|
||||||
return materialBuffer.mat;
|
|
||||||
}
|
|
||||||
*/!>
|
|
||||||
|
|
||||||
<@endif@>
|
<@endif@>
|
Loading…
Reference in a new issue