Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QVkShadingRateMap Struct Reference

#include <qrhivulkan_p.h>

Inheritance diagram for QVkShadingRateMap:
Collaboration diagram for QVkShadingRateMap:

Public Member Functions

 QVkShadingRateMap (QRhiImplementation *rhi)
 ~QVkShadingRateMap ()
void destroy () override
 Releases (or requests deferred releasing of) the underlying native graphics resources.
bool createFrom (QRhiTexture *src) override
 Sets up the shading rate map to use the texture src as the image containing the per-tile shading rates.
Public Member Functions inherited from QRhiShadingRateMap
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.
Public Member Functions inherited from QRhiResource
virtual ~QRhiResource ()
 Destructor.
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
QRhirhi () const

Public Attributes

QVkTexturetexture = nullptr

Friends

class QRhiVulkan

Additional Inherited Members

Public Types inherited from QRhiResource
enum  Type {
  Buffer , Texture , Sampler , RenderBuffer ,
  RenderPassDescriptor , SwapChainRenderTarget , TextureRenderTarget , ShaderResourceBindings ,
  GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer ,
  ShadingRateMap
}
 Specifies type of the resource. More...
Protected Member Functions inherited from QRhiShadingRateMap
 QRhiShadingRateMap (QRhiImplementation *rhi)
 \variable QRhiShadingRateMap::NativeShadingRateMap::object
Protected Member Functions inherited from QRhiResource
 QRhiResource (QRhiImplementation *rhi)
Protected Attributes inherited from QRhiResource
QRhiImplementationm_rhi = nullptr
quint64 m_id
QByteArray m_objectName

Detailed Description

Definition at line 152 of file qrhivulkan_p.h.

Constructor & Destructor Documentation

◆ QVkShadingRateMap()

QVkShadingRateMap::QVkShadingRateMap ( QRhiImplementation * rhi)

Definition at line 7697 of file qrhivulkan.cpp.

References QVkShadingRateMap().

Referenced by QVkShadingRateMap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~QVkShadingRateMap()

QVkShadingRateMap::~QVkShadingRateMap ( )

Definition at line 7702 of file qrhivulkan.cpp.

References destroy().

Here is the call graph for this function:

Member Function Documentation

◆ createFrom()

bool QVkShadingRateMap::createFrom ( QRhiTexture * src)
overridevirtual

Sets up the shading rate map to use the texture src as the image containing the per-tile shading rates.

Returns
true when successful, false when not supported.

The QRhiShadingRateMap does not take ownership of src.

Note
This is functional only when the QRhi::VariableRateShadingMapWithTexture feature is reported as supported. In practice may be supported on Vulkan and Direct 3D 12 when using modern graphics cards. It will never be supported on OpenGL or Metal, for example.
src must have a format of QRhiTexture::R8UI.
src must have a width of {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 from QRhiShadingRateMap.

Definition at line 7715 of file qrhivulkan.cpp.

References destroy(), and texture.

Here is the call graph for this function:

◆ destroy()

void QVkShadingRateMap::destroy ( )
overridevirtual

Releases (or requests deferred releasing of) the underlying native graphics resources.

Safe to call multiple times, subsequent invocations will be a no-op then.

Once destroy() is called, the QRhiResource instance can be reused, by calling create() again. That will then result in creating new native graphics resources underneath.

Note
Resources referenced by commands for the current frame should not be released until the frame is submitted by QRhi::endFrame().

The QRhiResource destructor also performs the same task, so calling this function is not necessary before deleting a QRhiResource.

See also
deleteLater()

Implements QRhiResource.

Definition at line 7707 of file qrhivulkan.cpp.

References texture.

Referenced by ~QVkShadingRateMap(), and createFrom().

Here is the caller graph for this function:

◆ QRhiVulkan

friend class QRhiVulkan
friend

Definition at line 160 of file qrhivulkan_p.h.

Member Data Documentation

◆ texture

QVkTexture* QVkShadingRateMap::texture = nullptr

The documentation for this struct was generated from the following files: