aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode.cpp
Commit message (Collapse)AuthorAgeFilesLines
* D3D12: clean up loggingLaszlo Agocs2016-07-191-7/+7
| | | | | | | | | | | | Make QSG_RENDERER_DEBUG more fine-grained, the maximum set is now loop;build;change;render;descheap;buffer;texture;shader meaning "render" is broken up into 5 categories. Fix also a comment on the root signature to avoid future headache with trying to optimize the descriptor table for textures away (in vain). Change-Id: I06a2a624ed39aaf5de42b8e984a192c7966360ab Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Fix unused var warnings in release buildsLaszlo Agocs2016-07-151-2/+1
| | | | | Change-Id: I83c3582ca7cb9523fb0e90627f2575992e84694c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Add support for shader sources in filesLaszlo Agocs2016-06-291-12/+24
| | | | | | | | | Now we support all combinations: source strings, HLSL source in files and bytecode in files. The type of file contents is detected automatically. Change-Id: Id6ab269df52463fb95a9a1ef2598ed5576a873d3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Add support for file selectors in ShaderEffectLaszlo Agocs2016-06-291-1/+6
| | | | | | | | | | | Now that both OpenGL and D3D supports files, it is trivial to add support for file selectors. This means that one can add for example a shaders/wobble.frag with GLSL source code and a shaders/+hlsl/wobble.frag with D3D bytecode, while simply writing fragmentShader: "file:shaders/wobble.frag" in QML. The rest is automatic. Change-Id: Iaf71a6998bbd31050bc6c2b2f33b03d27c59fb6c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Support runtime threaded shader compilationLaszlo Agocs2016-06-221-10/+79
| | | | | | | | | | | | | | 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>
* One GraphicsInfo to rule them allLaszlo Agocs2016-06-011-15/+0
| | | | | | | | | 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>
* D3D12: Get rid of the material's RenderState duplicationLaszlo Agocs2016-06-011-1/+1
| | | | | Change-Id: Icd42a1bfff0f12f8162e888f204ad9b3a79aa911 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* D3D12: Drop QVectors from QSGD3D12EngineLaszlo Agocs2016-05-311-1/+1
| | | | | | | | | | | | | | | Results in a more than 3x drop (and now below GL, as expected) in CPU usage in the 500 Image elements test. There is zero value in using a dynamic data structure for these anyhow, apart from getting == and qHash. However, writing our own hash provides further opportunities for optimizing, for instance there is not much point in hashing the individual input elements since the same shader code pointers imply that the input elements match too. Thus hashing becomes faster without more collisions in practice. Change-Id: Iae766bd44d30ec37080369c8b37677e633c37a88 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Painter nodeLaszlo Agocs2016-05-031-1/+1
| | | | | | | | | 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>
* D3D12: qt_SubRect_<name> supportLaszlo Agocs2016-04-301-8/+82
| | | | | Change-Id: I2b5d1211ed97909a03d92d115eb057ce9e710d12 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Fix 'ShaderEffect in a ShaderEffectSource as property value'Laszlo Agocs2016-04-291-1/+1
| | | | | | | | | | | | | | | | 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>
* D3D12: Handle special shader effect casesLaszlo Agocs2016-04-291-14/+51
| | | | | | | | | | | | Like when there is only one shader is given by the ShaderEffect item, or when texture providers disappear (use a dummy texture in this case). Changing the cull mode works now too. Fix also the inconsistent naming (activate -> use) for textures in the glpyh cache. The cbuffer is now correctly aligned. Filtering and wrap modes are now taken from the texture, meaning 'smooth' and 'wrapMode' works. Change-Id: I265a7676d87d470dc8b3a8f59ea64bdadbc58c5d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Long Live Wobble!Laszlo Agocs2016-04-291-14/+594
| | | | | | | | | | | | | D3D12 shader effect node. Cull mode, atlas (qt_SubRect_*) support, and some nice-to-haves are currently missing. The built-in shaders won't yet work due to not sending 'source' down the stack so both have to be application-supplied. Nonetheless..the wobble test works! Change-Id: If4cd0143fa5794a8d5f89b576ffcfb084efeb343 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Adaptable shader effect enablersLaszlo Agocs2016-04-291-0/+286
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>