summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInho Lee <inho.lee@qt.io>2023-04-19 13:25:40 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-04-20 07:02:58 +0000
commit25aafdf6bf7765d6b295ebea5b2473a2cf0c4544 (patch)
treea66f8df0e977cff482fa7b5e888d4e9ab27b8a6a
parent82cb267d7b7d061dc9268a30dbeb035c31ffcfe3 (diff)
downloadqt3d-25aafdf6bf7765d6b295ebea5b2473a2cf0c4544.tar.gz
Make 'struct Light' to support std140
Properties' offsets are not properly set for std140 standard. And they are not compatible to what the host machine supposes. Since the layout can be translated differently according to the graphics backend, it's safe to add paddings. Fixes: QTBUG-110128 Change-Id: Ib0748f5b0476543ecd2e42252c434bcf4b371786 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit ae363c23a48b817edb4a46e067437262edb7fa86) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/extras/shaders/rhi/gooch.frag5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/extras/shaders/rhi/gooch.frag b/src/extras/shaders/rhi/gooch.frag
index cfa40a17a..c7304a094 100644
--- a/src/extras/shaders/rhi/gooch.frag
+++ b/src/extras/shaders/rhi/gooch.frag
@@ -50,14 +50,17 @@ const int TYPE_DIRECTIONAL = 1;
const int TYPE_SPOT = 2;
struct Light {
- int type;
vec3 position;
+ int type;
vec3 color;
float intensity;
vec3 direction;
float constantAttenuation;
+ vec3 padding0;
float linearAttenuation;
+ vec3 padding1;
float quadraticAttenuation;
+ vec3 padding2;
float cutOffAngle;
};