aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickimageparticle_p.h
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2020-11-09 14:44:16 +0200
committerKaj Grönholm <kaj.gronholm@qt.io>2020-11-11 20:25:23 +0200
commit4771072d3c3bc2393f5bd3862375788cf154329b (patch)
treea3dbc5eb4a1c1cc79d8abd646994104da161bb4d /src/particles/qquickimageparticle_p.h
parentfdbb97ff192756e7bd2d3595b0334d85b237d303 (diff)
Add simpler non point particle level
Add one more PerformanceLevel which is similar to Color, except it draws using triangles instead of points. This is optimal for d3d11 which doesn't support VertexShaderPointSize. Also rename first levels to *Point to be clear. Testing this on my windows laptop shows ~15% decrease in RAM usage for imageparticle/colored example. Task-number: QTBUG-88294 Change-Id: Ib93bc9fd0d2ef4f1cb8e0d9dcba0db652f288398 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/particles/qquickimageparticle_p.h')
-rw-r--r--src/particles/qquickimageparticle_p.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/particles/qquickimageparticle_p.h b/src/particles/qquickimageparticle_p.h
index 894d31c300..78e914ec4c 100644
--- a/src/particles/qquickimageparticle_p.h
+++ b/src/particles/qquickimageparticle_p.h
@@ -69,7 +69,7 @@ class QQuickStochasticEngine;
class QRhi;
-struct SimpleVertex {
+struct SimplePointVertex {
float x;
float y;
float t;
@@ -82,6 +82,21 @@ struct SimpleVertex {
float ay;
};
+struct ColoredPointVertex {
+ float x;
+ float y;
+ float t;
+ float lifeSpan;
+ float size;
+ float endSize;
+ float vx;
+ float vy;
+ float ax;
+ float ay;
+ Color4ub color;
+};
+
+// Like Colored, but using DrawTriangles instead of DrawPoints
struct ColoredVertex {
float x;
float y;
@@ -94,6 +109,9 @@ struct ColoredVertex {
float ax;
float ay;
Color4ub color;
+ uchar tx;
+ uchar ty;
+ uchar _padding[2]; // feel free to use
};
struct DeformableVertex {
@@ -224,7 +242,8 @@ public:
enum PerformanceLevel{//TODO: Expose?
Unknown = 0,
- Simple,
+ SimplePoint,
+ ColoredPoint,
Colored,
Deformable,
Tabled,