| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let's revise our policy of offline/bytecode only shaders. ShaderEffect
benefits greatly from having runtime compilation support for HLSL
source strings, especially when dynamically constructing shader strings.
There is no reason not to support both approaches since we rely on d3dcompiler
for reflection anyhow.
What's more, we can call D3DCompile on a dedicated thread, keeping the
gui responsive while compilation is on-going.
Change-Id: Ie6c02c2aa0ebd0c8371bbf30b3ce6582128c457b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
|
|
|
|
|
|
|
|
|
| |
Rename RendererInfo to GraphicsInfo. Deprecate OpenGLInfo and move
the surface format properties into GraphicsInfo. Move also the
shader info properties from ShaderEffect.
Change-Id: I3b3f01080e059b3a30a132fd67de19a4bfca54ef
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
|
|
|
|
|
| |
Change-Id: I8901a67d9e2b3343ba3f57775f1849400f6cdf18
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
|
|
|
|
|
| |
Change-Id: Icb8151f26bad68795eb2e1f920297267c880b40b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
|
|
|
|
|
|
|
|
|
| |
Only supports QImage backing.
As a bonus add some notes to the Context2D docs too.
Change-Id: I18457a1f766d2f136c6864ec06fe596668d5e726
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Import (and clean up) the dropshadow from the shadereffects example.
This is very useful since it tests a lot more paths and cases than
the wobble.
To overcome the issue of not having some of functionality available before
the item is added to a window, make QQuickGenericShaderEffect smarter and
enhance the documentation.
The handling of vertical mirroring is revised. The GLSL and HLSL version of
the dropshadow shaders produce correct, identical output now.
Change-Id: I94800997bfba781140d80720eb6f340cda480747
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The D3D12 node implementation is mostly missing. The rest of the enablers
should be in place now however.
Importing QtQuick 2.8 provides new properties for ShaderEffect:
- shaderType can be used to decide which language should be used
- shaderCompilationType tells if compilation is runtime or offline
- shaderSourceType tells if the vertex/fragmentShader properties refer
to source strings or source files or pre-compiled bytecode files
The last two are bitmasks. In practice however we will support only
one approach per backend for now (runtime + source string for OpenGL,
offline + bytecode for D3D12).
In addition to QSGShaderEffectNode, introduce the QSGGuiThreadShaderEffectManager
interface. This provides the gui thread bits for the above and performs shader
reflection. Backends that use the new ShaderEffect system must provide both.
For each ShaderEffect item there will be a manager (on the gui thread) and
a node (on the render thread).
Reflection is expected to be done via standard helper libs (d3d12shader
+ D3DReflect from d3dcompiler for the D3D12 backend), or via manually inspecting
SPIR-V, or parsing the source (like the GL path does now), or by using some
3rd party library (not recommended). In any case we require that reflection is
doable on the gui thread without dependencies to the actual graphics API.
The ShaderEffect documentation is greatly extended, covering HLSL and the new
properties.
The test app uses manually compiled shaders on its HLSL path for now. This
is because there is no story yet for build system integration for public
use (the internal HLSL -> bytecode in C header rule is only suitable for
the d3d12 plugin itself, apps need something different).
Change-Id: Id112104906fbcb26b9902a35f19d8d509b340d1b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recursive and multisample support is left as a future exercise. Mipmapping
is not supported and is not planned for the time being.
Layers cannot currently be rendered on their own, although they have their
own independent render targets. Starting a layer just starts the next frame early,
putting all commands to the normal command list of that frame. Thus this is
not yet fully suitable for implementing grabs.
Buffer handling is revised to support multiple vertex, index or constant
buffers. This is essential since we are going to have multiple renderer
instances (and may also be needed for a more complex batching renderer
in the future)
QSGBasicImageNode::preprocess is changed not to regenerate the geometry on
every dynamic texture change. In most cases only the material needs to be
dirtied. Rebuilding the geometry is only necessary when the normalized
subrect or similar changes.
Change-Id: Id088c15d1b75022b54c1f8bff1656d2cd68fa7cc
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Pick up window->format().samples() and use it. There is nothing that does
resolving and extra buffer management for us, do it all manually.
Change-Id: I76206574a24dfdd17120433e924a9841c9854904
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
| |
Add a test for render thread Animators.
Change-Id: Iddb11f734ccec00d76ca99cd8349cbb65750e784
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The texture resizing highlighted a potential issue with deferred deletes
and texture releases: All the texture management functions are special in
the sense that they can be called outside a begin-endFrame. (this is what
glyph caches do in fact when resizing is involved) In this case using
currentPFrameIndex (referring to the last frame's pframeData slot) seems safe,
but using it is in fact incorrect under some scenarios: a resource queued for
releasing between frame 1 and 2 cannot be released in beginFrame of frame 3,
which was the case until now. The CPU wait in frame 3's beginFrame only guarantees
the commands submitted before frame 1's endFrame have completed, and those will not
include a wait for the copy queue's commands that are added between frames 1 and 2.
Using the next frame's pframeData is not an option either since that would
lead to an immediate release once beginFrame is called the next time.
Therefore, introduce an out-of-frame queue for deleting and texture slot reuse.
With the previous example the release will be done in frame 4, which is
safe since everything submitted in frame 2 - which will normally include a
wait for the copy queue if there were commands issued there before frame 2
using the to-be-released texture - are guaranteed to be done due to the
CPU wait.
Change-Id: Iaa3b5f0af991946dc97ba44448823b22cbf419dc
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support for ARGB and A8 font engine formats is now available.
We once again need changes to the texture upload logic: we now allow
calling queueTextureUpload() for the same texture before the uploads
initiated by the previous call have finished. For mipmapped textures the
limitation remains in place. The texture glyph caches are non-mipmapped
and can have multiple begin-endFillTexture sequences within one frame.
Texture and thus glyph caches are now resizable, using the copy queue to
copy the old contents.
Change-Id: Ib81e0230b3a45a4948853497f7dbf236617fcd25
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enablers for native text rendering. Distance field support is postponed
for the time being.
The main feature here is the revised texture handling where it is now
possible to schedule the update of multiple sub-regions from a list of
QImages. BGRA is now used where appropriate, meaning for example that
RGB32 needs no QImage conversion anymore.
The skeletons of the glyph nodes, the basic text material and the glyph
cache are added as well.
Also fixes cleanup when closing the window by properly reimplementing
invalidate() in the rendercontext.
The default rectangle, image and glyph nodes are refactored a bit once
again: QSGBasicSomethingNode is now the common (albeit optional), abstract
class, living in its own file, whereas QSGDefaultSomethingNode is the
GL-specific one, like before. This prepares the future renaming for
QSGDefault -> QSGOpenGL.
Change-Id: I6dbb4ece10be39fd214bb64082d79607389e3e6e
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The smooth material is requested by antialiasing: true. This is
not the same as setting smooth: true which changes the filtering.
Mipmap support is only available for power-of-two textures for now.
Others will get scaled.
In addition, texture releases are now properly deferred and unnecessary
Wait() calls are avoided.
Change-Id: Ib9d909b1c4e2158564ab8bcfb933c088cf0da239
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Previous commit forgot to include the image used for the second
Image element.
Change-Id: I9b57c3cf33341e0ca09753e438e9fd50be9d3117
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For now there is no mipmapping, no atlases, and all image data is
converted to RGBA8888. Regardless, this already makes it possible to use
basic Image elements.
Follow the same pattern as with rectangles: most of the code is shared
via a material-less, abstract QSGDefaultNoMaterialImageNode, with the
material-related bits provided by QSGDefaultImageNode for GL and
QSGD3D12ImageNode for D3D.
Also fixes the harmless but incorrect miscalculation of the VBV size for
indexed draws.
Image data is copied into an intermediate upload buffer when invoking the
render context's createTexture(). The upload is triggered on a separate copy
command queue. The main command queue is synchronized via a fence before
executing the commands for the current frame.
Root signatures are now cached more cleverly and include zero or more SRVs
as parameter 1. This involves the engine having to manage a shader (GPU) visible
CBV-SRV-UAV descriptor heap as well.
Change-Id: I67c35577ff2677e1c7776dd8e5011860e2d78b00
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Now we can do performance tests since there is no debug output unless
requested via QSG_RENDERER_DEBUG.
Change-Id: I15ff213f35816401cc113899211b52a98ec30989
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
| |
Rounded rectangles are now smooth and beautiful.
Change-Id: I3ea61934be7c10ef01fa5c2b14dc28705a429b61
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: Ie55b9a2fd39d9e11321454a34a21c2a52ff1d23a
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid using .h for generated headers with shader blobs in order not to
confuse syncqt.
All buffer Map and memcpy is now done only at the end of the frame. This
is relevant for the constant buffer which can this way Map once and memcpy
only the data for elements that changed something.
This also marks a change from how simplerenderer works: instead of having
per-program matrix, opacity, etc. values (uniforms), there is a separate
copy of these in a dedicated area of the constant buffer for each element.
This allows reusing the data in the buffer as-is for non-changing elements
at the cost of higher memory usage (256 bytes per element both on CPU &
GPU side at minimum) and is also necessary in order to be able to build
command lists with multiple draw calls without intra-dependencies for the
cbuffer contents.
The somewhat broken dirty tracking of simplerenderer (matrices always
treated as dirty, forgetting the root node for ever in the list of dirty
transform nodes, etc.) is now corrected so that the DirtyMatrix and
DirtyOpacity states reflect reality, meaning the cbuffer update can be
skipped completely for items whose transform or inherited opacity has not
changed at all.
Format mapping is now moved to the engine.
Change-Id: Ia0a0d73e2a954970cb2745deb1a62c09f3d3cb7c
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
Proof of concept. The plan is to proceed slowly with supporting node types
one by one, starting with QSGRectangleNode.
Opaque rectangles work already, but only non-smooth for now. The renderer is
incomplete (no clip/opacity) and is based on simplerenderer on scenegraph playground.
Buffer handling is not necessarily optimal yet.
Use QT_QUICK_BACKEND=d3d12 to request this backend. Set QT_D3D_DEBUG=1 to
enable the D3D debug layer. The render loop handles everything, incl. swap
chain setup, handling resizes, etc. This being D3D, there are no further
enablers needed from the QtGui or platform plugin side.
By default the first hardware adapter is picked. In the absence of that,
WARP is tried. The list of adapters is printed at startup, use
QT_D3D_ADAPTER_INDEX to force a given card in case there are multiple
ones in the system.
The goal is not to productize a fast and great renderer, but to pave the way to
better future backends for D3D12 and similar graphics APIs.
Compiling in the support into Qt Quick is bad since the dependency onto
d3d12.dll is not necessarily acceptable, but it's good enough for now, this
being a wip branch.
Change-Id: Ifbe088e7507223328096b22eec2c73f77bb5680e
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|