Commit Graph

53 Commits

Author SHA1 Message Date
Laszlo Agocs a2e92f6dee Dynamic GL in Quick
The counterpart to I716fdebb. Implements the dynamic path
in scenegraph.

Task-number: QTBUG-36483
Change-Id: I2dc613ba84560b7b8e36d3cd1da61c050ab08db0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-03-18 21:00:00 +01:00
Michael Brasser 3affc261aa Use stable sort when cleaning batches.
Ensure valid batches do not change order. This was causing rendering
issues when m_rebuild was 0, as we would not re-sort the list in correct
render order after cleanup.

Change-Id: I912fb313d4029f96e263fad24d68462f252003df
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-03-15 14:34:06 +01:00
Gunnar Sletta fb1c775e2e Fix rendering issue with material changes from opaque <-> alpha
When I introduced the invalidation of z ranges, I forgot that we need
to rebuild render lists when nodes move from opaque to alpha batches
or vice versa as that sorting happens in buildRenderLists(). To remedy
this, make Batch::isMaterialCompatible report blending changes
separately and trigger a full rebuild in this case.

Task-number: QTBUG-37422
Change-Id: I020813cb531ed58353f8340fcad58dec8d7856dd
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2014-03-13 16:39:34 +01:00
Andrew Knight 3aa6a8b90f QSGBatchRenderer: return when a shader is not returned by the manager
If a shader can't be found from the manager (e.g., if it failed to link),
return from rendering. This prevents the renderer from crashing on a
null pointer.

Task-number: QTBUG-37290
Change-Id: I44d0bbb721854c0bc6da681ff55f71140a5cb0bc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-03-06 15:50:37 +01:00
Erik Verbruggen 7e87bf0bb7 Fix MSVC2012 compiler warnings.
Tested on both win32 and win64.

Change-Id: I47755e2da51829e61e1452eaaf84a057224b478b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-03-05 13:14:10 +01:00
Gunnar Sletta ba4419df92 Don't sort batches when there are no changes.
On node removal we change the batch, but don't set rebuild
as everything else should be drawn as is. A sort after such a removal
could result on the order of batches being changed without the other
nodes being updated. This would then result in incorrect ordering
and nodes could be obscured.

Task-number: QTBUG-37222

Change-Id: I57dd2fbc945e8c10c949743f59315b3372a4b6f4
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2014-03-05 03:52:36 +01:00
Sergio Ahumada e525b727f2 Fix some typos
Change-Id: Iea540b768232ea423ea7f04e41655198931cf36d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-03-03 17:39:17 +01:00
Simon Hausmann ba9ca0e3d6 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/qml/jsruntime/qv4functionobject.cpp
	src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h

Change-Id: Id164f6c3b45501aa466908659ec4e3b957323753
2014-02-18 09:58:57 +01:00
Ulf Hermann 9424383e6d Move QtQuick profiling to own profiler adapter
The QtQuick parts of the QML profiler service thus become a proper
global profiler which can be independently enabled and disabled.

Change-Id: Ifad03801cab2be66a264fc46fdebdae582fcc99b
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-02-15 22:37:38 +01:00
Michael Brasser ee039caf0e Ensure m_opacityChange is cleared at the beginning of each frame.
Change-Id: Ic5eb5e1955e09884f98975a8ac74b42f00e233d7
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-15 14:57:58 +01:00
Gunnar Sletta 586ebf6c55 Enable program binary support through QSGRenderContext API.
Change-Id: I4eecff3c8a2c727d38d394305d248eddeef87e8e
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2014-02-13 08:52:17 +01:00
Simon Hausmann 7c9497a6d4 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/qml/compiler/qv4ssa.cpp
	src/qml/jsruntime/qv4arrayobject.cpp
	src/qml/jsruntime/qv4context.cpp

Change-Id: Ied5b23bec4dc14abe51127c507aed668f855c1e1
2014-02-11 12:00:31 +01:00
Gunnar Sletta b70ab35b21 Avoid renderlist rebuilds in the scene graph renderer.
Transform, material, opacity and geometry changes all used to trigger
full rebuilds, which meant that very little geometry could be retained
between frames. For instance, a rotating spinner on top of a gridview
this would cause a full rebuild where nothing is retained.

This change introduces new concept to the renderer: partial rebuilding
based on render order ranges. Since the render order of nodes is
strictly defined by their position in the tree and nothing else, we
should use that for the majority of rebuilds. When a change comes in
for a node, we invalidate its batch and all batches which it has
overlapping render orders with.

