Commit c3e718a0 authored by Laszlo Agocs's avatar Laszlo Agocs

Unify tex and rt apis

hints -> flags for rt, add sampleCount for tex
parent 8394ef03
......@@ -82,7 +82,7 @@ void Window::customInit()
d.compressedData = loadBC1(QLatin1String(":/qt256_bc1_9mips.dds"), &imageSize);
qDebug() << d.compressedData.count() << imageSize << m_r->mipLevelsForSize(imageSize);
d.tex = m_r->newTexture(QRhiTexture::BC1, imageSize, QRhiTexture::MipMapped);
d.tex = m_r->newTexture(QRhiTexture::BC1, imageSize, 1, QRhiTexture::MipMapped);
d.tex->build();
d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::Linear,
......
......@@ -83,7 +83,7 @@ int main(int argc, char **argv)
return 1;
}
QRhiTexture *tex = r->newTexture(QRhiTexture::RGBA8, QSize(1280, 720), QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource);
QRhiTexture *tex = r->newTexture(QRhiTexture::RGBA8, QSize(1280, 720), 1, QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource);
tex->build();
QRhiTextureRenderTarget *rt = r->newTextureRenderTarget({ tex });
QRhiRenderPassDescriptor *rp = rt->newCompatibleRenderPassDescriptor();
......
......@@ -96,7 +96,7 @@ int main(int argc, char **argv)
return 1;
}
QRhiTexture *tex = r->newTexture(QRhiTexture::RGBA8, QSize(1280, 720), QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource);
QRhiTexture *tex = r->newTexture(QRhiTexture::RGBA8, QSize(1280, 720), 1, QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource);
tex->build();
QRhiTextureRenderTarget *rt = r->newTextureRenderTarget({ tex });
QRhiRenderPassDescriptor *rp = rt->newCompatibleRenderPassDescriptor();
......
......@@ -106,7 +106,7 @@ int main(int argc, char **argv)
return 1;
}
QRhiTexture *tex = r->newTexture(QRhiTexture::RGBA8, QSize(1280, 720), QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource);
QRhiTexture *tex = r->newTexture(QRhiTexture::RGBA8, QSize(1280, 720), 1, QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource);
tex->build();
QRhiTextureRenderTarget *rt = r->newTextureRenderTarget({ tex });
QRhiRenderPassDescriptor *rp = rt->newCompatibleRenderPassDescriptor();
......
......@@ -78,7 +78,7 @@ void TexturedCubeRenderer::initResources(QRhiRenderPassDescriptor *rp)
QRhiTexture::Flags texFlags = 0;
if (MIPMAP)
texFlags |= QRhiTexture::MipMapped;
m_tex = m_r->newTexture(QRhiTexture::RGBA8, QSize(m_image.width(), m_image.height()), texFlags);
m_tex = m_r->newTexture(QRhiTexture::RGBA8, QSize(m_image.width(), m_image.height()), 1, texFlags);
m_tex->build();
m_sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, MIPMAP ? QRhiSampler::Linear : QRhiSampler::None,
......
......@@ -87,11 +87,11 @@ void TriangleOnCubeRenderer::initResources(QRhiRenderPassDescriptor *rp)
m_image = m_image.mirrored(); // just cause we'll flip texcoord Y when y up so accomodate our static background image as well
}
m_tex = m_r->newTexture(QRhiTexture::RGBA8, OFFSCREEN_SIZE, QRhiTexture::RenderTarget);
m_tex = m_r->newTexture(QRhiTexture::RGBA8, OFFSCREEN_SIZE, 1, QRhiTexture::RenderTarget);
m_tex->build();
if (MRT) {
m_tex2 = m_r->newTexture(QRhiTexture::RGBA8, OFFSCREEN_SIZE, QRhiTexture::RenderTarget);
m_tex2 = m_r->newTexture(QRhiTexture::RGBA8, OFFSCREEN_SIZE, 1, QRhiTexture::RenderTarget);
m_tex2->build();
}
......@@ -143,7 +143,7 @@ void TriangleOnCubeRenderer::initResources(QRhiRenderPassDescriptor *rp)
if (DEPTH_TEXTURE) {
m_offscreenTriangle.setDepthWrite(true);
m_depthTex = m_r->newTexture(QRhiTexture::D32, OFFSCREEN_SIZE, QRhiTexture::RenderTarget);
m_depthTex = m_r->newTexture(QRhiTexture::D32, OFFSCREEN_SIZE, 1, QRhiTexture::RenderTarget);
m_depthTex->build();
}
......
......@@ -77,7 +77,7 @@ void Window::customInit()
d.ubuf->build();
QImage baseImage(QLatin1String(":/qt256.png"));
d.tex = m_r->newTexture(QRhiTexture::RGBA8, baseImage.size(), QRhiTexture::UsedAsTransferSource);
d.tex = m_r->newTexture(QRhiTexture::RGBA8, baseImage.size(), 1, QRhiTexture::UsedAsTransferSource);
d.tex->build();
// As an alternative to what some of the other examples do, prepare an
......
......@@ -72,15 +72,16 @@ QRhiBuffer::QRhiBuffer(QRhiImplementation *rhi, Type type_, UsageFlags usage_, i
}
QRhiRenderBuffer::QRhiRenderBuffer(QRhiImplementation *rhi, Type type_, const QSize &pixelSize_,
int sampleCount_, Hints hints_)
int sampleCount_, Flags flags_)
: QRhiResource(rhi),
m_type(type_), m_pixelSize(pixelSize_), m_sampleCount(sampleCount_), m_hints(hints_)
m_type(type_), m_pixelSize(pixelSize_), m_sampleCount(sampleCount_), m_flags(flags_)
{
}
QRhiTexture::QRhiTexture(QRhiImplementation *rhi, Format format_, const QSize &pixelSize_, Flags flags_)
QRhiTexture::QRhiTexture(QRhiImplementation *rhi, Format format_, const QSize &pixelSize_,
int sampleCount_, Flags flags_)
: QRhiResource(rhi),
m_format(format_), m_pixelSize(pixelSize_), m_flags(flags_)
m_format(format_), m_pixelSize(pixelSize_), m_sampleCount(sampleCount_), m_flags(flags_)
{
}
......@@ -632,16 +633,17 @@ QRhiBuffer *QRhi::newBuffer(QRhiBuffer::Type type,
QRhiRenderBuffer *QRhi::newRenderBuffer(QRhiRenderBuffer::Type type,
const QSize &pixelSize,
int sampleCount,
QRhiRenderBuffer::Hints hints)
QRhiRenderBuffer::Flags flags)
{
return d->createRenderBuffer(type, pixelSize, sampleCount, hints);
return d->createRenderBuffer(type, pixelSize, sampleCount, flags);
}
QRhiTexture *QRhi::newTexture(QRhiTexture::Format format,
const QSize &pixelSize,
int sampleCount,
QRhiTexture::Flags flags)
{
return d->createTexture(format, pixelSize, flags);
return d->createTexture(format, pixelSize, sampleCount, flags);
}
QRhiSampler *QRhi::newSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
......
......@@ -387,10 +387,10 @@ public:
DepthStencil
};
enum Hint {
enum Flag {
ToBeUsedWithSwapChainOnly = 1 << 0 // use implicit winsys buffers, don't create anything (GL)
};
Q_DECLARE_FLAGS(Hints, Hint)
Q_DECLARE_FLAGS(Flags, Flag)
Type type() const { return m_type; }
void setType(Type t) { m_type = t; }
......@@ -401,22 +401,22 @@ public:
int sampleCount() const { return m_sampleCount; }
void setSampleCount(int s) { m_sampleCount = s; }
Hints hints() const { return m_hints; }
void setHints(Hints h) { m_hints = h; }
Flags flags() const { return m_flags; }
void setFlags(Flags h) { m_flags = h; }
virtual bool build() = 0;
protected:
QRhiRenderBuffer(QRhiImplementation *rhi, Type type_, const QSize &pixelSize_,
int sampleCount_, Hints hints_);
int sampleCount_, Flags flags_);
Type m_type;
QSize m_pixelSize;
int m_sampleCount;
Hints m_hints;
Flags m_flags;
void *m_reserved;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiRenderBuffer::Hints)
Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiRenderBuffer::Flags)
class Q_RHI_EXPORT QRhiTexture : public QRhiResource
{
......@@ -427,7 +427,7 @@ public:
CubeMap = 1 << 2,
MipMapped = 1 << 3,
sRGB = 1 << 4,
UsedAsTransferSource = 1 << 5
UsedAsTransferSource = 1 << 5 // will (also) be used as the source of a readback or copy
};
Q_DECLARE_FLAGS(Flags, Flag)
......@@ -479,13 +479,18 @@ public:
Flags flags() const { return m_flags; }
void setFlags(Flags f) { m_flags = f; }
int sampleCount() const { return m_sampleCount; }
void setSampleCount(int s) { m_sampleCount = s; }
virtual bool build() = 0;
protected:
QRhiTexture(QRhiImplementation *rhi, Format format_, const QSize &pixelSize_, Flags flags_);
QRhiTexture(QRhiImplementation *rhi, Format format_, const QSize &pixelSize_,
int sampleCount_, Flags flags_);
Format m_format;
QSize m_pixelSize;
Flags m_flags;
int m_sampleCount;
void *m_reserved;
};
......@@ -1064,15 +1069,16 @@ public:
// To be used for depth-stencil when no access is needed afterwards.
// Transient image, backed by lazily allocated memory (on Vulkan at least,
// ideal for tiled GPUs). May also be a dummy internally depending on the
// backend and the hints (OpenGL, where the winsys interface provides the
// backend and the flags (OpenGL, where the winsys interface provides the
// depth-stencil buffer via the window surface).
QRhiRenderBuffer *newRenderBuffer(QRhiRenderBuffer::Type type,
const QSize &pixelSize,
int sampleCount = 1,
QRhiRenderBuffer::Hints hints = QRhiRenderBuffer::Hints());
QRhiRenderBuffer::Flags flags = QRhiRenderBuffer::Flags());
QRhiTexture *newTexture(QRhiTexture::Format format,
const QSize &pixelSize,
int sampleCount = 1,
QRhiTexture::Flags flags = QRhiTexture::Flags());
QRhiSampler *newSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
......
......@@ -69,9 +69,10 @@ public:
virtual QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
const QSize &pixelSize,
int sampleCount,
QRhiRenderBuffer::Hints hints) = 0;
QRhiRenderBuffer::Flags flags) = 0;
virtual QRhiTexture *createTexture(QRhiTexture::Format format,
const QSize &pixelSize,
int sampleCount,
QRhiTexture::Flags flags) = 0;
virtual QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
QRhiSampler::Filter mipmapMode,
......
......@@ -242,14 +242,15 @@ bool QRhiD3D11::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture
}
QRhiRenderBuffer *QRhiD3D11::createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Hints hints)
int sampleCount, QRhiRenderBuffer::Flags flags)
{
return new QD3D11RenderBuffer(this, type, pixelSize, sampleCount, hints);
return new QD3D11RenderBuffer(this, type, pixelSize, sampleCount, flags);
}
QRhiTexture *QRhiD3D11::createTexture(QRhiTexture::Format format, const QSize &pixelSize, QRhiTexture::Flags flags)
QRhiTexture *QRhiD3D11::createTexture(QRhiTexture::Format format, const QSize &pixelSize,
int sampleCount, QRhiTexture::Flags flags)
{
return new QD3D11Texture(this, format, pixelSize, flags);
return new QD3D11Texture(this, format, pixelSize, sampleCount, flags);
}
QRhiSampler *QRhiD3D11::createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
......@@ -1268,8 +1269,8 @@ bool QD3D11Buffer::build()
}
QD3D11RenderBuffer::QD3D11RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Hints hints)
: QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, hints)
int sampleCount, QRhiRenderBuffer::Flags flags)
: QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, flags)
{
}
......@@ -1325,8 +1326,9 @@ bool QD3D11RenderBuffer::build()
return false;
}
QD3D11Texture::QD3D11Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, Flags flags)
: QRhiTexture(rhi, format, pixelSize, flags)
QD3D11Texture::QD3D11Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
int sampleCount, Flags flags)
: QRhiTexture(rhi, format, pixelSize, sampleCount, flags)
{
}
......
......@@ -67,7 +67,7 @@ struct QD3D11Buffer : public QRhiBuffer
struct QD3D11RenderBuffer : public QRhiRenderBuffer
{
QD3D11RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Hints hints);
int sampleCount, QRhiRenderBuffer::Flags flags);
void release() override;
bool build() override;
......@@ -78,7 +78,8 @@ struct QD3D11RenderBuffer : public QRhiRenderBuffer
struct QD3D11Texture : public QRhiTexture
{
QD3D11Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, Flags flags);
QD3D11Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
int sampleCount, Flags flags);
void release() override;
bool build() override;
......@@ -382,9 +383,10 @@ public:
QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
const QSize &pixelSize,
int sampleCount,
QRhiRenderBuffer::Hints hints) override;
QRhiRenderBuffer::Flags flags) override;
QRhiTexture *createTexture(QRhiTexture::Format format,
const QSize &pixelSize,
int sampleCount,
QRhiTexture::Flags flags) override;
QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
QRhiSampler::Filter mipmapMode,
......
......@@ -251,14 +251,15 @@ bool QRhiGles2::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture
}
QRhiRenderBuffer *QRhiGles2::createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Hints hints)
int sampleCount, QRhiRenderBuffer::Flags flags)
{
return new QGles2RenderBuffer(this, type, pixelSize, sampleCount, hints);
return new QGles2RenderBuffer(this, type, pixelSize, sampleCount, flags);
}
QRhiTexture *QRhiGles2::createTexture(QRhiTexture::Format format, const QSize &pixelSize, QRhiTexture::Flags flags)
QRhiTexture *QRhiGles2::createTexture(QRhiTexture::Format format, const QSize &pixelSize,
int sampleCount, QRhiTexture::Flags flags)
{
return new QGles2Texture(this, format, pixelSize, flags);
return new QGles2Texture(this, format, pixelSize, sampleCount, flags);
}
QRhiSampler *QRhiGles2::createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
......@@ -1350,8 +1351,8 @@ bool QGles2Buffer::build()
}
QGles2RenderBuffer::QGles2RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Hints hints)
: QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, hints)
int sampleCount, QRhiRenderBuffer::Flags flags)
: QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, flags)
{
}
......@@ -1378,7 +1379,7 @@ bool QGles2RenderBuffer::build()
if (renderbuffer)
release();
if (m_hints.testFlag(ToBeUsedWithSwapChainOnly))
if (m_flags.testFlag(ToBeUsedWithSwapChainOnly))
return true;
if (!rhiD->ensureContext())
......@@ -1399,8 +1400,9 @@ bool QGles2RenderBuffer::build()
return true;
}
QGles2Texture::QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, Flags flags)
: QRhiTexture(rhi, format, pixelSize, flags)
QGles2Texture::QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
int sampleCount, Flags flags)
: QRhiTexture(rhi, format, pixelSize, sampleCount, flags)
{
}
......
......@@ -72,7 +72,7 @@ struct QGles2Buffer : public QRhiBuffer
struct QGles2RenderBuffer : public QRhiRenderBuffer
{
QGles2RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Hints hints);
int sampleCount, QRhiRenderBuffer::Flags flags);
void release() override;
bool build() override;
......@@ -82,7 +82,8 @@ struct QGles2RenderBuffer : public QRhiRenderBuffer
struct QGles2Texture : public QRhiTexture
{
QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, Flags flags);
QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
int sampleCount, Flags flags);
void release() override;
bool build() override;
......@@ -347,9 +348,10 @@ public:
QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
const QSize &pixelSize,
int sampleCount,
QRhiRenderBuffer::Hints hints) override;
QRhiRenderBuffer::Flags flags) override;
QRhiTexture *createTexture(QRhiTexture::Format format,
const QSize &pixelSize,
int sampleCount,
QRhiTexture::Flags flags) override;
QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
QRhiSampler::Filter mipmapMode,
......
......@@ -265,14 +265,15 @@ bool QRhiMetal::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture
}
QRhiRenderBuffer *QRhiMetal::createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Hints hints)
int sampleCount, QRhiRenderBuffer::Flags flags)
{
return new QMetalRenderBuffer(this, type, pixelSize, sampleCount, hints);
return new QMetalRenderBuffer(this, type, pixelSize, sampleCount, flags);
}
QRhiTexture *QRhiMetal::createTexture(QRhiTexture::Format format, const QSize &pixelSize, QRhiTexture::Flags flags)
QRhiTexture *QRhiMetal::createTexture(QRhiTexture::Format format, const QSize &pixelSize,
int sampleCount, QRhiTexture::Flags flags)
{
return new QMetalTexture(this, format, pixelSize, flags);
return new QMetalTexture(this, format, pixelSize, sampleCount, flags);
}
QRhiSampler *QRhiMetal::createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
......@@ -882,8 +883,8 @@ bool QMetalBuffer::build()
}
QMetalRenderBuffer::QMetalRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Hints hints)
: QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, hints),
int sampleCount, QRhiRenderBuffer::Flags flags)
: QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, flags),
d(new QMetalRenderBufferData)
{
}
......@@ -938,8 +939,9 @@ bool QMetalRenderBuffer::build()
return true;
}
QMetalTexture::QMetalTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, Flags flags)
: QRhiTexture(rhi, format, pixelSize, flags),
QMetalTexture::QMetalTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
int sampleCount, Flags flags)
: QRhiTexture(rhi, format, pixelSize, sampleCount, flags),
d(new QMetalTextureData)
{
for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i)
......
......@@ -71,7 +71,7 @@ struct QMetalRenderBufferData;
struct QMetalRenderBuffer : public QRhiRenderBuffer
{
QMetalRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Hints hints);
int sampleCount, QRhiRenderBuffer::Flags flags);
~QMetalRenderBuffer();
void release() override;
bool build() override;
......@@ -86,7 +86,8 @@ struct QMetalTextureData;
struct QMetalTexture : public QRhiTexture
{
QMetalTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, Flags flags);
QMetalTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
int sampleCount, Flags flags);
~QMetalTexture();
void release() override;
bool build() override;
......@@ -249,9 +250,10 @@ public:
QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
const QSize &pixelSize,
int sampleCount,
QRhiRenderBuffer::Hints hints) override;
QRhiRenderBuffer::Flags flags) override;
QRhiTexture *createTexture(QRhiTexture::Format format,
const QSize &pixelSize,
int sampleCount,
QRhiTexture::Flags flags) override;
QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
QRhiSampler::Filter mipmapMode,
......
......@@ -2427,14 +2427,15 @@ bool QRhiVulkan::isTextureFormatSupported(QRhiTexture::Format format, QRhiTextur
}
QRhiRenderBuffer *QRhiVulkan::createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Hints hints)
int sampleCount, QRhiRenderBuffer::Flags flags)
{
return new QVkRenderBuffer(this, type, pixelSize, sampleCount, hints);
return new QVkRenderBuffer(this, type, pixelSize, sampleCount, flags);
}
QRhiTexture *QRhiVulkan::createTexture(QRhiTexture::Format format, const QSize &pixelSize, QRhiTexture::Flags flags)
QRhiTexture *QRhiVulkan::createTexture(QRhiTexture::Format format, const QSize &pixelSize,
int sampleCount, QRhiTexture::Flags flags)
{
return new QVkTexture(this, format, pixelSize, flags);
return new QVkTexture(this, format, pixelSize, sampleCount, flags);
}
QRhiSampler *QRhiVulkan::createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
......@@ -3058,8 +3059,8 @@ bool QVkBuffer::build()
}
QVkRenderBuffer::QVkRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
int sampleCount, Hints hints)
: QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, hints)
int sampleCount, Flags flags)
: QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, flags)
{
}
......@@ -3114,8 +3115,9 @@ bool QVkRenderBuffer::build()
return true;
}
QVkTexture::QVkTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, Flags flags)
: QRhiTexture(rhi, format, pixelSize, flags)
QVkTexture::QVkTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
int sampleCount, Flags flags)
: QRhiTexture(rhi, format, pixelSize, sampleCount, flags)
{
for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i) {
stagingBuffers[i] = VK_NULL_HANDLE;
......
......@@ -79,7 +79,7 @@ struct QVkBuffer : public QRhiBuffer
struct QVkRenderBuffer : public QRhiRenderBuffer
{
QVkRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
int sampleCount, Hints hints);
int sampleCount, Flags flags);
void release() override;
bool build() override;
......@@ -92,7 +92,8 @@ struct QVkRenderBuffer : public QRhiRenderBuffer
struct QVkTexture : public QRhiTexture
{
QVkTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, Flags flags);
QVkTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
int sampleCount, Flags flags);
void release() override;
bool build() override;
......@@ -312,9 +313,10 @@ public:
QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
const QSize &pixelSize,
int sampleCount,
QRhiRenderBuffer::Hints hints) override;
QRhiRenderBuffer::Flags flags) override;
QRhiTexture *createTexture(QRhiTexture::Format format,
const QSize &pixelSize,
int sampleCount,
QRhiTexture::Flags flags) override;
QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
QRhiSampler::Filter mipmapMode,
......
......@@ -3,35 +3,43 @@ mtl: texcopy
mtl: rhi without a window, offscreen frame
mtl: readback (tex, backbuffer)
mtl: compressed textures
gl, mtl: srgb (tex, swapchain buf)
multi window? (multi swapchain) -> trouble
vk: rendering hangs sometimes when minimize and back on some systems?
mtl: cubemaps
mtl: targeting cubemap faces
mtl: cbuffers, textures, samplers set should be batched too
mtl: msaa (onscreen)
mtl: srgb (tex, swapchain buf)
test cubemap
test cubemap face as target
face cubemap readback? (test vk/d3d, impl for gl)
cbuffer alignment rules - some things fail to translate (to hlsl e.g. with structs), which is fine but how to mitigate
resource import/export, what's the co-op story?
what does image copy do for compressed formats?
does reading back an msaa swapchain buffer work?
face cubemap readback? (test vk/d3d, impl for gl/mtl)
msaa offscreen (msaa texture. no readback.)
resolveimage (color and ds, only to resolve samples)
gl: tex size stuff (npot etc.)
gl: tex formats (texture, readback)
gl: srgb
mipmap generation?
advanced blend modes
resource import/export, what's the interop story
multi window? (multi swapchain) -> trouble
vk: rendering hangs sometimes when minimize and back on some systems?
mtl: cbuffers, textures, samplers set should be batched too
cbuffer alignment rules - some things fail to translate (to hlsl e.g. with structs), which is fine but how to mitigate
what does image copy do for compressed formats?
does reading back an msaa swapchain buffer work?
figure sg out for minimizing viewport/scissor cmds
vk: test FrameOpDeviceLost somehow
d3d device loss?
more what-if-resource-rebuilt cases
anisotropic
gl: more ubuf types
gl: reduce state, reduce texparam
gl: tex size stuff (npot etc.)
gl: tex formats (texture, readback)
more QImage->tex formats
d3d, gl, mtl: cache shader sources?
advanced blend modes?
resize to 0 width or height fails (vk)
gl: ubuf structs, arrays
gl: target QOpenGLWindow/Widget?
......
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