summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInho Lee <inho.lee@qt.io>2023-04-19 13:25:40 +0200
committerInho Lee <inho.lee@qt.io>2023-04-20 07:33:33 +0200
commitae363c23a48b817edb4a46e067437262edb7fa86 (patch)
treef55154f4f89f1f1e125a223dfd163e3780904579
parent9a21c69f67110e84c01645564cecce7099600152 (diff)
downloadqt3d-ae363c23a48b817edb4a46e067437262edb7fa86.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 Pick-to: 6.5 Change-Id: Ib0748f5b0476543ecd2e42252c434bcf4b371786 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-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;
};