Render order rebuilds only happen when nodes are added and removed.

Change-Id: Ib4cb284164892b409e3fff5c492a54d60a5de2d7
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2014-02-06 16:02:02 +01:00
Gunnar Sletta c6a516e95e Support batching of rotated antialiased elements.
Change-Id: I67d961f23941ba5cfa16fd679b609cd0fc3071c7
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-04 10:49:35 +01:00
Gunnar Sletta 3f8d5d0ad7 Visualization modes for rendering.
There are two ways of setting this right now. One is to set it on
startup using an environment varible.

QSG_VISUALIZE=

"batches" - Visualize batchtes in the renderer. Merged batches are
drawn with solid color and Unmerged batches are drawn with a diagonal
line pattern. Few unique colors means good batching. Unmerged batches
are bad if they contain many individual nodes.

"clip" - Visualize clipping as red areas on top of the scene.

"overdraw" - Visualize all items in 3D to highlight overdraws. This mode
can also be used to detect geometry outside the viewport to some
extent. Opaque items are rendered with a green tint while translucent
items are rendered with a red tint. The bounding box for the viewport
is rendered in blue.  Opaque content is easier for the scenegraph to
process and it can also be faster to render on some hardware.

"changes" - Changes in the scenegraph are visualized with a flashing
overlay with a random color. Changes on a primitive is visualized with
a solid color while changes in an ancestor, such as a matrix or
opacity changes is visualized with a pattern.

The second way to set the visualization mode is to set it at runtime
through QString QQuickWindowPrivate::customRenderMode. This "API" is
string based so it is not tied to the batch renderer and in theory can
support other custom renderers.

The visualized elements do not respect clipping and rendering order
is arbitrary.

Change-Id: I31efbe53fc905145bf48080ede3e36945cb60dcf
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2014-01-29 20:10:07 +01:00
Simon Hausmann 22041acdfe Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/imports/dialogs/qquickmessagedialog.cpp
	src/imports/dialogs/qquickmessagedialog_p.h
	src/qml/debugger/qqmlprofilerservice_p.h
	src/qml/jsruntime/qv4regexpobject.cpp
	tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro

Change-Id: Ic8a43366b44d6970966acbf03b206d0dee00c28d
2014-01-24 18:27:41 +01:00
Ulf Hermann 2ce7959eb9 Further pack messages for QQmlProfilerService
Allow multiple detailTypes in each packet and extend the profiling code
to make use of that. Note that this changes the usual order of
pixmapSizeKnown and PixmapLoadingFinished events. As far as I can see
this doesn't affect the QML profiler frontend and the order of these
events isn't specified anywhere.

Change-Id: Id39ad98594ccf35add4415e08daf9e92ab561237
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-01-22 18:10:19 +01:00
Gunnar Sletta abc1cb3272 Revert QSGRenderNode to the old "in context" behavior
There is already a lot of code out there that makes use
of the rendernode hook and some of it is not capable
of dealing with the render target being something other
than 0. (Mozilla in this case).

By forcing everything into the "alpha" code path, the
hit on the renderer should be fairly minimal as long as
render nodes are kept to a minimum, so reverting back
to the ugly old behavior is acceptable.

The API is still internal and highly discouraged.

Change-Id: Ie35484f52da6b0420257c95710fdda07a2be2c23
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-01-22 12:24:18 +01:00
Gunnar Sletta e7ad7739c4 Make it possible to render without a depth buffer.
Some GL implementations (especially on embedded) will give us an
OpenGL context without a depth buffer. In low memory scenarios, it
might also be feasible to request a non-depth buffer context to save
the depth buffer memory. The renderer deals with this by treating all
nodes as translucent, by not adjusting the shaders and by not creating
the extra z-order vertex attribute for merged nodes.

Change-Id: I8edc92d530daa3e2628df2ba52901b47d87eaf26
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-01-22 10:48:18 +01:00
Ulf Hermann a32bed7047 Unify calls to profiler service event methods.
Don't needlessly duplicate information about the profiler being available
and allow inlining. Use macros to check availability of the profiler
in calling code and generally simplify the code.

Task-number: QTBUG-35315
Change-Id: I0a9daec4a95f74b9db795ef2918a01fb772ea107
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-22 10:28:40 +01:00
Simon Hausmann f596553e03 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	.qmake.conf
	src/imports/dialogs/DefaultFileDialog.qml
	src/imports/widgets/qquickqfiledialog.cpp

