PDA

View Full Version : Constant buffer data only partially available in #version 440



ParticlePeter
04-13-2015, 03:42 AM
I use a constant buffer for camera and timing data with four mat4x4 and some additional floats. This buffer worked perfectly with glsl #version 330 in the past. My current system ( Kaveri 7800 ) driver fully implements is OpenGL 4.4, but with glsl #version 440 only the first mt4x4 ( which is the MVP Matrix ) "works". The other data fields do not transform anything, the floats seem to be 0.0, assuming KHR_DEBUG informs me about nans and no errors are reported.
I tried using #version 430 and everything worked as with version #330 and as expected.

Have I missed something #version 440 related or can I assume ( and should I report ) a driver bug ?

Alfonse Reinheart
04-13-2015, 06:27 AM
assuming KHR_DEBUG informs me about nans

It does not and cannot. Buffer objects are unformatted memory, so there's no way for the implementation to know what 4 bytes you intend to interpret as floats or ints.


I tried using #version 430 and everything worked as with version #330 and as expected.

So you're saying that the exact same code on the exact same hardware works just by changing the shader's version number?

ParticlePeter
04-13-2015, 08:30 AM
It does not and cannot. Buffer objects are unformatted memory, so there's no way for the implementation to know what 4 bytes you intend to interpret as floats or ints.

Thanks for clarifying, I just started to use 4.x and KHR_DEBUG.


So you're saying that the exact same code on the exact same hardware works just by changing the shader's version number?

Yes, exactly. And my hardware is capable of the higher version.

Firadeoclus
04-14-2015, 04:29 AM
What layout qualifiers are you using? What memory layout do you use for the buffer?

ParticlePeter
04-14-2015, 08:28 AM
What layout qualifiers are you using? What memory layout do you use for the buffer?

layout std140