Commit 12111880 authored by Laszlo Agocs's avatar Laszlo Agocs
Browse files

Rename api pattern to new-build-release

While we are at it, rename QRhiRenderPass to QRhiRenderPassDescriptor
because renderpass on its own is a somwhat misleading naming.
parent 0d7b84af
...@@ -147,7 +147,7 @@ protected: ...@@ -147,7 +147,7 @@ protected:
bool m_hasSwapChain = false; bool m_hasSwapChain = false;
QRhiSwapChain *m_sc = nullptr; QRhiSwapChain *m_sc = nullptr;
QRhiRenderBuffer *m_ds = nullptr; QRhiRenderBuffer *m_ds = nullptr;
QRhiRenderPass *m_rp = nullptr; QRhiRenderPassDescriptor *m_rp = nullptr;
QRhiBuffer *m_vbuf = nullptr; QRhiBuffer *m_vbuf = nullptr;
bool m_vbufReady = false; bool m_vbufReady = false;
QRhiBuffer *m_ubuf = nullptr; QRhiBuffer *m_ubuf = nullptr;
...@@ -287,31 +287,31 @@ void Window::init() ...@@ -287,31 +287,31 @@ void Window::init()
// now onto the backend-independent init // now onto the backend-independent init
m_sc = m_r->createSwapChain(); m_sc = m_r->newSwapChain();
// allow depth-stencil, although we do not actually enable depth test/write for the triangle // allow depth-stencil, although we do not actually enable depth test/write for the triangle
m_ds = m_r->createRenderBuffer(QRhiRenderBuffer::DepthStencil, m_ds = m_r->newRenderBuffer(QRhiRenderBuffer::DepthStencil,
QSize(), // we don't know the size yet, this is fine QSize(), // we don't know the size yet, this is fine
1, 1,
QRhiRenderBuffer::ToBeUsedWithSwapChainOnly); QRhiRenderBuffer::ToBeUsedWithSwapChainOnly);
m_sc->setWindow(this); m_sc->setWindow(this);
m_sc->setDepthStencil(m_ds); m_sc->setDepthStencil(m_ds);
m_rp = m_sc->buildCompatibleRenderPass(); m_rp = m_sc->newCompatibleRenderPassDescriptor();
m_sc->setRenderPass(m_rp); m_sc->setRenderPassDescriptor(m_rp);
m_vbuf = m_r->createBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData)); m_vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData));
m_vbuf->build(); m_vbuf->build();
m_vbufReady = false; m_vbufReady = false;
m_ubuf = m_r->createBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68); m_ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
m_ubuf->build(); m_ubuf->build();
m_srb = m_r->createShaderResourceBindings(); m_srb = m_r->newShaderResourceBindings();
m_srb->setBindings({ m_srb->setBindings({
QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf) QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf)
}); });
m_srb->build(); m_srb->build();
m_ps = m_r->createGraphicsPipeline(); m_ps = m_r->newGraphicsPipeline();
QRhiGraphicsPipeline::TargetBlend premulAlphaBlend; QRhiGraphicsPipeline::TargetBlend premulAlphaBlend;
premulAlphaBlend.enable = true; premulAlphaBlend.enable = true;
...@@ -340,7 +340,7 @@ void Window::init() ...@@ -340,7 +340,7 @@ void Window::init()
m_ps->setVertexInputLayout(inputLayout); m_ps->setVertexInputLayout(inputLayout);
m_ps->setShaderResourceBindings(m_srb); m_ps->setShaderResourceBindings(m_srb);
m_ps->setRenderPass(m_rp); m_ps->setRenderPassDescriptor(m_rp);
m_ps->build(); m_ps->build();
} }
......
...@@ -98,20 +98,20 @@ bool ExampleWindow::event(QEvent *e) ...@@ -98,20 +98,20 @@ bool ExampleWindow::event(QEvent *e)
void ExampleWindow::init() void ExampleWindow::init()
{ {
m_sc = m_r->createSwapChain(); m_sc = m_r->newSwapChain();
if (!m_sc) if (!m_sc)
return; return;
// allow depth-stencil, although we do not actually enable depth test/write for the triangle // allow depth-stencil, although we do not actually enable depth test/write for the triangle
m_ds = m_r->createRenderBuffer(QRhiRenderBuffer::DepthStencil, m_ds = m_r->newRenderBuffer(QRhiRenderBuffer::DepthStencil,
QSize(), // we don't know the size yet, this is fine QSize(), // we don't know the size yet, this is fine
m_sampleCount, m_sampleCount,
QRhiRenderBuffer::ToBeUsedWithSwapChainOnly); QRhiRenderBuffer::ToBeUsedWithSwapChainOnly);
m_sc->setWindow(this); m_sc->setWindow(this);
m_sc->setDepthStencil(m_ds); m_sc->setDepthStencil(m_ds);
m_sc->setSampleCount(m_sampleCount); m_sc->setSampleCount(m_sampleCount);
m_scrp = m_sc->buildCompatibleRenderPass(); m_scrp = m_sc->newCompatibleRenderPassDescriptor();
m_sc->setRenderPass(m_scrp); m_sc->setRenderPassDescriptor(m_scrp);
m_triRenderer.setRhi(m_r); m_triRenderer.setRhi(m_r);
m_triRenderer.setSampleCount(m_sampleCount); m_triRenderer.setSampleCount(m_sampleCount);
......
...@@ -84,7 +84,7 @@ protected: ...@@ -84,7 +84,7 @@ protected:
bool m_hasSwapChain = false; bool m_hasSwapChain = false;
bool m_resizedSwapChain = false; bool m_resizedSwapChain = false;
QRhiSwapChain *m_sc = nullptr; QRhiSwapChain *m_sc = nullptr;
QRhiRenderPass *m_scrp = nullptr; QRhiRenderPassDescriptor *m_scrp = nullptr;
QRhiRenderBuffer *m_ds = nullptr; QRhiRenderBuffer *m_ds = nullptr;
TriangleRenderer m_triRenderer; TriangleRenderer m_triRenderer;
......
...@@ -70,19 +70,19 @@ static quint16 indexData[] = ...@@ -70,19 +70,19 @@ static quint16 indexData[] =
0, 1, 2, 0, 2, 3 0, 1, 2, 0, 2, 3
}; };
void QuadRenderer::initResources(QRhiRenderPass *) void QuadRenderer::initResources(QRhiRenderPassDescriptor *)
{ {
m_vbuf = m_r->createBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData)); m_vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData));
m_vbuf->build(); m_vbuf->build();
m_vbufReady = false; m_vbufReady = false;
m_ibuf = m_r->createBuffer(QRhiBuffer::Immutable, QRhiBuffer::IndexBuffer, sizeof(indexData)); m_ibuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::IndexBuffer, sizeof(indexData));
m_ibuf->build(); m_ibuf->build();
m_ubuf = m_r->createBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68); m_ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
m_ubuf->build(); m_ubuf->build();
m_srb = m_r->createShaderResourceBindings(); m_srb = m_r->newShaderResourceBindings();
m_srb->setBindings({ m_srb->setBindings({
QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf) QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf)
}); });
......
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
void setSampleCount(int samples) { m_sampleCount = samples; } void setSampleCount(int samples) { m_sampleCount = samples; }
int sampleCount() const { return m_sampleCount; } int sampleCount() const { return m_sampleCount; }
void setTranslation(const QVector3D &v) { m_translation = v; } void setTranslation(const QVector3D &v) { m_translation = v; }
void initResources(QRhiRenderPass *rp); void initResources(QRhiRenderPassDescriptor *rp);
void releaseResources(); void releaseResources();
void setPipeline(QRhiGraphicsPipeline *ps); void setPipeline(QRhiGraphicsPipeline *ps);
void resize(const QSize &pixelSize); void resize(const QSize &pixelSize);
......
...@@ -65,34 +65,34 @@ static QBakedShader getShader(const QString &name) ...@@ -65,34 +65,34 @@ static QBakedShader getShader(const QString &name)
return QBakedShader(); return QBakedShader();
} }
void TexturedCubeRenderer::initResources(QRhiRenderPass *rp) void TexturedCubeRenderer::initResources(QRhiRenderPassDescriptor *rp)
{ {
m_vbuf = m_r->createBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube)); m_vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
m_vbuf->build(); m_vbuf->build();
m_vbufReady = false; m_vbufReady = false;
m_ubuf = m_r->createBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 64 + 4); m_ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 64 + 4);
m_ubuf->build(); m_ubuf->build();
m_image = QImage(QLatin1String(":/qt256.png")).convertToFormat(QImage::Format_RGBA8888); m_image = QImage(QLatin1String(":/qt256.png")).convertToFormat(QImage::Format_RGBA8888);
QRhiTexture::Flags texFlags = 0; QRhiTexture::Flags texFlags = 0;
if (MIPMAP) if (MIPMAP)
texFlags |= QRhiTexture::MipMapped; texFlags |= QRhiTexture::MipMapped;
m_tex = m_r->createTexture(QRhiTexture::RGBA8, QSize(m_image.width(), m_image.height()), texFlags); m_tex = m_r->newTexture(QRhiTexture::RGBA8, QSize(m_image.width(), m_image.height()), texFlags);
m_tex->build(); m_tex->build();
m_sampler = m_r->createSampler(QRhiSampler::Linear, QRhiSampler::Linear, MIPMAP ? QRhiSampler::Linear : QRhiSampler::None, m_sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, MIPMAP ? QRhiSampler::Linear : QRhiSampler::None,
QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge); QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
m_sampler->build(); m_sampler->build();
m_srb = m_r->createShaderResourceBindings(); m_srb = m_r->newShaderResourceBindings();
m_srb->setBindings({ m_srb->setBindings({
QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf), QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf),
QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, m_tex, m_sampler) QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, m_tex, m_sampler)
}); });
m_srb->build(); m_srb->build();
m_ps = m_r->createGraphicsPipeline(); m_ps = m_r->newGraphicsPipeline();
m_ps->setDepthTest(true); m_ps->setDepthTest(true);
m_ps->setDepthWrite(true); m_ps->setDepthWrite(true);
...@@ -124,7 +124,7 @@ void TexturedCubeRenderer::initResources(QRhiRenderPass *rp) ...@@ -124,7 +124,7 @@ void TexturedCubeRenderer::initResources(QRhiRenderPass *rp)
m_ps->setVertexInputLayout(inputLayout); m_ps->setVertexInputLayout(inputLayout);
m_ps->setShaderResourceBindings(m_srb); m_ps->setShaderResourceBindings(m_srb);
m_ps->setRenderPass(rp); m_ps->setRenderPassDescriptor(rp);
m_ps->build(); m_ps->build();
} }
......
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
void setRhi(QRhi *r) { m_r = r; } void setRhi(QRhi *r) { m_r = r; }
void setSampleCount(int samples) { m_sampleCount = samples; } void setSampleCount(int samples) { m_sampleCount = samples; }
void setTranslation(const QVector3D &v) { m_translation = v; } void setTranslation(const QVector3D &v) { m_translation = v; }
void initResources(QRhiRenderPass *rp); void initResources(QRhiRenderPassDescriptor *rp);
void releaseResources(); void releaseResources();
void resize(const QSize &pixelSize); void resize(const QSize &pixelSize);
void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates); void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
......
...@@ -72,13 +72,13 @@ static QBakedShader getShader(const QString &name) ...@@ -72,13 +72,13 @@ static QBakedShader getShader(const QString &name)
static const QSize OFFSCREEN_SIZE(512, 512); static const QSize OFFSCREEN_SIZE(512, 512);
void TriangleOnCubeRenderer::initResources(QRhiRenderPass *rp) void TriangleOnCubeRenderer::initResources(QRhiRenderPassDescriptor *rp)
{ {
m_vbuf = m_r->createBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube)); m_vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
m_vbuf->build(); m_vbuf->build();
m_vbufReady = false; m_vbufReady = false;
m_ubuf = m_r->createBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 64 + 4); m_ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 64 + 4);
m_ubuf->build(); m_ubuf->build();
if (IMAGE_UNDER_OFFSCREEN_RENDERING) { if (IMAGE_UNDER_OFFSCREEN_RENDERING) {
...@@ -87,25 +87,25 @@ void TriangleOnCubeRenderer::initResources(QRhiRenderPass *rp) ...@@ -87,25 +87,25 @@ void TriangleOnCubeRenderer::initResources(QRhiRenderPass *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_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->createTexture(QRhiTexture::RGBA8, OFFSCREEN_SIZE, QRhiTexture::RenderTarget); m_tex = m_r->newTexture(QRhiTexture::RGBA8, OFFSCREEN_SIZE, QRhiTexture::RenderTarget);
m_tex->build(); m_tex->build();
if (MRT) { if (MRT) {
m_tex2 = m_r->createTexture(QRhiTexture::RGBA8, OFFSCREEN_SIZE, QRhiTexture::RenderTarget); m_tex2 = m_r->newTexture(QRhiTexture::RGBA8, OFFSCREEN_SIZE, QRhiTexture::RenderTarget);
m_tex2->build(); m_tex2->build();
} }
m_sampler = m_r->createSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None, QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge); m_sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None, QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
m_sampler->build(); m_sampler->build();
m_srb = m_r->createShaderResourceBindings(); m_srb = m_r->newShaderResourceBindings();
m_srb->setBindings({ m_srb->setBindings({
QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf), QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf),
QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, m_tex, m_sampler) QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, m_tex, m_sampler)
}); });
m_srb->build(); m_srb->build();
m_ps = m_r->createGraphicsPipeline(); m_ps = m_r->newGraphicsPipeline();
m_ps->setDepthTest(true); m_ps->setDepthTest(true);
m_ps->setDepthWrite(true); m_ps->setDepthWrite(true);
...@@ -137,13 +137,13 @@ void TriangleOnCubeRenderer::initResources(QRhiRenderPass *rp) ...@@ -137,13 +137,13 @@ void TriangleOnCubeRenderer::initResources(QRhiRenderPass *rp)
m_ps->setVertexInputLayout(inputLayout); m_ps->setVertexInputLayout(inputLayout);
m_ps->setShaderResourceBindings(m_srb); m_ps->setShaderResourceBindings(m_srb);
m_ps->setRenderPass(rp); m_ps->setRenderPassDescriptor(rp);
m_ps->build(); m_ps->build();
if (DEPTH_TEXTURE) { if (DEPTH_TEXTURE) {
m_offscreenTriangle.setDepthWrite(true); m_offscreenTriangle.setDepthWrite(true);
m_depthTex = m_r->createTexture(QRhiTexture::D32, OFFSCREEN_SIZE, QRhiTexture::RenderTarget); m_depthTex = m_r->newTexture(QRhiTexture::D32, OFFSCREEN_SIZE, QRhiTexture::RenderTarget);
m_depthTex->build(); m_depthTex->build();
} }
...@@ -152,18 +152,18 @@ void TriangleOnCubeRenderer::initResources(QRhiRenderPass *rp) ...@@ -152,18 +152,18 @@ void TriangleOnCubeRenderer::initResources(QRhiRenderPass *rp)
rtFlags |= QRhiTextureRenderTarget::PreserveColorContents; rtFlags |= QRhiTextureRenderTarget::PreserveColorContents;
if (DEPTH_TEXTURE) { if (DEPTH_TEXTURE) {
m_rt = m_r->createTextureRenderTarget({ nullptr, m_depthTex }, rtFlags); m_rt = m_r->newTextureRenderTarget({ nullptr, m_depthTex }, rtFlags);
} else { } else {
QRhiTextureRenderTargetDescription desc { m_tex }; QRhiTextureRenderTargetDescription desc { m_tex };
if (MRT) { if (MRT) {
m_offscreenTriangle.setColorAttCount(2); m_offscreenTriangle.setColorAttCount(2);
desc.colorAttachments.append(m_tex2); desc.colorAttachments.append(m_tex2);
} }
m_rt = m_r->createTextureRenderTarget(desc, rtFlags); m_rt = m_r->newTextureRenderTarget(desc, rtFlags);
} }
m_rp = m_rt->buildCompatibleRenderPass(); m_rp = m_rt->newCompatibleRenderPassDescriptor();
m_rt->setRenderPass(m_rp); m_rt->setRenderPassDescriptor(m_rp);
m_rt->build(); m_rt->build();
......
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
void setRhi(QRhi *r) { m_r = r; } void setRhi(QRhi *r) { m_r = r; }
void setSampleCount(int samples) { m_sampleCount = samples; } void setSampleCount(int samples) { m_sampleCount = samples; }
void setTranslation(const QVector3D &v) { m_translation = v; } void setTranslation(const QVector3D &v) { m_translation = v; }
void initResources(QRhiRenderPass *rp); void initResources(QRhiRenderPassDescriptor *rp);
void releaseResources(); void releaseResources();
void resize(const QSize &pixelSize); void resize(const QSize &pixelSize);
void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates); void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
...@@ -77,7 +77,7 @@ private: ...@@ -77,7 +77,7 @@ private:
QRhiTexture *m_depthTex = nullptr; QRhiTexture *m_depthTex = nullptr;
QRhiSampler *m_sampler = nullptr; QRhiSampler *m_sampler = nullptr;
QRhiTextureRenderTarget *m_rt = nullptr; QRhiTextureRenderTarget *m_rt = nullptr;
QRhiRenderPass *m_rp = nullptr; QRhiRenderPassDescriptor *m_rp = nullptr;
QRhiShaderResourceBindings *m_srb = nullptr; QRhiShaderResourceBindings *m_srb = nullptr;
QRhiGraphicsPipeline *m_ps = nullptr; QRhiGraphicsPipeline *m_ps = nullptr;
......
...@@ -69,26 +69,26 @@ static QBakedShader getShader(const QString &name) ...@@ -69,26 +69,26 @@ static QBakedShader getShader(const QString &name)
return QBakedShader(); return QBakedShader();
} }
void TriangleRenderer::initResources(QRhiRenderPass *rp) void TriangleRenderer::initResources(QRhiRenderPassDescriptor *rp)
{ {
#ifdef VBUF_IS_DYNAMIC #ifdef VBUF_IS_DYNAMIC
m_vbuf = m_r->createBuffer(QRhiBuffer::Dynamic, QRhiBuffer::VertexBuffer, sizeof(vertexData)); m_vbuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::VertexBuffer, sizeof(vertexData));
#else #else
m_vbuf = m_r->createBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData)); m_vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData));
#endif #endif
m_vbuf->build(); m_vbuf->build();
m_vbufReady = false; m_vbufReady = false;
m_ubuf = m_r->createBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68); m_ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
m_ubuf->build(); m_ubuf->build();
m_srb = m_r->createShaderResourceBindings(); m_srb = m_r->newShaderResourceBindings();
m_srb->setBindings({ m_srb->setBindings({
QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf) QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf)
}); });
m_srb->build(); m_srb->build();
m_ps = m_r->createGraphicsPipeline(); m_ps = m_r->newGraphicsPipeline();
QRhiGraphicsPipeline::TargetBlend premulAlphaBlend; // convenient defaults... QRhiGraphicsPipeline::TargetBlend premulAlphaBlend; // convenient defaults...
premulAlphaBlend.enable = true; premulAlphaBlend.enable = true;
...@@ -125,7 +125,7 @@ void TriangleRenderer::initResources(QRhiRenderPass *rp) ...@@ -125,7 +125,7 @@ void TriangleRenderer::initResources(QRhiRenderPass *rp)
m_ps->setVertexInputLayout(inputLayout); m_ps->setVertexInputLayout(inputLayout);
m_ps->setShaderResourceBindings(m_srb); m_ps->setShaderResourceBindings(m_srb);
m_ps->setRenderPass(rp); m_ps->setRenderPassDescriptor(rp);
m_ps->build(); m_ps->build();
} }
......
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
void setDepthWrite(bool enable) { m_depthWrite = enable; } void setDepthWrite(bool enable) { m_depthWrite = enable; }
void setColorAttCount(int count) { m_colorAttCount = count; } void setColorAttCount(int count) { m_colorAttCount = count; }
QRhiGraphicsPipeline *pipeline() const { return m_ps; } QRhiGraphicsPipeline *pipeline() const { return m_ps; }
void initResources(QRhiRenderPass *rp); void initResources(QRhiRenderPassDescriptor *rp);
void releaseResources(); void releaseResources();
void resize(const QSize &pixelSize); void resize(const QSize &pixelSize);
void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates); void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
......
...@@ -75,7 +75,7 @@ void Renderer::initResources() ...@@ -75,7 +75,7 @@ void Renderer::initResources()
m_triRenderer.setSampleCount(SAMPLES); m_triRenderer.setSampleCount(SAMPLES);
m_initPending = true; m_initPending = true;
m_sc = m_r->createSwapChain(); m_sc = m_r->newSwapChain();
} }
void Renderer::initSwapChainResources() void Renderer::initSwapChainResources()
...@@ -86,7 +86,7 @@ void Renderer::initSwapChainResources() ...@@ -86,7 +86,7 @@ void Renderer::initSwapChainResources()
if (m_initPending) { if (m_initPending) {
m_initPending = false; m_initPending = false;
// had to defer init until we can query the imported renderpass // had to defer init until we can query the imported renderpass
m_triRenderer.initResources(m_sc->renderPass()); m_triRenderer.initResources(m_sc->renderPassDescriptor());
} }
m_triRenderer.resize(m_sc->effectiveSizeInPixels()); m_triRenderer.resize(m_sc->effectiveSizeInPixels());
} }
......
...@@ -93,7 +93,7 @@ QRhiSampler::QRhiSampler(QRhiImplementation *rhi, ...@@ -93,7 +93,7 @@ QRhiSampler::QRhiSampler(QRhiImplementation *rhi,
{ {
} }
QRhiRenderPass::QRhiRenderPass(QRhiImplementation *rhi) QRhiRenderPassDescriptor::QRhiRenderPassDescriptor(QRhiImplementation *rhi)
: QRhiResource(rhi) : QRhiResource(rhi)
{ {
} }
...@@ -344,52 +344,52 @@ QMatrix4x4 QRhi::clipSpaceCorrMatrix() const ...@@ -344,52 +344,52 @@ QMatrix4x4 QRhi::clipSpaceCorrMatrix() const
return d->clipSpaceCorrMatrix(); return d->clipSpaceCorrMatrix();
} }
QRhiGraphicsPipeline *QRhi::createGraphicsPipeline() QRhiGraphicsPipeline *QRhi::newGraphicsPipeline()
{ {
return d->createGraphicsPipeline(); return d->createGraphicsPipeline();
} }
QRhiShaderResourceBindings *QRhi::createShaderResourceBindings() QRhiShaderResourceBindings *QRhi::newShaderResourceBindings()
{ {
return d->createShaderResourceBindings(); return d->createShaderResourceBindings();
} }
QRhiBuffer *QRhi::createBuffer(QRhiBuffer::Type type, QRhiBuffer *QRhi::newBuffer(QRhiBuffer::Type type,
QRhiBuffer::UsageFlags usage, QRhiBuffer::UsageFlags usage,
int size) int size)
{ {
return d->createBuffer(</