Change-Id: I00de6dd05cb773f01254061d585a82c90b229acd
2014-01-17 07:12:23 +01:00
Simon Hausmann 7030adff18 Merge remote-tracking branch 'origin/release' into stable
Change-Id: Id18709cb0a4d85ffdadffa28aef98323367292d4
2014-01-16 21:53:57 +01:00
Gunnar Sletta c4b4324596 Revert "Support batching of rotated antialiased elements."
This patch broke scaled text rendering

This reverts commit 6acaa1c429.

Change-Id: I1f7a3ba0556f6d59bc1e28946631be2d9fc2b67d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-01-16 10:09:51 +01:00
Laszlo Agocs 662046fe17 Add support for a separate index buffer
The renderer binds same buffer both for vertex and index data.
This is allowed on desktop & ES but is forbidden in WebGL.
Add a compile-time flag to disable this optimization(?) and
force using a separate buffer for the index data.

Change-Id: I57c17c883a55e02513a8e4427efb202cafaaf37e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-15 10:45:05 +01:00
Frederik Gladhorn 679ea13790 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-01-14 20:04:43 +01:00
Alex Montgomery 20f533671a Use QSGGeometry::lineWidth() when drawing GL_POINTS
Since glLineWidth doesn't affect the drawing of GL_POINTS, it makes sense
to use the lineWidth member to affect point size when drawing points.

[ChangeLog][QtQuick][QSGGeometry] Changed QSGGeometry::lineWidth
to also affect point size (glPointSize) when drawing GL_POINTS, in
addition to the existing behavior of affecting line width when drawing
GL_LINES, GL_LINE_STRIP, and GL_LINE_LOOP.

Task-number: QTBUG-35772
Change-Id: I0ea73f9261509e8d356f91a063dc90dc0f8980bd
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-13 18:50:05 +01:00
Gunnar Sletta 6acaa1c429 Support batching of rotated antialiased elements.
Change-Id: I0522a23617c897aff01b7b50e0af98553374d792
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-01-10 08:16:44 +01:00
Gunnar Sletta f03de5497d Use qDebug for all debug under src/quick/scenegraph.
Mixing printf and qDebug can make the output come out of sync.

Change-Id: Ia71e71b09cb3bf651010eb2eb652db7899b07f0d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-01-07 14:44:32 +01:00
Torgeir Lilleskog 52dfe30201 Fix: QSGGeometry lineWidth in qsgbatchrenderer
lineWidth was ignored in the new scenegraph batchrenderer.
Regression from 5.1.1

Task-number: QTBUG-35346
Change-Id: I80eacc165f70b5f39d4a01cf458ab1a0e49cbd2d
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-12-06 13:12:58 +01:00
Gunnar Sletta 8029a015b4 Handle boundingboxes with NaN in them.
NaN does not compare well with other floats. The result is that the
bounding box is left at its initial values, FLT_MAX for top-left and
FLT_MIN for bottom-right. If so, treat geometry as invalid, aka
infinite.

Task-number: QTBUG-35192
Change-Id: I1df6987d56a0ce1f500b0eba344a5dcbc55f80a4
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2013-11-30 17:57:13 +01:00
Gunnar Sletta ccc0e75fb6 Fix stacking order bug in the renderer
Since we are sorting batches based on the zorder of the first element
it is crucial that we don't continue adding to batches once an overlap
with a compatible element is found.

Task-number: QTBUG-34864
Change-Id: Ic2194c5c17bba0bc9874a14e8a69c81bff75bd1c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-11-15 13:07:26 +01:00
Sean Harmer 3afffa47fe Adapt Qt Quick 2 renderer to work with OpenGL Core Profile
The basic approach is to have the batched renderer create and bind a
vertex array object if it detects we are using an OpenGL Core profile
context. The VAO is bound for the duration of the QQ2 renderer's
work cycle and unbound at the end so as to not interfere with any
other VAO's a user may wish to use.

All shaders have been copied and ported to be compliant with the
GLSL 150 core specification which is the minimum for a Core profile
context (OpenGL 3.2 Core). We are not using any newer features as
yet so this will work anywhere we can get a Core profile context.

The QSGShaderSourceBuilder class has been extended to resolve any
requests for shaders to the same basefilename with "_core"
appended prior to any file extension. This could be extended in
the future to allow version, or GPU or platform specific shaders.

The QSGShaderSourceBuilder has also been extended to allow it to
insert #define definitions in the prologue of a shader. Any such
definition is inserted:

* After the last #extension directive (if any are found)
* Otherwise after the #version directive (if found)
* Otherwise at the start of the shader source

