Quantcast
Channel: AMD Developer Forums: Message List - OpenGL & Vulkan
Viewing all articles
Browse latest Browse all 631

Catalyst 13.1 Legacy: possible ubo/struct bug

$
0
0

Create a shader, for example:

 

#version 330 core
...

struct Something {
...
    float a;    float b;    float c;
...
};

uniform wonderful {    layout(...) mat4 has;   layout(...) mat4 happend;  Somethig dontPanik;
};
...

 

If you try to retrieve the offsets with:

glGetActiveUniformsiv(programId, UBO_SIZE, uboIndices, GL_UNIFORM_OFFSET, uboOffsets);

 

All floats are assigned to the same offset.

 

if you change the struct(alternate floats with other types of  length >1):

 

struct SomethingElse {

...

    float a;

    vec3 we;

    float b;

    vec3 dontSink;

    float c;

    vec3 atlantisWest;

...

};

 

the floats are accessible.

 

Also glBufferSubData is  slow in this context (compared to a competing product).


Viewing all articles
Browse latest Browse all 631

Trending Articles