Commit 36bce9c5 authored by Laszlo Agocs's avatar Laszlo Agocs

vk, gl, d3d: move readbacks to res.upd. batch

...and fix up the whole res update system for d3d and gl. (make it
go through the (fake) command buffer like everything else)
parent 5969d1b8
......@@ -167,12 +167,14 @@ int main(int argc, char **argv)
cb->setViewport({ 0, 0, 1280, 720 });
cb->setVertexInput(0, { { vbuf, 0 } });
cb->draw(3);
cb->endPass();
u = r->nextResourceUpdateBatch();
QRhiReadbackDescription rb(tex);
QRhiReadbackResult rbResult;
rbResult.completed = [frame] { qDebug(" - readback %d completed", frame); };
cb->readback(rb, &rbResult);
u->readBackTexture(rb, &rbResult);
cb->endPass(u);
qDebug("Submit and wait");
r->endOffscreenFrame();
......
......@@ -180,12 +180,14 @@ int main(int argc, char **argv)
cb->setViewport({ 0, 0, 1280, 720 });
cb->setVertexInput(0, { { vbuf, 0 } });
cb->draw(3);
cb->endPass();
u = r->nextResourceUpdateBatch();
QRhiReadbackDescription rb(tex);
QRhiReadbackResult rbResult;
rbResult.completed = [frame] { qDebug(" - readback %d completed", frame); };
cb->readback(rb, &rbResult);
u->readBackTexture(rb, &rbResult);
cb->endPass(u);
qDebug("Submit and wait");
r->endOffscreenFrame();
......
......@@ -190,12 +190,14 @@ int main(int argc, char **argv)
cb->setViewport({ 0, 0, 1280, 720 });
cb->setVertexInput(0, { { vbuf, 0 } });
cb->draw(3);
cb->endPass();
u = r->nextResourceUpdateBatch();
QRhiReadbackDescription rb(tex);
QRhiReadbackResult rbResult;
rbResult.completed = [frame] { qDebug(" - readback %d completed", frame); };
cb->readback(rb, &rbResult);
u->readBackTexture(rb, &rbResult);
cb->endPass(u);
qDebug("Submit and wait");
r->endOffscreenFrame();
......
......@@ -254,9 +254,10 @@ void ExampleWindow::render()
}
if (!m_onScreenOnly)
m_liveTexCubeRenderer.queueDraw(cb, outputSize);
cb->endPass();
QRhiResourceUpdateBatch *passEndUpdates = nullptr;
#ifdef READBACK_SWAPCHAIN
passEndUpdates = m_r->nextResourceUpdateBatch();
QRhiReadbackDescription rb; // no texture given -> backbuffer
QRhiReadbackResult *rbResult = new QRhiReadbackResult;
int frameNo = m_frameCount;
......@@ -276,9 +277,11 @@ void ExampleWindow::render()
}
delete rbResult;
};
m_r->readback(cb, rb, rbResult);
passEndUpdates->readBackTexture(rb, rbResult);
#endif
cb->endPass(passEndUpdates);
m_r->endFrame(m_sc);
++m_frameCount;
......
......@@ -459,6 +459,11 @@ void QRhiResourceUpdateBatch::copyTexture(QRhiTexture *dst, QRhiTexture *src)
d->textureCopies.append({ dst, src, QRhiTextureCopyDescription() });
}
void QRhiResourceUpdateBatch::readBackTexture(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
{
d->textureReadbacks.append({ rb, result });
}
void QRhiResourceUpdateBatch::prepareTextureForUse(QRhiTexture *tex, TexturePrepareFlags flags)
{
d->texturePrepares.append({ tex, flags });
......@@ -501,6 +506,7 @@ void QRhiResourceUpdateBatchPrivate::free()
staticBufferUploads.clear();
textureUploads.clear();
textureCopies.clear();
textureReadbacks.clear();
texturePrepares.clear();
rhi->resUpdPoolMap.clearBit(poolIndex);
......@@ -513,15 +519,21 @@ void QRhiResourceUpdateBatchPrivate::merge(QRhiResourceUpdateBatchPrivate *other
staticBufferUploads += other->staticBufferUploads;
textureUploads += other->textureUploads;
textureCopies += other->textureCopies;
textureReadbacks += other->textureReadbacks;
texturePrepares += other->texturePrepares;
}
void QRhiCommandBuffer::resourceUpdate(QRhiResourceUpdateBatch *resourceUpdates)
{
rhi->resourceUpdate(this, resourceUpdates);
}
void QRhiCommandBuffer::beginPass(QRhiRenderTarget *rt,
const QRhiColorClearValue &colorClearValue,
const QRhiDepthStencilClearValue &depthStencilClearValue,
QRhiResourceUpdateBatch *resourceUpdates)
{
rhi->beginPass(rt, this, colorClearValue, depthStencilClearValue, resourceUpdates);
rhi->beginPass(this, rt, colorClearValue, depthStencilClearValue, resourceUpdates);
}
void QRhiCommandBuffer::endPass(QRhiResourceUpdateBatch *resourceUpdates)
......@@ -575,11 +587,6 @@ void QRhiCommandBuffer::drawIndexed(quint32 indexCount,
rhi->drawIndexed(this, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
}
bool QRhiCommandBuffer::readback(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
{
return rhi->readback(this, rb, result);
}
int QRhi::ubufAligned(int v) const
{
const int byteAlign = ubufAlignment();
......
......@@ -319,7 +319,7 @@ Q_DECLARE_TYPEINFO(QRhiTextureCopyDescription, Q_MOVABLE_TYPE);
struct Q_RHI_EXPORT QRhiReadbackDescription
{
QRhiReadbackDescription() { } // source is the current back buffer (if swapchain supports readback)
QRhiReadbackDescription() { } // source is the back buffer of the swapchain of the current frame (if the swapchain supports readback)
QRhiReadbackDescription(QRhiTexture *texture_) : texture(texture_) { } // source is the specified texture
QRhiTexture *texture = nullptr;
int layer = 0;
......@@ -879,14 +879,6 @@ protected:
Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiSwapChain::SurfaceImportFlags)
struct Q_RHI_EXPORT QRhiReadbackResult
{
std::function<void()> completed = nullptr;
QRhiTexture::Format format;
QSize pixelSize;
QByteArray data;
}; // non-movable due to the std::function
class Q_RHI_EXPORT QRhiCommandBuffer : public QRhiResource
{
public:
......@@ -895,6 +887,11 @@ public:
IndexUInt32
};
// Sometimes committing the updates is necessary without starting a render
// pass. Not often needed, updates should typically be passed to beginPass
// (or endPass, in case of readbacks) instead.
void resourceUpdate(QRhiResourceUpdateBatch *resourceUpdates);
void beginPass(QRhiRenderTarget *rt,
const QRhiColorClearValue &colorClearValue, // ignored when rt has PreserveColorContents
const QRhiDepthStencilClearValue &depthStencilClearValue, // ignored when no ds attachment
......@@ -937,9 +934,17 @@ public:
qint32 vertexOffset = 0,
quint32 firstInstance = 0);
protected:
QRhiCommandBuffer(QRhiImplementation *rhi);
void *m_reserved;
};
struct Q_RHI_EXPORT QRhiReadbackResult
{
/*
When used in a begin-endFrame (not offscreen), the data may only be
available in a future frame. Hence the completed callback:
When doing a readback after a pass inside a begin-endFrame (not
offscreen), the data may only be available in a future frame. Hence the
completed callback:
beginFrame(sc);
beginPass
...
......@@ -956,16 +961,15 @@ public:
};
u = nextResourceUpdateBatch();
QRhiReadbackDescription rb; // no texture -> backbuffer
u->readback(rb, rbResult);
u->readBackTexture(rb, rbResult);
endPass(u);
endFrame(sc);
*/
bool readback(const QRhiReadbackDescription &rb, QRhiReadbackResult *result);
protected:
QRhiCommandBuffer(QRhiImplementation *rhi);
void *m_reserved;
};
std::function<void()> completed = nullptr;
QRhiTexture::Format format;
QSize pixelSize;
QByteArray data;
}; // non-movable due to the std::function
class Q_RHI_EXPORT QRhiResourceUpdateBatch // sort of a command buffer for copy type of operations
{
......@@ -986,14 +990,16 @@ public:
// beginPass(). (nb the one we merged from must be release()'d manually)
void merge(QRhiResourceUpdateBatch *other);
// None of these execute anything. Deferred to beginPass. What exactly then
// happens underneath is hidden from the applications.
// None of these execute anything. Deferred to
// beginPass/endPass/resourceUpdate. What exactly then happens underneath
// is hidden from the applications.
void updateDynamicBuffer(QRhiBuffer *buf, int offset, int size, const void *data);
void uploadStaticBuffer(QRhiBuffer *buf, const void *data);
void uploadTexture(QRhiTexture *tex, const QRhiTextureUploadDescription &desc);
void uploadTexture(QRhiTexture *tex, const QImage &image); // shortcut
void copyTexture(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc);
void copyTexture(QRhiTexture *dst, QRhiTexture *src); // shortcut
void readBackTexture(const QRhiReadbackDescription &rb, QRhiReadbackResult *result);
// This is not normally needed, textures that have an upload or are used
// with a TextureRenderTarget will be fine without it. May be more relevant later.
......@@ -1122,7 +1128,7 @@ public:
beginPass
...
u = nextResourceUpdateBatch();
u->readback(rb, &rbResult);
u->readBackTexture(rb, &rbResult);
endPass(u);
endOffscreenFrame();
// image data available in rbResult
......@@ -1131,14 +1137,10 @@ public:
FrameOpResult endOffscreenFrame();
// Waits for any work on the graphics queue (where applicable) to complete,
// then forcibly executes all deferred operations, like completing
// readbacks and resource releases. This should _not_ be used in practice,
// except in infrequent special cases, like when the results of a readback
// are needed asap and no new frames are going to be generated for some
// time. Can be called inside and outside of a frame, but not inside a
// pass. Inside a frame it implies submitting any work on the command
// buffer. Unnecessary in combination with begin/endOffscreenFrame because
// ending an offscreen frame implies waiting for completion.
// then executes all deferred operations, like completing readbacks and
// resource releases. Can be called inside and outside of a frame, but not
// inside a pass. Inside a frame it implies submitting any work on the
// command buffer.
QRhi::FrameOpResult finish();
// Returns an instance to which updates can be queued. Batch instances are
......
......@@ -86,11 +86,12 @@ public:
virtual QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain) = 0;
virtual QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb) = 0;
virtual QRhi::FrameOpResult endOffscreenFrame() = 0;
virtual bool readback(QRhiCommandBuffer *cb, const QRhiReadbackDescription &rb, QRhiReadbackResult *result) = 0;
virtual QRhi::FrameOpResult finish() = 0;
virtual void beginPass(QRhiRenderTarget *rt,
QRhiCommandBuffer *cb,
virtual void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) = 0;
virtual void beginPass(QRhiCommandBuffer *cb,
QRhiRenderTarget *rt,
const QRhiColorClearValue &colorClearValue,
const QRhiDepthStencilClearValue &depthStencilClearValue,
QRhiResourceUpdateBatch *resourceUpdates) = 0;
......@@ -181,6 +182,16 @@ struct QRhiResourceUpdateBatchPrivate
QRhiTextureCopyDescription desc;
};
struct TextureRead {
TextureRead() { }
TextureRead(const QRhiReadbackDescription &rb_, QRhiReadbackResult *result_)
: rb(rb_), result(result_)
{ }
QRhiReadbackDescription rb;
QRhiReadbackResult *result;
};
struct TexturePrepare {
TexturePrepare() { }
TexturePrepare(QRhiTexture *tex_, QRhiResourceUpdateBatch::TexturePrepareFlags flags_)
......@@ -195,6 +206,7 @@ struct QRhiResourceUpdateBatchPrivate
QVector<StaticBufferUpload> staticBufferUploads;
QVector<TextureUpload> textureUploads;
QVector<TextureCopy> textureCopies;
QVector<TextureRead> textureReadbacks;
QVector<TexturePrepare> texturePrepares;
QRhiResourceUpdateBatch *q = nullptr;
......@@ -211,6 +223,7 @@ Q_DECLARE_TYPEINFO(QRhiResourceUpdateBatchPrivate::DynamicBufferUpdate, Q_MOVABL
Q_DECLARE_TYPEINFO(QRhiResourceUpdateBatchPrivate::StaticBufferUpload, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(QRhiResourceUpdateBatchPrivate::TextureUpload, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(QRhiResourceUpdateBatchPrivate::TextureCopy, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(QRhiResourceUpdateBatchPrivate::TextureRead, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(QRhiResourceUpdateBatchPrivate::TexturePrepare, Q_MOVABLE_TYPE);
template<typename T>
......
This diff is collapsed.
......@@ -240,7 +240,8 @@ struct QD3D11CommandBuffer : public QRhiCommandBuffer
BlendConstants,
Draw,
DrawIndexed,
ReadPixels
UpdateSubRes,
CopySubRes
};
enum ClearFlag { Color = 1, Depth = 2, Stencil = 4 };
Cmd cmd;
......@@ -303,15 +304,23 @@ struct QD3D11CommandBuffer : public QRhiCommandBuffer
quint32 firstInstance;
} drawIndexed;
struct {
ID3D11Resource *dst;
UINT dstSubRes;
bool hasDstBox;
D3D11_BOX dstBox;
const void *src; // must come from retain*()
UINT srcRowPitch;
} updateSubRes;
struct {
ID3D11Resource *dst;
UINT dstSubRes;
UINT dstX;
UINT dstY;
ID3D11Resource *src;
QRhiTexture::Format format;
DXGI_FORMAT dxgiFormat;
int w;
int h;
quint32 byteSize;
UINT subres;
QRhiReadbackResult *result;
} readPixels;
UINT srcSubRes;
bool hasSrcBox;
D3D11_BOX srcBox;
} copySubRes;
} args;
};
......@@ -322,8 +331,22 @@ struct QD3D11CommandBuffer : public QRhiCommandBuffer
QRhiShaderResourceBindings *currentSrb;
uint currentSrbGeneration;
QVector<QByteArray> dataRetainPool;
QVector<QImage> imageRetainPool;
// relies heavily on implicit sharing (no copies of the actual data will be made)
const void *retainData(const QByteArray &data) {
dataRetainPool.append(data);
return dataRetainPool.constLast().constData();
}
const void *retainImage(const QImage &image) {
imageRetainPool.append(image);
return imageRetainPool.constLast().constBits();
}
void resetCommands() {
commands.clear();
dataRetainPool.clear();
imageRetainPool.clear();
}
void resetState() {
resetCommands();
......@@ -401,11 +424,12 @@ public:
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain) override;
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb) override;
QRhi::FrameOpResult endOffscreenFrame() override;
bool readback(QRhiCommandBuffer *cb, const QRhiReadbackDescription &rb, QRhiReadbackResult *result) override;
QRhi::FrameOpResult finish() override;
void beginPass(QRhiRenderTarget *rt,
QRhiCommandBuffer *cb,
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
void beginPass(QRhiCommandBuffer *cb,
QRhiRenderTarget *rt,
const QRhiColorClearValue &colorClearValue,
const QRhiDepthStencilClearValue &depthStencilClearValue,
QRhiResourceUpdateBatch *resourceUpdates) override;
......@@ -440,13 +464,13 @@ public:
void create();
void destroy();
void commitResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
void updateShaderResourceBindings(QD3D11ShaderResourceBindings *srbD);
void executeBufferHostWritesForCurrentFrame(QD3D11Buffer *bufD);
void setShaderResources(QD3D11ShaderResourceBindings *srbD);
void executeCommandBuffer(QD3D11CommandBuffer *cbD);
void readPixels(const QD3D11CommandBuffer::Command &cmd);
DXGI_SAMPLE_DESC effectiveSampleCount(int sampleCount) const;
void finishActiveReadbacks();
bool debugLayer = false;
bool importedDevice = false;
......@@ -470,8 +494,20 @@ public:
bool active = false;
QD3D11CommandBuffer cbWrapper;
} ofr;
struct ActiveReadback {
QRhiReadbackDescription desc;
QRhiReadbackResult *result;
ID3D11Texture2D *stagingTex;
quint32 bufSize;
QSize pixelSize;
QRhiTexture::Format format;
};
QVector<ActiveReadback> activeReadbacks;
};
Q_DECLARE_TYPEINFO(QRhiD3D11::ActiveReadback, Q_MOVABLE_TYPE);
QT_END_NAMESPACE
#endif
This diff is collapsed.
......@@ -230,7 +230,13 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer
BindGraphicsPipeline,
BindFramebuffer,
Clear,
ReadPixels
BufferData,
BufferSubData,
CopyTex,
ReadPixels,
SubImage,
CompressedImage,
CompressedSubImage
};
Cmd cmd;
union {
......@@ -284,11 +290,69 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer
QRhiTextureRenderTarget *rt;
} bindFramebuffer;
struct {
QRhiTexture *tex;
GLenum target;
GLuint buffer;
int size;
const void *data; // must come from retainData()
} bufferData;
struct {
GLenum target;
GLuint buffer;
int offset;
int size;
const void *data; // must come from retainData()
} bufferSubData;
struct {
GLenum srcTarget;
GLuint srcTexture;
int srcLevel;
int srcX;
int srcY;
GLenum dstTarget;
GLuint dstTexture;
int dstLevel;
int dstX;
int dstY;
int w;
int h;
} copyTex;
struct {
QRhiReadbackResult *result;
QGles2Texture *texture;
int layer;
int level;
QRhiReadbackResult *result;
} readPixels;
struct {
GLenum target;
int level;
int dx;
int dy;
int w;
int h;
GLenum glformat;
GLenum gltype;
const void *data; // must come from retainImage()
} subImage;
struct {
GLenum target;
int level;
GLenum glintformat;
int w;
int h;
int size;
const void *data; // must come from retainData()
} compressedImage;
struct {
GLenum target;
int level;
int dx;
int dy;
int w;
int h;
GLenum glintformat;
int size;
const void *data; // must come from retainData()
} compressedSubImage;
} args;
};
......@@ -299,10 +363,23 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer
QRhiShaderResourceBindings *currentSrb;
uint currentSrbGeneration;
QVector<QByteArray> dataRetainPool;
QVector<QImage> imageRetainPool;
// relies heavily on implicit sharing (no copies of the actual data will be made)
const void *retainData(const QByteArray &data) {
dataRetainPool.append(data);
return dataRetainPool.constLast().constData();
}
const void *retainImage(const QImage &image) {
imageRetainPool.append(image);
return imageRetainPool.constLast().constBits();
}
void resetCommands() {
commands.clear();
dataRetainPool.clear();
imageRetainPool.clear();
}
void resetState() {
resetCommands();
currentTarget = nullptr;
......@@ -365,11 +442,12 @@ public:
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain) override;
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb) override;
QRhi::FrameOpResult endOffscreenFrame() override;
bool readback(QRhiCommandBuffer *cb, const QRhiReadbackDescription &rb, QRhiReadbackResult *result) override;
QRhi::FrameOpResult finish() override;
void beginPass(QRhiRenderTarget *rt,
QRhiCommandBuffer *cb,
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
void beginPass(QRhiCommandBuffer *cb,
QRhiRenderTarget *rt,
const QRhiColorClearValue &colorClearValue,
const QRhiDepthStencilClearValue &depthStencilClearValue,
QRhiResourceUpdateBatch *resourceUpdates) override;
......@@ -406,7 +484,7 @@ public:
void create();
void destroy();
void executeDeferredReleases();
void commitResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
void executeCommandBuffer(QRhiCommandBuffer *cb);
void executeBindGraphicsPipeline(QRhiGraphicsPipeline *ps, QRhiShaderResourceBindings *srb);
void setChangedUniforms(QGles2GraphicsPipeline *psD, QRhiShaderResourceBindings *srb, bool changedOnly);
......
......@@ -569,17 +569,6 @@ QRhi::FrameOpResult QRhiMetal::endOffscreenFrame()
return QRhi::FrameOpError;
}
bool QRhiMetal::readback(QRhiCommandBuffer *cb, const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
{
Q_UNUSED(cb);
Q_UNUSED(rb);
Q_UNUSED(result);
Q_ASSERT(inFrame && !inPass);
return false;
}
QRhi::FrameOpResult QRhiMetal::finish()
{
Q_ASSERT(!inPass);
......@@ -613,7 +602,7 @@ MTLRenderPassDescriptor *QRhiMetalData::createDefaultRenderPass(bool hasDepthSte
return rp;
}
void QRhiMetal::commitResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
void QRhiMetal::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
{
QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
QRhiResourceUpdateBatchPrivate *ud = QRhiResourceUpdateBatchPrivate::get(resourceUpdates);
......@@ -726,8 +715,15 @@ void QRhiMetal::executeBufferHostWritesForCurrentFrame(QMetalBuffer *bufD)
updates.clear();
}
void QRhiMetal::beginPass(QRhiRenderTarget *rt,
QRhiCommandBuffer *cb,
void QRhiMetal::resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
{
Q_ASSERT(inFrame && !inPass);
enqueueResourceUpdates(cb, resourceUpdates);
}
void QRhiMetal::beginPass(QRhiCommandBuffer *cb,
QRhiRenderTarget *rt,
const QRhiColorClearValue &colorClearValue,
const QRhiDepthStencilClearValue &depthStencilClearValue,
QRhiResourceUpdateBatch *resourceUpdates)
......@@ -735,7 +731,7 @@ void QRhiMetal::beginPass(QRhiRenderTarget *rt,
Q_ASSERT(!inPass);
if (resourceUpdates)
commitResourceUpdates(cb, resourceUpdates);
enqueueResourceUpdates(cb, resourceUpdates);
QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
......@@ -787,7 +783,7 @@ void QRhiMetal::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resource
cbD->currentTarget = nullptr;
if (resourceUpdates)
commitResourceUpdates(cb, resourceUpdates);
enqueueResourceUpdates(cb, resourceUpdates);
}
void QRhiMetal::executeDeferredReleases(bool forced)
......
......@@ -267,11 +267,12 @@ public:
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain) override;
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb) override;
QRhi::FrameOpResult endOffscreenFrame() override;
bool readback(QRhiCommandBuffer *cb, const QRhiReadbackDescription &rb, QRhiReadbackResult *result) override;
QRhi::FrameOpResult finish() override;
void beginPass(QRhiRenderTarget *rt,
QRhiCommandBuffer *cb,
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
void beginPass(QRhiCommandBuffer *cb,
QRhiRenderTarget *rt,
const QRhiColorClearValue &colorClearValue,
const QRhiDepthStencilClearValue &depthStencilClearValue,
QRhiResourceUpdateBatch *resourceUpdates) override;
......@@ -307,7 +308,7 @@ public:
void create();
void destroy();
void executeDeferredReleases(bool forced = false);
void commitResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
void executeBufferHostWritesForCurrentFrame(QMetalBuffer *bufD);
bool importedDevice = false;
......
This diff is collapsed.
......@@ -330,11 +330,12 @@ public:
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain) override;
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb) override;
QRhi::FrameOpResult endOffscreenFrame() override;
bool readback(QRhiCommandBuffer *cb, const