![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h More...
#include <qrhi.h>
Classes | |
| struct | NativeShadingRateMap |
| \inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h More... | |
Public Member Functions | |
| QRhiResource::Type | resourceType () const override |
| virtual bool | createFrom (NativeShadingRateMap src) |
| Sets up the shading rate map to use a native 3D API shading rate object src. | |
| virtual bool | createFrom (QRhiTexture *src) |
| Sets up the shading rate map to use the texture src as the image containing the per-tile shading rates. | |
| virtual QSize | logicalSize () const |
| Public Member Functions inherited from QRhiResource | |
| virtual | ~QRhiResource () |
| Destructor. | |
| virtual void | destroy ()=0 |
| Releases (or requests deferred releasing of) the underlying native graphics resources. | |
| void | deleteLater () |
| When called without a frame being recorded, this function is equivalent to deleting the object. | |
| QByteArray | name () const |
| void | setName (const QByteArray &name) |
| Sets a name for the object. | |
| quint64 | globalResourceId () const |
| QRhi * | rhi () const |
Protected Member Functions | |
| QRhiShadingRateMap (QRhiImplementation *rhi) | |
| \variable QRhiShadingRateMap::NativeShadingRateMap::object | |
| Protected Member Functions inherited from QRhiResource | |
| QRhiResource (QRhiImplementation *rhi) | |
Additional Inherited Members | |
| Public Types inherited from QRhiResource | |
| enum | Type { Buffer , Texture , Sampler , RenderBuffer , RenderPassDescriptor , SwapChainRenderTarget , TextureRenderTarget , ShaderResourceBindings , GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer , ShadingRateMap , IndirectCommandBuffer } |
| Specifies type of the resource. More... | |
| Protected Attributes inherited from QRhiResource | |
| QRhiImplementation * | m_rhi = nullptr |
| quint64 | m_id |
| QByteArray | m_objectName |
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
An object that wraps a texture or another kind of native 3D API object.
For an introduction to Variable Rate Shading (VRS), see \l{https://learn.microsoft.com/en-us/windows/win32/direct3d12/vrs}. Qt supports a subset of the VRS features offered by Direct 3D 12 and Vulkan. In addition, Metal's somewhat different mechanism is supported by making it possible to set up a QRhiShadingRateMap with an existing MTLRasterizationRateMap object.
|
protected |
\variable QRhiShadingRateMap::NativeShadingRateMap::object
64-bit integer containing the native object handle.
Used with QRhiShadingRateMap::createFrom(). For example, with Metal, object is expected to be an id<MTLRasterizationRateMap>.
|
virtual |
Sets up the shading rate map to use a native 3D API shading rate object src.
true when successful, false when not supported.object field of src is expected to contain an id<MTLRasterizationRateMap>. Qt passes the MTLRasterizationRateMap on to the MTLRenderPassDescriptor, and, because Metal then interprets viewports and scissor rectangles in the map's screen space coordinate system, sizes the default scissor and converts viewports and scissors specified via QRhiCommandBuffer accordingly. The size of that coordinate system is reported by logicalSize(). Anything else, such as scaling when sampling the rendered result, is up to the application (or the XR compositor). Reimplemented in QMetalShadingRateMap.
|
virtual |
Sets up the shading rate map to use the texture src as the image containing the per-tile shading rates.
true when successful, false when not supported.The QRhiShadingRateMap does not take ownership of src.
{ceil(render_target_pixel_width / (float)tile_width)} and a height of {ceil(render_target_pixel_height / (float)tile_height)}. It is up to the application to ensure the size of the texture is as expected, using the above formula, at all times. The tile size can be queried via \l QRhi::resourceLimit() and QRhi::ShadingRateImageTileSize.Each byte (texel) in the texture corresponds to the shading rate value for one tile. 0 indicates 1x1, while a value of 10 indicates 4x4. See \l{https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_shading_rate}{D3D12_SHADING_RATE} for other possible values.
Reimplemented in QVkShadingRateMap.
|
virtual |
Some implementations, Metal in particular, describe a shading rate map in terms of a logical (screen space) size that is mapped onto the physical pixels of the render target. When such a map is attached to a render target, viewports and scissor rectangles are interpreted in the logical coordinate system, and the logical size is typically larger than QRhiRenderTarget::pixelSize(). Applications that derive viewports, scissors, or projection setup from the render target size should use this size instead whenever it is valid.
For implementations where the shading rate map is a tile image covering the render target, such as Vulkan and Direct 3D 12, there is no separate logical coordinate space, and an invalid QSize is returned. The render target's pixel size applies as usual in that case.
Reimplemented in QMetalShadingRateMap.
|
overridevirtual |