This is required by the custom particle shaders which make
extensive use of such #defines.

In addition the mechanism used by the distance field glyph cache to
extend the cache with new glyphs has been modified to work (and
work more efficiently) when using a Core profile context.

Rather than using a shader program and a buffer filling quad to
blit the old texture into the new cache texture, we instead use
the technique of framebuffer blitting. The existing fallback
implementation using glTexSubImage2D() is still available if
needed.

The DECLARATIVE_EXAMPLE_MAIN macro has been extended to allow easy
testing of any of the QtDeclarative examples with a core profile
context. Just run the example with

QT_QUICK_CORE_PROFILE=1 ./text

for e.g. The only ones that may not work out of the box are those
that provide GLSL shader source e.g. the customparticles or
shader effect examples. These work fine if the shader source is
adapted to GLSL 150 core.

In the future it may be a good idea to expose some context property
to QML that the user can use to determine what shader source
variation to provide to Qt Quick. Along these lines it would also
be very nice to allow the provision of shader source to
ShaderEffect or CustomParticle from a separate source file just as
we now do within Qt Quick.

Task-number: QTBUG-32050
Change-Id: Ia6e9f06dbb8508af9ae03c6b60fb418b4cc9e41f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-11-13 23:42:13 +01:00
Gunnar Sletta 508ad2e9b3 Fix boundingbox calculation of rotated items.
Task-number: QTBUG-34328

Change-Id: If0202a67d95500333a0fb6f4ca3eb19ecb027770
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-11-12 18:20:30 +01:00
Gunnar Sletta 59fb0d88a0 Fix assert with native text rendering.
The renderer only passed the very first node's material to
updateState() as "new", yet pass the following node's materials to
updateState() as "old". This triggered an assert in the
QSGTextMaskMaterial's updateState as the native text nodes are invalid
until they get called with their own material as "new". This goes
against how the scene graph is supposed to be used, but update the
code in the renderer regardless as this used to work and the fix
there is not wrong.

Every node in a batch has identical material, so pass the same
instance for both "new" and "old" except for the first node
in the batch which gets old==0.

Change-Id: Ie8ae6fcd63adde08d80e9083e910836ede6694ee
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-11-09 22:46:47 +01:00
Gunnar Sletta afee694ce5 Avoid using huge floating point values in the renderer.
We pretransform vertices relative to their batch root and upload these
using single-precision floats. If the offsets are huge then the
floating point numbers start to get unstable and we get rendering
artifacts as a result. This typically happens for lists/tables with
huge models.

Task-number: QTBUG-34312
Change-Id: I2516f2b4fa93f44a1288659d05458fb1af0df943
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2013-11-09 22:46:47 +01:00
Gunnar Sletta 2b8dd86360 Tolerate NaN in the geometry without asserting
If we come across NaN geometry, we treat it as spanning
the entire viewport, similar to other geometries with
undefined geometry.

Task-number: QTBUG-34520
Change-Id: Ia4171f9f13d876c6c587043ad7decaa19bb85f01
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2013-11-04 22:00:14 +01:00
Gunnar Sletta 2192e5005b Fix rendering bug with batched translucent elements.
When one item in a batch of other translucent items would
change opacity, we need to rebuild batches under the current
root as all items in a batch are expected to have the same
opacity.

Task-number: QTBUG-34311
Change-Id: I2b9db19f05bd3a82be65cfa8a91e9398e8d58d0f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-11-01 11:59:53 +01:00
Sean Harmer 426f6aa672 Refactor shaders into seprate GLSL source files
The default implementation of QSGShaderMaterial::vertexShader() and
fragmentShader() now loads the GLSL source from a list of source files
that can be specified via the setShaderSourceFile() or
setShaderSourceFiles() functions.

Multiple shader source files for each shader stage are supported. Each
source file will be read in the order specified and concatenated
together before being compiled.

The other places where Qt Quick 2 loads shader source code have
been adapted to use the new QSGShaderSourceBuilder, which is also
used internally by QSGMaterial.

This puts Qt Quick 2 into a better state ready to support OpenGL
core profile and to load different shaders based upon OpenGL version,
profile, GPU vendor, platform, etc.

Change-Id: I1a66213c2ce788413168eb48c7bc5317e61988a2
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-10-31 12:54:28 +01:00
Gunnar Sletta 4a7f1326e3 Work around Nouveau driver bugs
Change-Id: I25311a2bd88f41087352e0a43ba505f4e27b7e85
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2013-10-30 15:18:33 +01:00
Gunnar Sletta 906d5c5c40 Use one render loop per QQuickWindow
See the task for the full reasoning behind this patch.

