fixes for glsl mac

This commit is contained in:
dev 2015-01-13 18:24:32 -08:00
parent d3edd14638
commit d7ad5a35d6
2 changed files with 14 additions and 13 deletions
libraries
gpu/src/gpu
render-utils/src

View file

@ -494,13 +494,13 @@ void GLBackend::do_setUniformBuffer(Batch& batch, uint32 paramOffset) {
#if defined(Q_OS_MAC)
GLfloat* data = (GLfloat*) (uniformBuffer->getData() + rangeStart);
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
GLuint bo = getBufferID(*uniformBuffer);
glBindBufferRange(GL_UNIFORM_BUFFER, slot, bo, rangeStart, rangeSize);
// glUniformBufferEXT(_shader._program, slot, bo);
//glBindBufferBase(GL_UNIFORM_BUFFER, slot, bo);
#endif
CHECK_GL_ERROR();
}

View file

@ -36,8 +36,17 @@ Material getMaterial() {
Material mat;
mat._diffuse = materialBuffer[0];
mat._specular = materialBuffer[1];
return mat;
return mat;
}
<!/* tryed and failed...
bindable uniform struct {
Material mat;
} materialBuffer;
Material getMaterial() {
return materialBuffer.mat;
}
*/!>
<@else@>
uniform vec4 materialBuffer[2];
Material getMaterial() {
@ -48,14 +57,6 @@ Material getMaterial() {
}
<@endif@>
<!/*
bindable uniform struct {
Material mat;
} materialBuffer;
Material getMaterial() {
return materialBuffer.mat;
}
*/!>
<@endif@>