Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qrhimetal_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QRHIMETAL_P_H
5#define QRHIMETAL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qrhi_p.h"
19#include <QWindow>
20
22
23static const int QMTL_FRAMES_IN_FLIGHT = 2;
24
25// have to hide the ObjC stuff, this header cannot contain MTL* at all
26struct QMetalBufferData;
27
28struct QMetalBuffer : public QRhiBuffer
29{
32 void destroy() override;
33 bool create() override;
37
41 friend class QRhiMetal;
43
44 static constexpr int WorkBufPoolUsage = 1 << 8;
46};
47
49
51{
53 int sampleCount, QRhiRenderBuffer::Flags flags,
54 QRhiTexture::Format backingFormatHint);
56 void destroy() override;
57 bool create() override;
58 QRhiTexture::Format backingFormat() const override;
59
61 int samples = 1;
64 friend class QRhiMetal;
65};
66
68
70{
74 void destroy() override;
75 bool create() override;
76 bool createFrom(NativeTexture src) override;
78
79 bool prepareCreate(QSize *adjustedSize = nullptr);
80
83 int samples = 1;
86 friend class QRhiMetal;
88 friend struct QMetalTextureData;
89};
90
92
94{
98 void destroy() override;
99 bool create() override;
100
104 friend class QRhiMetal;
106};
107
109{
112 void destroy() override;
113 bool isCompatible(const QRhiRenderPassDescriptor *other) const override;
115 QVector<quint32> serializedFormat() const override;
116
118
119 // there is no MTLRenderPassDescriptor here as one will be created for each pass in beginPass()
120
121 // but the things needed for the render pipeline descriptor have to be provided
122 static const int MAX_COLOR_ATTACHMENTS = 8;
124 bool hasDepthStencil = false;
128};
129
131
133{
136 void destroy() override;
137
138 QSize pixelSize() const override;
139 float devicePixelRatio() const override;
140 int sampleCount() const override;
141
143};
144
146{
149 void destroy() override;
150
151 QSize pixelSize() const override;
152 float devicePixelRatio() const override;
153 int sampleCount() const override;
154
156 bool create() override;
157
159 friend class QRhiMetal;
160};
161
163{
166 void destroy() override;
167 bool create() override;
168 void updateResources(UpdateFlags flags) override;
169
171 int maxBinding = -1;
172
176 };
178 int count;
179 struct {
185 };
189 };
193 };
195 union {
200 };
201 };
203
205 friend class QRhiMetal;
206};
207
210
212{
215 void destroy() override;
216 bool create() override;
217
220 void setupMetalDepthStencilDescriptor(void *metalDsDesc);
221 void mapStates();
223 bool createTessellationPipelines(const QShader &tessVert, const QShader &tesc, const QShader &tese, const QShader &tessFrag);
224
228 friend class QRhiMetal;
229};
230
232
234{
237 void destroy() override;
238 bool create() override;
239
243 friend class QRhiMetal;
244};
245
247struct QMetalSwapChain;
248
250{
253 void destroy() override;
254
257
258 enum PassType {
262 };
263
264 // per-pass (render or compute command encoder) persistent state
267
268 // per-pass (render or compute command encoder) volatile (cached) state
283
285 void resetState(double lastGpuTime = 0);
286 void resetPerPassState();
288};
289
291
293{
296 void destroy() override;
297
300 QSize surfacePixelSize() override;
301 bool isFormatSupported(Format f) override;
302
304
305 bool createOrResize() override;
306
307 virtual QRhiSwapChainHdrInfo hdrInfo() override;
308
309 void chooseFormats();
310 void waitUntilCompleted(int slot);
311
312 QWindow *window = nullptr;
314 int currentFrameSlot = 0; // 0..QMTL_FRAMES_IN_FLIGHT-1
315 int frameCount = 0;
316 int samples = 1;
321};
322
323struct QRhiMetalData;
324
326{
327public:
329 ~QRhiMetal();
330
331 static bool probe(QRhiMetalInitParams *params);
333
334 bool create(QRhi::Flags flags) override;
335 void destroy() override;
336
341 QRhiBuffer::UsageFlags usage,
342 quint32 size) override;
344 const QSize &pixelSize,
345 int sampleCount,
346 QRhiRenderBuffer::Flags flags,
347 QRhiTexture::Format backingFormatHint) override;
349 const QSize &pixelSize,
350 int depth,
351 int arraySize,
352 int sampleCount,
353 QRhiTexture::Flags flags) override;
355 QRhiSampler::Filter minFilter,
356 QRhiSampler::Filter mipmapMode,
359 QRhiSampler::AddressMode w) override;
360
362 QRhiTextureRenderTarget::Flags flags) override;
363
364 QRhiSwapChain *createSwapChain() override;
365 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
366 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
367 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
368 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
369 QRhi::FrameOpResult finish() override;
370
371 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
372
375 const QColor &colorClearValue,
376 const QRhiDepthStencilClearValue &depthStencilClearValue,
377 QRhiResourceUpdateBatch *resourceUpdates,
378 QRhiCommandBuffer::BeginPassFlags flags) override;
379 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
380
382 QRhiGraphicsPipeline *ps) override;
383
386 int dynamicOffsetCount,
387 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
388
390 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
391 QRhiBuffer *indexBuf, quint32 indexOffset,
392 QRhiCommandBuffer::IndexFormat indexFormat) override;
393
394 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
395 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
396 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
397 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
398
399 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
400 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
401
402 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
403 quint32 instanceCount, quint32 firstIndex,
404 qint32 vertexOffset, quint32 firstInstance) override;
405
406 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
407 void debugMarkEnd(QRhiCommandBuffer *cb) override;
408 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
409
411 QRhiResourceUpdateBatch *resourceUpdates,
412 QRhiCommandBuffer::BeginPassFlags flags) override;
413 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
415 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
416
418 void beginExternal(QRhiCommandBuffer *cb) override;
419 void endExternal(QRhiCommandBuffer *cb) override;
420 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
421
423 int ubufAlignment() const override;
424 bool isYUpInFramebuffer() const override;
425 bool isYUpInNDC() const override;
426 bool isClipDepthZeroToOne() const override;
427 QMatrix4x4 clipSpaceCorrMatrix() const override;
428 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
429 bool isFeatureSupported(QRhi::Feature feature) const override;
430 int resourceLimit(QRhi::ResourceLimit limit) const override;
431 const QRhiNativeHandles *nativeHandles() override;
432 QRhiDriverInfo driverInfo() const override;
433 QRhiStats statistics() override;
435 void releaseCachedResources() override;
436 bool isDeviceLost() const override;
437
438 QByteArray pipelineCacheData() override;
439 void setPipelineCacheData(const QByteArray &data) override;
440
441 void executeDeferredReleases(bool forced = false);
442 void finishActiveReadbacks(bool forced = false);
444 void enqueueSubresUpload(QMetalTexture *texD, void *mp, void *blitEncPtr,
445 int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc,
446 qsizetype *curOfs);
448 void executeBufferHostWritesForSlot(QMetalBuffer *bufD, int slot);
450 static const int SUPPORTED_STAGES = 5;
453 int dynamicOffsetCount,
454 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets,
455 bool offsetOnlyChange,
456 const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[SUPPORTED_STAGES]);
457 int effectiveSampleCount(int sampleCount) const;
460 enum {
470 };
471 struct IndexedArgs {
478 };
479 union {
482 };
483 };
484 void tessellatedDraw(const TessDrawArgs &args);
486
487 QRhi::Flags rhiFlags;
488 bool importedDevice = false;
489 bool importedCmdQueue = false;
496
497 struct {
498 int maxTextureSize = 4096;
501 bool isAppleGPU = false;
503 bool multiView = false;
505
506 QRhiMetalData *d = nullptr;
507};
508
510
511#endif
\inmodule QtCore
Definition qbytearray.h:57
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
Definition qlist.h:74
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtGui
Definition qrhi.h:834
Type
Specifies storage type of buffer resource.
Definition qrhi.h:836
@ StorageBuffer
Definition qrhi.h:846
\inmodule QtGui
Definition qrhi.h:1614
QPair< QRhiBuffer *, quint32 > VertexInput
Synonym for QPair<QRhiBuffer *, quint32>.
Definition qrhi.h:1643
QPair< int, quint32 > DynamicOffset
Synonym for QPair<int, quint32>.
Definition qrhi.h:1639
IndexFormat
Specifies the index data type.
Definition qrhi.h:1616
\inmodule QtGui
Definition qrhi.h:1585
\inmodule QtGui
Definition qrhi.h:44
\inmodule QtGui
Definition qrhi.h:1241
\variable QRhiMetalNativeHandles::dev
\inmodule QtRhi
\inmodule QtRhi
static QRhiSwapChainProxyData updateSwapChainProxyData(QWindow *window)
QMetalSwapChain * currentSwapChain
bool isDeviceLost() const override
Definition qrhimetal.mm:917
QRhiMetalNativeHandles nativeHandlesStruct
void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override
QRhiStats statistics() override
Definition qrhimetal.mm:896
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
void executeBufferHostWritesForCurrentFrame(QMetalBuffer *bufD)
int ubufAlignment() const override
Definition qrhimetal.mm:686
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
Definition qrhimetal.mm:720
void endExternal(QRhiCommandBuffer *cb) override
QRhiMetalData * d
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
qsizetype subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const
void beginExternal(QRhiCommandBuffer *cb) override
quint32 osMajor
void adjustForMultiViewDraw(quint32 *instanceCount, QRhiCommandBuffer *cb)
QRhiSwapChain * createSwapChain() override
Definition qrhimetal.mm:676
QRhiGraphicsPipeline * createGraphicsPipeline() override
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
QRhi::Flags rhiFlags
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
QRhiSampler * createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
static const int SUPPORTED_STAGES
bool multiView
void enqueueShaderResourceBindings(QMetalShaderResourceBindings *srbD, QMetalCommandBuffer *cbD, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets, bool offsetOnlyChange, const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[SUPPORTED_STAGES])
QRhiRenderBuffer * createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
void setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
bool isYUpInNDC() const override
Definition qrhimetal.mm:696
int resourceLimit(QRhi::ResourceLimit limit) const override
Definition qrhimetal.mm:849
QRhiShaderResourceBindings * createShaderResourceBindings() override
void executeBufferHostWritesForSlot(QMetalBuffer *bufD, int slot)
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
QMatrix4x4 clipSpaceCorrMatrix() const override
Definition qrhimetal.mm:706
int maxTextureSize
const QRhiNativeHandles * nativeHandles() override
Definition qrhimetal.mm:886
void executeDeferredReleases(bool forced=false)
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
QRhiComputePipeline * createComputePipeline() override
bool isClipDepthZeroToOne() const override
Definition qrhimetal.mm:701
QVector< int > supportedSampleCounts
QRhiTextureRenderTarget * createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
int maxThreadGroupSize
bool isYUpInFramebuffer() const override
Definition qrhimetal.mm:691
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
quint32 osMinor
void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
void setPipelineCacheData(const QByteArray &data) override
Definition qrhimetal.mm:987
bool isAppleGPU
QByteArray pipelineCacheData() override
Definition qrhimetal.mm:932
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
void setVertexInput(QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
bool importedDevice
void tessellatedDraw(const TessDrawArgs &args)
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
void debugMarkEnd(QRhiCommandBuffer *cb) override
QRhi::FrameOpResult finish() override
QSet< QMetalSwapChain * > swapchains
bool baseVertexAndInstance
bool importedCmdQueue
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
bool makeThreadLocalNativeContextCurrent() override
Definition qrhimetal.mm:903
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
Definition qrhimetal.mm:681
void setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override
void releaseCachedResources() override
Definition qrhimetal.mm:909
QRhiDriverInfo driverInfoStruct
void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
struct QRhiMetal::@254 caps
void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
QRhiDriverInfo driverInfo() const override
Definition qrhimetal.mm:891
double lastCompletedGpuTime(QRhiCommandBuffer *cb) override
QList< int > supportedSampleCounts() const override
void draw(QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
void finishActiveReadbacks(bool forced=false)
static bool probe(QRhiMetalInitParams *params)
Definition qrhimetal.mm:488
int effectiveSampleCount(int sampleCount) const
Definition qrhimetal.mm:665
void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override
bool isFeatureSupported(QRhi::Feature feature) const override
Definition qrhimetal.mm:753
void enqueueSubresUpload(QMetalTexture *texD, void *mp, void *blitEncPtr, int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc, qsizetype *curOfs)
void destroy() override
Definition qrhimetal.mm:634
void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
\inmodule QtGui
Definition qrhi.h:1071
QSize pixelSize() const
Definition qrhi.h:1092
int sampleCount() const
Definition qrhi.h:1095
Type
Specifies the type of the renderbuffer.
Definition qrhi.h:1073
\inmodule QtGui
Definition qrhi.h:1119
\inmodule QtGui
Definition qrhi.h:1135
\inmodule QtGui
Definition qrhi.h:1694
QRhi * rhi() const
Definition qrhi.cpp:3477
\inmodule QtGui
Definition qrhi.h:1007
Filter
Specifies the minification, magnification, or mipmap filtering.
Definition qrhi.h:1009
Filter magFilter() const
Definition qrhi.h:1034
AddressMode
Specifies the addressing mode.
Definition qrhi.h:1015
Filter minFilter() const
Definition qrhi.h:1037
Filter mipmapMode() const
Definition qrhi.h:1040
\inmodule QtGui
Definition qrhi.h:138
\inmodule QtGui
Definition qrhi.h:1190
\inmodule QtGui
Definition qrhi.h:1150
\inmodule QtGui
Definition qrhi.h:1513
Format
Describes the swapchain format.
Definition qrhi.h:1525
\inmodule QtGui
Definition qrhi.h:1161
\inmodule QtGui
Definition qrhi.h:883
int arraySize() const
Definition qrhi.h:969
int sampleCount() const
Definition qrhi.h:983
Format
Specifies the texture format.
Definition qrhi.h:902
QSize pixelSize() const
Definition qrhi.h:963
\inmodule QtGui
Definition qrhi.h:85
ResourceLimit
Describes the resource limit to query.
Definition qrhi.h:1846
Feature
Flag values to indicate what features are supported by the backend currently in use.
Definition qrhi.h:1793
FrameOpResult
Describes the result of operations that can have a soft failure.
Definition qrhi.h:1786
Definition qset.h:18
\inmodule QtGui
Definition qshader.h:81
\inmodule QtCore
Definition qsize.h:25
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
static int instanceCount
EGLOutputLayerEXT layer
Flags
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
GLsizei samples
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLfloat GLfloat f
GLenum src
GLenum type
GLbitfield flags
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
GLint GLsizei GLsizei GLenum format
GLint y
void ** params
const GLubyte * c
GLint limit
GLenum GLenum colorFormat
GLsizeiptr const void GLenum usage
Definition qopenglext.h:543
static QT_BEGIN_NAMESPACE const int QMTL_FRAMES_IN_FLIGHT
Definition qrhimetal_p.h:23
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
@ desc
unsigned int quint32
Definition qtypes.h:45
int qint32
Definition qtypes.h:44
unsigned long long quint64
Definition qtypes.h:56
ptrdiff_t qsizetype
Definition qtypes.h:70
unsigned int uint
Definition qtypes.h:29
QSharedPointer< T > other(t)
[5]
view viewport() -> scroll(dx, dy, deviceRect)
aWidget window() -> setWindowTitle("New Window Title")
[2]
view create()
QJSValueList args
char * beginFullDynamicBufferUpdateForCurrentFrame() override
QMetalBufferData * d
Definition qrhimetal_p.h:38
static constexpr int WorkBufPoolUsage
Definition qrhimetal_p.h:44
int lastActiveFrameSlot
Definition qrhimetal_p.h:40
QRhiBuffer::NativeBuffer nativeBuffer() override
void endFullDynamicBufferUpdateForCurrentFrame() override
To be called when the entire contents of the buffer data has been updated in the memory block returne...
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
Creates the corresponding native graphics resources.
QMetalBuffer * currentIndexBuffer
QRhiCommandBuffer::IndexFormat currentIndexFormat
QRhiMetalCommandBufferNativeHandles nativeHandlesStruct
QPair< float, float > currentDepthBiasValues
const QRhiNativeHandles * nativeHandles()
QMetalShaderResourceBindings * currentComputeSrb
QMetalComputePipeline * currentComputePipeline
QMetalShaderResourceBindings * currentGraphicsSrb
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void resetPerPassCachedState()
QMetalCommandBufferData * d
QRhiRenderTarget * currentTarget
QMetalGraphicsPipeline * currentGraphicsPipeline
void resetState(double lastGpuTime=0)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QMetalComputePipelineData * d
bool create() override
QMetalGraphicsPipelineData * d
bool createVertexFragmentPipeline()
void setupAttachmentsInMetalRenderPassDescriptor(void *metalRpDesc, QMetalRenderPassDescriptor *rpD)
void makeActiveForCurrentRenderPassEncoder(QMetalCommandBuffer *cbD)
bool create() override
Creates the corresponding native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void setupMetalDepthStencilDescriptor(void *metalDsDesc)
bool createTessellationPipelines(const QShader &tessVert, const QShader &tesc, const QShader &tese, const QShader &tessFrag)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QMetalRenderBufferData * d
Definition qrhimetal_p.h:60
QRhiTexture::Format backingFormat() const override
bool create() override
Creates the corresponding native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QVector< quint32 > serializedFormatData
QVector< quint32 > serializedFormat() const override
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
static const int MAX_COLOR_ATTACHMENTS
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QMetalSamplerData * d
int lastActiveFrameSlot
bool create() override
struct QMetalShaderResourceBindings::BoundSampledTextureData::@235 d[QRhiShaderResourceBinding::Data::MAX_TEX_SAMPLER_ARRAY_SIZE]
QVarLengthArray< QRhiShaderResourceBinding, 8 > sortedBindings
QVarLengthArray< BoundResourceData, 8 > boundResourceData
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void updateResources(UpdateFlags flags) override
QMetalRenderTargetData * d
QSize pixelSize() const override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
float devicePixelRatio() const override
int sampleCount() const override
QWindow * window
void waitUntilCompleted(int slot)
bool createOrResize() override
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size...
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QRhiCommandBuffer * currentFrameCommandBuffer() override
QMetalCommandBuffer cbWrapper
virtual QRhiSwapChainHdrInfo hdrInfo() override
\variable QRhiSwapChainHdrInfo::isHardCodedDefaults
QMetalRenderBuffer * ds
QMetalSwapChainRenderTarget rtWrapper
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
QMetalSwapChainData * d
bool isFormatSupported(Format f) override
QSize surfacePixelSize() override
QRhiRenderTarget * currentFrameRenderTarget() override
float devicePixelRatio() const override
QMetalRenderTargetData * d
bool create() override
Creates the corresponding native graphics resources.
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
int sampleCount() const override
QSize pixelSize() const override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool prepareCreate(QSize *adjustedSize=nullptr)
NativeTexture nativeTexture() override
QMetalTextureData * d
Definition qrhimetal_p.h:81
bool create() override
Creates the corresponding native graphics resources.
int lastActiveFrameSlot
Definition qrhimetal_p.h:85
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
\inmodule QtGui
Definition qrhi.h:850
\inmodule QtGui
Definition qrhi.h:1722
QMetalCommandBuffer * cbD
enum QRhiMetal::TessDrawArgs::@255 type
\variable QRhiReadbackResult::completed
Definition qrhi.h:788
static const int MAX_TEX_SAMPLER_ARRAY_SIZE
Definition qrhi.h:498
\inmodule QtGui
Definition qrhi.h:1745
\inmodule QtGui
Definition qrhi.h:1482
\inmodule QtGui
Definition qrhi.h:1508
\inmodule QtGui
Definition qrhi.h:953
Definition moc.h:24