The threaded renderloop has been refactored to have one window per
thread. This is mostly a simplification of the current code path where
for loops over multiple windows are turned into if (window).

The QSGContext has been split into two classes, QSGRenderContext
for which there is one per OpenGLContext.

The rest of the patch is name changes and a couple of cleanups
in the hopes of simplifying this change.

Task-number: QTBUG-33993

Change-Id: I31c81f9694d7da7474a72333169be38de62613c4
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-10-30 08:29:49 +01:00
Gunnar Sletta 8d6500560e Fix rendernode bug and enable rendernode test.
The bug in the renderer was that the viewport was set before
we called the render node, leaving us with the viewport
set by the render node as opposed to the viewport of the
renderer.

The render node API is a crude and intrusive hack which was added for
webkit back in the day. With the introduction of webengine it becomes
less relevant, but it should still work.

Change-Id: I66a1e3047e018ad6c0bb28044851e9fc65da59cc
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-10-26 23:53:38 +02:00
Gunnar Sletta 48e32cfabe All matrices in a batch need to be 2D safe when merging.
If we merge geometry nodes that make actual use of the
z-coordinate, this information becomes lost when merging
and the result is that we end up with an arbitrary
wrongfully applied transformation to the merged element.

Task-number: QTBUG-33897
Change-Id: I6129243e9bb890949023c35dc6b7bce30d31709a
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-10-08 08:47:47 +02:00
Gunnar Sletta 9b82136534 Respect DirtyForceUpdate in QSGBatchRenderer.
There is a way this could have been done slightly more efficitently.
If we moved all "combined" logic out of the scene graph and into the
Node shadow tree, we could ignore the forceupdate all
together. However, this is a quite large change for what is currently
a non-common case. It would also increase overall memory consumption a
bit as we would have superfluous combined matrix and opacity in the
QSGNodes.

Task-number: QTBUG-33838
Change-Id: I06c486ace2be15bef1f1dc72a8b41cb649d7c813
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-10-04 15:28:20 +02:00
Gunnar Sletta 7959eca9f1 Invalidate the bounding rects when the roots change.
When roots change, matrices are updated in the nodes, so
we need to also invalidate the bounding rects for geometry
nodes.

Change-Id: I61f60ad069c3b1d018ce31c57310a1e5c4807684
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-10-03 16:18:44 +02:00
Gunnar Sletta 4c09e1e056 Enable profiling of materials and atlas textures
Task-number: QTBUG-33459

Change-Id: Ie9ea176fbb7ee46a128b4bf66a8f4475a5d4c90b
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
2013-10-03 16:18:44 +02:00
Gunnar Sletta 607f2db351 Fix zero pointer access in renderer.
Change-Id: I185af453684c7223c0c9de103eb707d4918b8ae0
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-09-19 08:52:00 +02:00
Giuseppe D'Angelo 4df73e62a7 Remove qSort usages from declarative
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I8fa7d0186cc8f0ba562695974829e37f1eb87f2f
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-13 01:10:37 +02:00
Gunnar Sletta b8dcbb12a2 Trigger rebuild when xform of alpha nodes change.
When transforms change, overlaps may have changed, so we
need to rebuild all batches under the current root.

Instead of adding taggedRoots logic for rebuilding
batches only, we reuse the existing tagged roots for render
lists. This one is slightly more expensive, but for now
I believe the reduced code complexity outweights the tiny
overhead.

Change-Id: I1bd0efc18e5628f404d6d4dce38c725436e87ce5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-09-09 22:58:45 +02:00
Gunnar Sletta ddc8225477 Fix partial rebuilds and geometry changes.
When we do partial rebuilds, we need to update the render order
for the entire subtree unconditionally. The previous logic
was to reuse existing render orders beneath batch roots, which
caused overlapping orders to be used.

When geometry of an alpha batch changes, we need to rebuild
everything under the current root. Otherwise, we might end
up with previously batched content which incorrectly
overlaps the changed geometry.

Change-Id: I7b6de5ce34a02434294ac5ae29ae1b87eb3c4464
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-09-09 22:58:45 +02:00
Richard Moe Gustavsen 6214493cd4 Fix build on iOS: define GL_DOUBLE
This patch will fix the build error:

qsgbatchrenderer.cpp:1844: error: use of undeclared identifier
GL_DOUBLE

Change-Id: I7981e303e4743bb610822633c7da433238de4683
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-08 17:42:36 +02:00