diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-12-10 10:52:03 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-12-10 17:37:28 +0100 |
commit | e6de661a8aa96b5905ea7ba4cd5d76bd06da3f93 (patch) | |
tree | 20be8035996ad6a9fb78f18dd25abd7670aceb15 /tests/manual/corelib/tools/qset/main.cpp | |
parent | 53804f553d446c962764ba3365a8b390436fceb4 (diff) |
rhi: gl: Handle struct and array of struct uniforms
We have intentionally limited support for advanced things like
arrays in a uniform block. There is one very common case however:
a one dimensional array of a struct.
Typical example for Qt Quick 3D:
struct LightSource
{
vec4 position;
...
};
layout (std140, binding = 1) uniform cbBufferLights
{
int uNumLights;
LightSource lights[MAX_NUM_LIGHTS];
};
With GLSL (uniform blocks disabled) this gets turned into two structs
where one has a 'lights' member that is an array of the other struct.
Teach the OpenGL backend of QRhi how to handle this.
This makes the QRhi port of Qt Quick3D functional with the OpenGL
backend as well.
Change-Id: I6a09b93276794f7ecdd38f5bfbd3491a9ef58146
Fixes: QTBUG-80628
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'tests/manual/corelib/tools/qset/main.cpp')
0 files changed, 0 insertions, 0 deletions