16#include <QtGui/qtguiglobal.h>
17#include <QtCore/qsize.h>
18#include <QtCore/qlist.h>
19#include <QtCore/qvarlengtharray.h>
20#include <QtCore/qthread.h>
21#include <QtGui/qmatrix4x4.h>
22#include <QtGui/qcolor.h>
23#include <QtGui/qimage.h>
61 return a.m_d ==
b.m_d &&
a.m_s ==
b.m_s;
80#ifndef QT_NO_DEBUG_STREAM
88 QRhiViewport(
float x,
float y,
float w,
float h,
float minDepth = 0.0f,
float maxDepth = 1.0f);
90 std::array<float, 4>
viewport()
const {
return m_rect; }
92 m_rect[0] =
x; m_rect[1] =
y; m_rect[2] =
w; m_rect[3] =
h;
102 std::array<float, 4> m_rect { { 0.0f, 0.0f, 0.0f, 0.0f } };
103 float m_minDepth = 0.0f;
104 float m_maxDepth = 1.0f;
108 return a.m_rect ==
b.m_rect
109 &&
a.m_minDepth ==
b.m_minDepth
110 &&
a.m_maxDepth ==
b.m_maxDepth;
133#ifndef QT_NO_DEBUG_STREAM
143 std::array<int, 4>
scissor()
const {
return m_rect; }
145 m_rect[0] =
x; m_rect[1] =
y; m_rect[2] =
w; m_rect[3] =
h;
149 std::array<int, 4> m_rect { { 0, 0, 0, 0 } };
153 return a.m_rect ==
b.m_rect;
174#ifndef QT_NO_DEBUG_STREAM
200 Classification m_classification = PerVertex;
201 quint32 m_instanceStepRate = 1;
205 return a.m_stride ==
b.m_stride
206 &&
a.m_classification ==
b.m_classification
207 &&
a.m_instanceStepRate ==
b.m_instanceStepRate;
227#ifndef QT_NO_DEBUG_STREAM
287 int m_matrixSlice = -1;
291 return a.m_binding ==
b.m_binding
292 &&
a.m_location ==
b.m_location
293 &&
a.m_format ==
b.m_format
294 &&
a.m_offset ==
b.m_offset;
316#ifndef QT_NO_DEBUG_STREAM
326 template<
typename InputIterator>
330 std::copy(
first, last, std::back_inserter(m_bindings));
338 template<
typename InputIterator>
341 m_attributes.clear();
342 std::copy(
first, last, std::back_inserter(m_attributes));
350 QVarLengthArray<QRhiVertexInputBinding, 8> m_bindings;
351 QVarLengthArray<QRhiVertexInputAttribute, 8> m_attributes;
355 return a.m_bindings ==
b.m_bindings &&
a.m_attributes ==
b.m_attributes;
374#ifndef QT_NO_DEBUG_STREAM
410 return a.m_type ==
b.m_type
411 &&
a.m_shader ==
b.m_shader
412 &&
a.m_shaderVariant ==
b.m_shaderVariant;
432#ifndef QT_NO_DEBUG_STREAM
455 VertexStage = 1 << 0,
456 TessellationControlStage = 1 << 1,
457 TessellationEvaluationStage = 1 << 2,
458 GeometryStage = 1 << 3,
459 FragmentStage = 1 << 4,
460 ComputeStage = 1 << 5
498 QRhiShaderResourceBinding::StageFlags
stage;
506 static constexpr int MAX_TEX_SAMPLER_ARRAY_SIZE = 16;
534 template<
typename Output>
546 static constexpr int LAYOUT_DESC_ENTRIES_PER_BINDING = 4;
548 template<
typename Output>
553 while (
first != last) {
571#ifndef QT_NO_DEBUG_STREAM
588 int layer()
const {
return m_layer; }
591 int level()
const {
return m_level; }
612 int m_resolveLayer = 0;
613 int m_resolveLevel = 0;
614 int m_multiViewCount = 0;
628 template<
typename InputIterator>
631 m_colorAttachments.clear();
632 std::copy(
first, last, std::back_inserter(m_colorAttachments));
649 QVarLengthArray<QRhiColorAttachment, 8> m_colorAttachments;
685 QPoint m_destinationTopLeft;
698 int layer()
const {
return m_layer; }
701 int level()
const {
return m_level; }
723 template<
typename InputIterator>
727 std::copy(
first, last, std::back_inserter(m_entries));
735 QVarLengthArray<QRhiTextureUploadEntry, 16> m_entries;
766 int m_sourceLayer = 0;
767 int m_sourceLevel = 0;
769 int m_destinationLayer = 0;
770 int m_destinationLevel = 0;
771 QPoint m_destinationTopLeft;
785 int layer()
const {
return m_layer; }
788 int level()
const {
return m_level; }
832 quint64 globalResourceId()
const;
855 VertexBuffer = 1 << 0,
856 IndexBuffer = 1 << 1,
857 UniformBuffer = 1 << 2,
858 StorageBuffer = 1 << 3
863 const void *objects[3];
872 UsageFlags
usage()
const {
return m_usage; }
882 virtual char *beginFullDynamicBufferUpdateForCurrentFrame();
883 virtual void endFullDynamicBufferUpdateForCurrentFrame();
898 RenderTarget = 1 << 0,
902 UsedAsTransferSource = 1 << 5,
903 UsedWithGenerateMips = 1 << 6,
904 UsedWithLoadStore = 1 << 7,
905 UsedAsCompressedAtlas = 1 << 8,
906 ExternalOES = 1 << 9,
907 ThreeDimensional = 1 << 10,
908 TextureRectangleGL = 1 << 11,
909 TextureArray = 1 << 12,
910 OneDimensional = 1 << 13
978 int depth()
const {
return m_depth; }
988 m_arrayRangeStart = startIndex;
989 m_arrayRangeLength =
count;
1010 virtual void setNativeLayout(
int layout);
1014 int arraySize_,
int sampleCount_,
Flags flags_);
1021 int m_arrayRangeStart = -1;
1022 int m_arrayRangeLength = -1;
1102 UsedWithSwapChainOnly = 1 << 0
1187 PreserveColorContents = 1 << 0,
1188 PreserveDepthStencilContents = 1 << 1,
1189 DoNotStoreDepthStencilContents = 1 << 2
1219 template<
typename InputIterator>
1223 std::copy(
first, last, std::back_inserter(m_bindings));
1237 BindingsAreSorted = 0x01
1241 virtual
void updateResources(UpdateFlags
flags = {}) = 0;
1244 static constexpr int BINDING_PREALLOC = 12;
1246 QVarLengthArray<QRhiShaderResourceBinding, BINDING_PREALLOC>
m_bindings;
1247 size_t m_layoutDescHash = 0;
1253#ifndef QT_NO_DEBUG_STREAM
1260#ifndef QT_NO_DEBUG_STREAM
1273 UsesBlendConstants = 1 << 0,
1274 UsesStencilRef = 1 << 1,
1275 UsesScissor = 1 << 2,
1276 CompileShadersWithDebugInfo = 1 << 3
1340 ColorMask colorWrite = ColorMask(0xF);
1399 template<
typename InputIterator>
1402 m_targetBlends.clear();
1403 std::copy(
first, last, std::back_inserter(m_targetBlends));
1447 template<
typename InputIterator>
1450 m_shaderStages.clear();
1451 std::copy(
first, last, std::back_inserter(m_shaderStages));
1485 bool m_depthTest =
false;
1486 bool m_depthWrite =
false;
1488 bool m_stencilTest =
false;
1493 int m_sampleCount = 1;
1494 float m_lineWidth = 1.0f;
1495 int m_depthBias = 0;
1496 float m_slopeScaledDepthBias = 0.0f;
1497 int m_patchControlPointCount = 3;
1499 int m_multiViewCount = 0;
1531 } colorComponentValue;
1539#ifndef QT_NO_DEBUG_STREAM
1545 void *reserved[2] = {};
1552 SurfaceHasPreMulAlpha = 1 << 0,
1553 SurfaceHasNonPreMulAlpha = 1 << 1,
1555 UsedAsTransferSource = 1 << 3,
1557 MinimalBufferCount = 1 << 5
1565 HDRExtendedDisplayP3Linear
1613 int m_sampleCount = 1;
1625 CompileShadersWithDebugInfo = 1 << 0
1659 ExternalContent = 0x01,
1660 DoNotTrackResourcesForCompute = 0x02
1669 const QColor &colorClearValue,
1672 BeginPassFlags
flags = {});
1678 int dynamicOffsetCount = 0,
1681 void setVertexInput(
int startBinding,
int bindingCount,
const VertexInput *bindings,
1687 void setBlendConstants(
const QColor &
c);
1688 void setStencilRef(
quint32 refValue);
1695 void drawIndexed(
quint32 indexCount,
1702 void debugMarkEnd();
1708 void dispatch(
int x,
int y,
int z);
1711 void beginExternal();
1714 double lastCompletedGpuTime();
1724 std::function<
void()> completed =
nullptr;
1738 bool hasOptimalCapacity()
const;
1777#ifndef QT_NO_DEBUG_STREAM
1795#ifndef QT_NO_DEBUG_STREAM
1816 EnableDebugMarkers = 1 << 0,
1817 PreferSoftwareRenderer = 1 << 1,
1818 EnablePipelineCacheDataSave = 1 << 2,
1819 EnableTimestamps = 1 << 3,
1820 SuppressSmokeTestWarnings = 1 << 4
1832 MultisampleTexture = 1,
1882 SkipPresent = 1 << 0
1911 Implementation backend()
const;
1913 static const char *
backendName(Implementation impl);
1920 void removeCleanupCallback(
const void *
key);
1928 QRhiBuffer::UsageFlags
usage,
1932 const QSize &pixelSize,
1933 int sampleCount = 1,
1934 QRhiRenderBuffer::Flags
flags = {},
1938 const QSize &pixelSize,
1939 int sampleCount = 1,
1940 QRhiTexture::Flags
flags = {});
1944 int sampleCount = 1,
1945 QRhiTexture::Flags
flags = {});
1949 const QSize &pixelSize,
1950 int sampleCount = 1,
1951 QRhiTexture::Flags
flags = {});
1961 QRhiTextureRenderTarget::Flags
flags = {});
1966 bool isRecordingFrame()
const;
1967 int currentFrameSlot()
const;
1970 FrameOpResult endOffscreenFrame(EndFrameFlags
flags = {});
1976 QList<int> supportedSampleCounts()
const;
1978 int ubufAlignment()
const;
1979 int ubufAligned(
int v)
const;
1981 static int mipLevelsForSize(
const QSize &
size);
1984 bool isYUpInFramebuffer()
const;
1985 bool isYUpInNDC()
const;
1986 bool isClipDepthZeroToOne()
const;
1992 int resourceLimit(ResourceLimit
limit)
const;
1995 bool makeThreadLocalNativeContextCurrent();
1997 static constexpr int MAX_MIP_LEVELS = 16;
1999 void releaseCachedResources();
2001 bool isDeviceLost()
const;
2014 Q_DISABLE_COPY(
QRhi)
The QColor class provides colors based on RGB, HSV or CMYK values.
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
\inmodule QtCore\reentrant
void setUsage(UsageFlags u)
Sets the buffer's usage flags to u.
void setType(Type t)
Sets the buffer's type to t.
Type
Specifies storage type of buffer resource.
UsageFlag
Flag values to specify how the buffer is going to be used.
void setSize(quint32 sz)
Sets the size of the buffer in bytes.
virtual bool create()=0
Creates the corresponding native graphics resources.
void setTexture(QRhiTexture *tex)
Sets the texture tex.
QRhiRenderBuffer * renderBuffer() const
int multiViewCount() const
QRhiColorAttachment()=default
Constructs an empty color attachment description.
QRhiTexture * texture() const
void setLevel(int level)
Sets the mip level.
void setRenderBuffer(QRhiRenderBuffer *rb)
Sets the renderbuffer rb.
QRhiTexture * resolveTexture() const
void setLayer(int layer)
Sets the layer index.
void setResolveLayer(int layer)
Sets the resolve texture layer to use.
void setMultiViewCount(int count)
Sets the view count.
void setResolveLevel(int level)
Sets the resolve texture mip level to use.
void setResolveTexture(QRhiTexture *tex)
Sets the resolve texture tex.
BeginPassFlag
Flag values for QRhi::beginPass()
QPair< int, quint32 > DynamicOffset
Synonym for QPair<int, quint32>.
QPair< QRhiBuffer *, quint32 > VertexInput
Synonym for QPair<QRhiBuffer *, quint32>.
IndexFormat
Specifies the index data type.
QRhiShaderStage m_shaderStage
void setShaderStage(const QRhiShaderStage &stage)
Sets the shader to use.
QRhiShaderResourceBindings * shaderResourceBindings() const
QRhiShaderStage shaderStage() const
Flag
Flag values for describing pipeline options.
void setFlags(Flags f)
Sets the flags f.
void setShaderResourceBindings(QRhiShaderResourceBindings *srb)
Associates with srb describing the resource binding layout and the resources (QRhiBuffer,...
friend bool operator!=(const QRhiDepthStencilClearValue &a, const QRhiDepthStencilClearValue &b) noexcept
friend size_t qHash(const QRhiDepthStencilClearValue &v, size_t seed=0) noexcept
void setDepthClearValue(float d)
Sets the depth clear value to d.
friend bool operator==(const QRhiDepthStencilClearValue &a, const QRhiDepthStencilClearValue &b) noexcept
float depthClearValue() const
quint32 stencilClearValue() const
QRhiDepthStencilClearValue()=default
Constructs a depth/stencil clear value with depth clear value 1.0f and stencil clear value 0.
void setStencilClearValue(quint32 s)
Sets the stencil clear value to s.
Flag
Flag values for describing the dynamic state of the pipeline, and other options.
BlendOp
Specifies the blend operation.
void setStencilFront(const StencilOpState &state)
Sets the stencil test state for front faces.
void setCullMode(CullMode mode)
Sets the specified face culling mode.
void setFrontFace(FrontFace f)
Sets the front face mode f.
StencilOpState stencilBack() const
PolygonMode
Specifies the polygon rasterization mode.
const QRhiShaderStage * cendShaderStages() const
void setTargetBlends(std::initializer_list< TargetBlend > list)
Sets the list of render target blend settings.
FrontFace
Specifies the front face winding order.
void setStencilTest(bool enable)
Enables or disables stencil tests based on enable.
const TargetBlend * cendTargetBlends() const
BlendFactor
Specifies the blend factor.
StencilOpState m_stencilFront
void setDepthWrite(bool enable)
Controls the writing out of depth data into the depth buffer based on enable.
bool hasDepthWrite() const
void setShaderResourceBindings(QRhiShaderResourceBindings *srb)
Associates with srb describing the resource binding layout and the resources (QRhiBuffer,...
QRhiShaderResourceBindings * shaderResourceBindings() const
void setDepthOp(CompareOp op)
Sets the depth comparison function op.
CompareOp
Specifies the depth or stencil comparison function.
int patchControlPointCount() const
void setSlopeScaledDepthBias(float bias)
Sets the slope scaled depth bias.
void setVertexInputLayout(const QRhiVertexInputLayout &layout)
Specifies the vertex input layout.
const TargetBlend * cbeginTargetBlends() const
CullMode
Specifies the culling mode.
void setStencilReadMask(quint32 mask)
Sets the stencil read mask.
QVarLengthArray< QRhiShaderStage, 4 > m_shaderStages
bool hasDepthTest() const
void setFlags(Flags f)
Sets the flags f.
void setShaderStages(std::initializer_list< QRhiShaderStage > list)
Sets the list of shader stages.
QRhiVertexInputLayout m_vertexInputLayout
bool hasStencilTest() const
QRhiRenderPassDescriptor * renderPassDescriptor() const
QVarLengthArray< TargetBlend, 8 > m_targetBlends
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
Associates with the specified QRhiRenderPassDescriptor desc.
const QRhiShaderStage * shaderStageAt(qsizetype index) const
void setSampleCount(int s)
Sets the sample count.
FrontFace frontFace() const
void setShaderStages(InputIterator first, InputIterator last)
Sets the list of shader stages from the iterators first and last.
void setTopology(Topology t)
Sets the primitive topology t.
quint32 stencilWriteMask() const
void setTargetBlends(InputIterator first, InputIterator last)
Sets the list of render target blend settings from the iterators first and last.
void setMultiViewCount(int count)
Sets the view count for multiview rendering.
QRhiVertexInputLayout vertexInputLayout() const
CullMode cullMode() const
void setPatchControlPointCount(int count)
Sets the number of patch control points to count.
Topology
Specifies the primitive topology.
CompareOp depthOp() const
StencilOpState m_stencilBack
quint32 stencilReadMask() const
const TargetBlend * targetBlendAt(qsizetype index) const
virtual bool create()=0
Creates the corresponding native graphics resources.
PolygonMode polygonMode() const
qsizetype shaderStageCount() const
void setDepthTest(bool enable)
Enables or disables depth testing based on enable.
void setDepthBias(int bias)
Sets the depth bias.
void setPolygonMode(PolygonMode mode)
Sets the polygon mode.
ColorMaskComponent
Flag values for specifying the color write mask.
StencilOp
Specifies the stencil operation.
float slopeScaledDepthBias() const
void setLineWidth(float width)
Sets the line width.
StencilOpState stencilFront() const
void setStencilWriteMask(quint32 mask)
Sets the stencil write mask.
int multiViewCount() const
Topology topology() const
const QRhiShaderStage * cbeginShaderStages() const
qsizetype targetBlendCount() const
void setStencilBack(const StencilOpState &state)
Sets the stencil test state for back faces.
QRhiReadbackDescription()=default
Constructs an empty texture readback description.
QRhiTexture * texture() const
void setLayer(int layer)
Sets the array layer to read back.
void setLevel(int level)
Sets the mip level to read back.
void setTexture(QRhiTexture *tex)
Sets the texture tex as the source of the readback operation.
void setPixelSize(const QSize &sz)
Sets the size (in pixels) to sz.
void setFlags(Flags f)
Sets the flags to f.
virtual QRhiTexture::Format backingFormat() const =0
void setType(Type t)
Sets the type to t.
QRhiTexture::Format m_backingFormatHint
void setSampleCount(int s)
Sets the sample count to s.
Type
Specifies the type of the renderbuffer.
virtual bool create()=0
Creates the corresponding native graphics resources.
Flag
\variable QRhiRenderBuffer::NativeRenderBuffer::object
virtual QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const =0
virtual bool isCompatible(const QRhiRenderPassDescriptor *other) const =0
virtual QVector< quint32 > serializedFormat() const =0
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
Sets the QRhiRenderPassDescriptor desc for use with this render target.
virtual QSize pixelSize() const =0
QRhiRenderPassDescriptor * renderPassDescriptor() const
virtual int sampleCount() const =0
virtual float devicePixelRatio() const =0
Type
Specifies type of the resource.
virtual void destroy()=0
Releases (or requests deferred releasing of) the underlying native graphics resources.
virtual Type resourceType() const =0
AddressMode addressV() const
void setMipmapMode(Filter f)
Sets the mipmap filter mode to f.
void setAddressW(AddressMode mode)
Sets the depth wrap mode.
Filter
Specifies the minification, magnification, or mipmap filtering.
AddressMode
Specifies the addressing mode.
void setMinFilter(Filter f)
Sets the minification filter mode to f.
CompareOp
Specifies the texture comparison function.
Filter mipmapMode() const
AddressMode addressW() const
void setTextureCompareOp(CompareOp op)
Sets the texture comparison function op.
void setAddressU(AddressMode mode)
Sets the horizontal wrap mode.
AddressMode addressU() const
CompareOp textureCompareOp() const
void setAddressV(AddressMode mode)
Sets the vertical wrap mode.
void setMagFilter(Filter f)
Sets the magnification filter mode to f.
friend size_t qHash(const QRhiScissor &v, size_t seed=0) noexcept
void setScissor(int x, int y, int w, int h)
Sets the scissor position and size to x, y, w, h.
std::array< int, 4 > scissor() const
friend bool operator==(const QRhiScissor &a, const QRhiScissor &b) noexcept
friend bool operator!=(const QRhiScissor &a, const QRhiScissor &b) noexcept
QRhiScissor()=default
Constructs an empty scissor.
Type
Specifies type of the shader resource bound to a binding point.
static void serializeLayoutDescription(const QRhiShaderResourceBinding *first, const QRhiShaderResourceBinding *last, Output dst)
StageFlag
Flag values to indicate which stages the shader resource is visible in.
void setBindings(InputIterator first, InputIterator last)
Sets the list of bindings from the iterators first and last.
QVarLengthArray< QRhiShaderResourceBinding, BINDING_PREALLOC > m_bindings
const QRhiShaderResourceBinding * cbeginBindings() const
void setBindings(std::initializer_list< QRhiShaderResourceBinding > list)
Sets the list of bindings.
QVector< quint32 > serializedLayoutDescription() const
const QRhiShaderResourceBinding * bindingAt(qsizetype index) const
qsizetype bindingCount() const
QVector< quint32 > m_layoutDesc
const QRhiShaderResourceBinding * cendBindings() const
void setShaderVariant(QShader::Variant v)
Sets the requested shader variant v.
void setShader(const QShader &s)
Sets the shader collection s.
QRhiShaderStage()=default
Constructs a shader stage description for the vertex stage with an empty QShader.
QShader::Variant shaderVariant() const
friend bool operator!=(const QRhiShaderStage &a, const QRhiShaderStage &b) noexcept
friend bool operator==(const QRhiShaderStage &a, const QRhiShaderStage &b) noexcept
friend size_t qHash(const QRhiShaderStage &v, size_t seed=0) noexcept
void setType(Type t)
Sets the type of the stage to t.
QRhiSwapChain * swapChain() const
QRhiSwapChain * m_swapchain
QSize currentPixelSize() const
void setDepthStencil(QRhiRenderBuffer *ds)
Sets the renderbuffer ds for use as a depth-stencil buffer.
virtual QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor()=0
QRhiSwapChainProxyData m_proxyData
virtual bool createOrResize()=0
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size...
virtual QRhiRenderTarget * currentFrameRenderTarget()=0
virtual QSize surfacePixelSize()=0
QRhiSwapChainProxyData proxyData() const
Flag
Flag values to describe swapchain properties.
void setSampleCount(int samples)
Sets the sample count.
void setFlags(Flags f)
Sets the flags f.
QRhiRenderPassDescriptor * renderPassDescriptor() const
Format
Describes the swapchain format.
void setWindow(QWindow *window)
Sets the window.
StereoTargetBuffer
Selects the backbuffer to use with a stereoscopic swapchain.
virtual bool isFormatSupported(Format f)=0
void setProxyData(const QRhiSwapChainProxyData &d)
Sets the proxy data d.
virtual QRhiCommandBuffer * currentFrameCommandBuffer()=0
QRhiRenderBuffer * depthStencil() const
void setFormat(Format f)
Sets the format f.
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
Associates with the QRhiRenderPassDescriptor desc.
void setSourceLevel(int level)
Sets the source mip level.
QPoint destinationTopLeft() const
QPoint sourceTopLeft() const
void setPixelSize(const QSize &sz)
Sets the size of the region to copy to sz.
void setDestinationLevel(int level)
Sets the destination mip level.
void setDestinationTopLeft(const QPoint &p)
Sets the destination top-left position p.
int destinationLevel() const
void setDestinationLayer(int layer)
Sets the destination array layer.
void setSourceTopLeft(const QPoint &p)
Sets the source top-left position to p.
int destinationLayer() const
void setSourceLayer(int layer)
Sets the source array layer.
QRhiTextureCopyDescription()=default
Constructs an empty texture copy description.
const QRhiColorAttachment * cbeginColorAttachments() const
void setDepthResolveTexture(QRhiTexture *tex)
Sets the depth (or depth-stencil) resolve texture tex.
void setDepthTexture(QRhiTexture *texture)
Sets the texture for depth-stencil.
QRhiTexture * depthTexture() const
void setDepthStencilBuffer(QRhiRenderBuffer *renderBuffer)
Sets the renderBuffer for depth-stencil.
const QRhiColorAttachment * cendColorAttachments() const
QRhiRenderBuffer * depthStencilBuffer() const
void setColorAttachments(std::initializer_list< QRhiColorAttachment > list)
Sets the list of color attachments.
const QRhiColorAttachment * colorAttachmentAt(qsizetype index) const
void setColorAttachments(InputIterator first, InputIterator last)
Sets the list of color attachments via the iterators first and last.
qsizetype colorAttachmentCount() const
QRhiTextureRenderTargetDescription()=default
Constructs an empty texture render target description.
QRhiTexture * depthResolveTexture() const
void setDescription(const QRhiTextureRenderTargetDescription &desc)
Sets the render target description desc.
void setFlags(Flags f)
Sets the flags to f.
QRhiTextureRenderTargetDescription m_desc
virtual QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor()=0
Flag
Flag values describing the load/store behavior for the render target.
virtual bool create()=0
Creates the corresponding native graphics resources.
QRhiTextureRenderTargetDescription description() const
void setSourceTopLeft(const QPoint &p)
Sets the source top-left position p.
quint32 dataStride() const
QRhiTextureSubresourceUploadDescription()=default
Constructs an empty subresource description.
void setDataStride(quint32 stride)
Sets the data stride in bytes.
QPoint sourceTopLeft() const
void setDestinationTopLeft(const QPoint &p)
Sets the destination top-left position p.
void setData(const QByteArray &data)
Sets data.
void setSourceSize(const QSize &size)
Sets the source size in pixels.
void setImage(const QImage &image)
Sets image.
QPoint destinationTopLeft() const
const QRhiTextureUploadEntry * cendEntries() const
const QRhiTextureUploadEntry * cbeginEntries() const
QRhiTextureUploadDescription()=default
Constructs an empty texture upload description.
void setEntries(std::initializer_list< QRhiTextureUploadEntry > list)
Sets the list of entries.
const QRhiTextureUploadEntry * entryAt(qsizetype index) const
void setEntries(InputIterator first, InputIterator last)
Sets the list of entries using the iterators first and last.
qsizetype entryCount() const
void setLevel(int level)
Sets the mip level.
void setDescription(const QRhiTextureSubresourceUploadDescription &desc)
Sets the subresource description desc.
QRhiTextureSubresourceUploadDescription description() const
void setLayer(int layer)
Sets the layer.
QRhiTextureUploadEntry()=default
Constructs an empty QRhiTextureUploadEntry targeting layer 0 and level 0.
void setArrayRange(int startIndex, int count)
Normally all array layers are exposed and it is up to the shader to select the layer via the third co...
ViewFormat writeViewFormat() const
void setFormat(Format fmt)
Sets the requested texture format to fmt.
void setFlags(Flags f)
Sets the texture flags to f.
Flag
Flag values to specify how the texture is going to be used.
int arrayRangeStart() const
void setDepth(int depth)
Sets the depth for a 3D texture.
virtual bool create()=0
Creates the corresponding native graphics resources.
void setReadViewFormat(const ViewFormat &fmt)
Format
Specifies the texture format.
void setArraySize(int arraySize)
Sets the texture arraySize.
void setWriteViewFormat(const ViewFormat &fmt)
void setSampleCount(int s)
Sets the sample count to s.
ViewFormat readViewFormat() const
\variable QRhiTexture::ViewFormat::format
void setPixelSize(const QSize &sz)
Sets the texture size, specified in pixels, to sz.
int arrayRangeLength() const
void setMinDepth(float minDepth)
Sets the minDepth of the depth range of the viewport.
friend bool operator!=(const QRhiViewport &a, const QRhiViewport &b) noexcept
void setMaxDepth(float maxDepth)
Sets the maxDepth of the depth range of the viewport.
void setViewport(float x, float y, float w, float h)
Sets the viewport's position and size to x, y, w, and h.
std::array< float, 4 > viewport() const
friend size_t qHash(const QRhiViewport &v, size_t seed=0) noexcept
QRhiViewport()=default
Constructs a viewport description with an empty rectangle and a depth range of 0.0f - 1....
friend bool operator==(const QRhiViewport &a, const QRhiViewport &b) noexcept
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Implementation
Describes which graphics API-specific backend gets used by a QRhi instance.
BeginFrameFlag
Flag values for QRhi::beginFrame()
ResourceLimit
Describes the resource limit to query.
@ MaxThreadsPerThreadGroup
@ MaxThreadGroupsPerDimension
EndFrameFlag
Flag values for QRhi::endFrame()
Feature
Flag values to indicate what features are supported by the backend currently in use.
@ NonDynamicUniformBuffers
@ RenderToNonBaseMipLevel
@ MultisampleRenderBuffer
@ PipelineCacheDataLoadSave
@ ReadBackNonUniformBuffer
@ RenderToOneDimensionalTexture
@ OneDimensionalTextureMipmaps
@ ReadBackNonBaseMipLevel
@ ThreeDimensionalTextureMipmaps
@ NonFourAlignedEffectiveIndexBufferOffset
@ ThreeDimensionalTextures
@ ReadBackAnyTextureFormat
FrameOpResult
Describes the result of operations that can have a soft failure.
@ FrameOpSwapChainOutOfDate
std::function< void(QRhi *)> CleanupCallback
Flag
Describes what special features to enable.
Variant
Describes what kind of shader code an entry contains.
QHash< int, QWidget * > hash
[35multi]
employee setName("Richard Schmit")
Combined button and popup list for selecting options.
static std::unique_ptr< QRhiGraphicsPipeline > newGraphicsPipeline(QRhi *rhi, QRhiShaderResourceBindings *shaderResourceBindings, QRhiRenderPassDescriptor *renderPassDescriptor, QShader vertexShader, QShader fragmentShader)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
static int resourceType(const QByteArray &key)
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint const GLuint GLuint const GLuint * textures
GLenum GLenum GLenum GLenum dstAlpha
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLenum srcAlpha
const void GLsizei GLsizei stride
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
GLsizeiptr const void GLenum usage
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiDepthStencilClearValue &)
Q_GUI_EXPORT size_t qHash(const QRhiShaderResourceBinding &b, size_t seed=0) noexcept
static constexpr QSize sizeForMipLevel(int mipLevel, const QSize &baseLevelSize)
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
unsigned long long quint64
QVideoFrameFormat::PixelFormat fmt
static QInputDevice::DeviceType deviceType(const UINT cursorType)
view viewport() -> scroll(dx, dy, deviceRect)
myFilter draw(painter, QPoint(0, 0), originalPixmap)
DeviceType
Specifies the graphics device's type, when the information is available.
\variable QRhiGraphicsPipeline::TargetBlend::colorWrite
\variable QRhiReadbackResult::completed
QRhiTexture::Format format
TextureAndOrSamplerData stex
QRhiShaderResourceBinding::StageFlags stage
Output serialize(Output dst) const
QRhiShaderResourceBinding::Type type
LuminanceBehavior
\value SceneReferred Indicates that the color value of 1.0 is interpreted as 80 nits.
float maxPotentialColorComponentValue
LimitsType
\value LuminanceInNits Indicates that the \l limits union has its luminanceInNits struct set
LuminanceBehavior luminanceBehavior
float maxColorComponentValue
QRhiTexture::Format format