Commit 9717a48f authored by Laszlo Agocs's avatar Laszlo Agocs

Remove prepareTextureForUse for now

parent 2fe80010
......@@ -277,10 +277,11 @@ void TriangleOnCubeRenderer::queueResourceUpdates(QRhiResourceUpdateBatch *resou
mvp.rotate(m_rotation, 1, 0, 0);
resourceUpdates->updateDynamicBuffer(m_ubuf, 0, 64, mvp.constData());
if (DEPTH_TEXTURE) {
// m_tex is basically undefined here, be nice and transition the layout properly at least
resourceUpdates->prepareTextureForUse(m_tex, QRhiResourceUpdateBatch::TextureRead);
}
// ###
// if (DEPTH_TEXTURE) {
// // m_tex is basically undefined here, be nice and transition the layout properly at least
// resourceUpdates->prepareTextureForUse(m_tex, QRhiResourceUpdateBatch::TextureRead);
// }
}
void TriangleOnCubeRenderer::queueOffscreenPass(QRhiCommandBuffer *cb)
......
......@@ -2842,11 +2842,6 @@ QRhi *QRhi::create(Implementation impl, QRhiInitParams *params, Flags flags, QRh
QRhi::nextResourceUpdateBatch().
*/
/*!
\enum QRhiResourceUpdateBatch::TexturePrepareFlag
\internal
*/
/*!
\internal
*/
......@@ -3056,14 +3051,6 @@ void QRhiResourceUpdateBatch::generateMips(QRhiTexture *tex)
d->textureMipGens.append(QRhiResourceUpdateBatchPrivate::TextureMipGen(tex));
}
/*!
\internal
*/
void QRhiResourceUpdateBatch::prepareTextureForUse(QRhiTexture *tex, TexturePrepareFlags flags)
{
d->texturePrepares.append({ tex, flags });
}
/*!
\return an available, empty batch to which copy type of operations can be
recorded.
......@@ -3116,7 +3103,6 @@ void QRhiResourceUpdateBatchPrivate::free()
textureCopies.clear();
textureReadbacks.clear();
textureMipGens.clear();
texturePrepares.clear();
rhi->resUpdPoolMap.clearBit(poolIndex);
poolIndex = -1;
......@@ -3130,7 +3116,6 @@ void QRhiResourceUpdateBatchPrivate::merge(QRhiResourceUpdateBatchPrivate *other
textureCopies += other->textureCopies;
textureReadbacks += other->textureReadbacks;
textureMipGens += other->textureMipGens;
texturePrepares += other->texturePrepares;
}
/*!
......
......@@ -1083,12 +1083,6 @@ struct Q_RHI_EXPORT QRhiReadbackResult
class Q_RHI_EXPORT QRhiResourceUpdateBatch
{
public:
enum TexturePrepareFlag {
TextureRead = 1 << 0,
TextureWrite = 1 << 1
};
Q_DECLARE_FLAGS(TexturePrepareFlags, TexturePrepareFlag)
~QRhiResourceUpdateBatch();
void release();
......@@ -1104,8 +1098,6 @@ public:
void readBackTexture(const QRhiReadbackDescription &rb, QRhiReadbackResult *result);
void generateMips(QRhiTexture *tex);
void prepareTextureForUse(QRhiTexture *tex, TexturePrepareFlags flags);
private:
QRhiResourceUpdateBatch(QRhiImplementation *rhi);
Q_DISABLE_COPY(QRhiResourceUpdateBatch)
......@@ -1114,8 +1106,6 @@ private:
friend class QRhi;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiResourceUpdateBatch::TexturePrepareFlags)
class Q_RHI_EXPORT QRhiResourceSharingHost
{
public:
......
......@@ -260,23 +260,12 @@ public:
QRhiTexture *tex = nullptr;
};
struct TexturePrepare {
TexturePrepare() { }
TexturePrepare(QRhiTexture *tex_, QRhiResourceUpdateBatch::TexturePrepareFlags flags_)
: tex(tex_), flags(flags_)
{ }
QRhiTexture *tex = nullptr;
QRhiResourceUpdateBatch::TexturePrepareFlags flags;
};
QVector<DynamicBufferUpdate> dynamicBufferUpdates;
QVector<StaticBufferUpload> staticBufferUploads;
QVector<TextureUpload> textureUploads;
QVector<TextureCopy> textureCopies;
QVector<TextureRead> textureReadbacks;
QVector<TextureMipGen> textureMipGens;
QVector<TexturePrepare> texturePrepares;
QRhiResourceUpdateBatch *q = nullptr;
QRhiImplementation *rhi = nullptr;
......@@ -294,7 +283,6 @@ 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::TextureMipGen, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(QRhiResourceUpdateBatchPrivate::TexturePrepare, Q_MOVABLE_TYPE);
class Q_RHI_PRIVATE_EXPORT QRhiShaderResourceBindingPrivate
{
......
......@@ -2697,14 +2697,6 @@ void QRhiVulkan::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdat
finishTransferDest(cb, utexD);
}
for (const QRhiResourceUpdateBatchPrivate::TexturePrepare &u : ud->texturePrepares) {
if (u.flags.testFlag(QRhiResourceUpdateBatch::TextureRead)) {
QVkTexture *utexD = QRHI_RES(QVkTexture, u.tex);
if (utexD->layout != VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
finishTransferDest(cb, utexD);
}
}
ud->free();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment