summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhimetal_p_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-05-27 17:44:49 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-05-28 17:53:32 +0200
commit56977990e04efa051b1ebd4ce9274d6b69c7bd0c (patch)
treeeaa66635b67faaf94df7b0670fa9e0971268a936 /src/gui/rhi/qrhimetal_p_p.h
parentc991d87ee2c239fedb77f76f25936dddf5eb5982 (diff)
rhi: Harmonize create-destroy API pattern with the rest of Qt
For historical reasons we use build and release instead of create and destroy. This becomes confusing now that more modules in Qt start taking QRhi into use. Migrate to the more familiar naming, so those who have used QWindow or QOpenGLContext before will find it natural. Change-Id: I05eb2243ce274c59b03a5f8bcbb2792a4f37120f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhimetal_p_p.h')
-rw-r--r--src/gui/rhi/qrhimetal_p_p.h46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/gui/rhi/qrhimetal_p_p.h b/src/gui/rhi/qrhimetal_p_p.h
index 30f5e8b74e..f3292d0fb3 100644
--- a/src/gui/rhi/qrhimetal_p_p.h
+++ b/src/gui/rhi/qrhimetal_p_p.h
@@ -63,8 +63,8 @@ struct QMetalBuffer : public QRhiBuffer
{
QMetalBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size);
~QMetalBuffer();
- void release() override;
- bool build() override;
+ void destroy() override;
+ bool create() override;
QRhiBuffer::NativeBuffer nativeBuffer() override;
QMetalBufferData *d;
@@ -82,8 +82,8 @@ struct QMetalRenderBuffer : public QRhiRenderBuffer
int sampleCount, QRhiRenderBuffer::Flags flags,
QRhiTexture::Format backingFormatHint);
~QMetalRenderBuffer();
- void release() override;
- bool build() override;
+ void destroy() override;
+ bool create() override;
QRhiTexture::Format backingFormat() const override;
QMetalRenderBufferData *d;
@@ -100,12 +100,12 @@ struct QMetalTexture : public QRhiTexture
QMetalTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
int sampleCount, Flags flags);
~QMetalTexture();
- void release() override;
- bool build() override;
- bool buildFrom(NativeTexture src) override;
+ void destroy() override;
+ bool create() override;
+ bool createFrom(NativeTexture src) override;
NativeTexture nativeTexture() override;
- bool prepareBuild(QSize *adjustedSize = nullptr);
+ bool prepareCreate(QSize *adjustedSize = nullptr);
QMetalTextureData *d;
int mipLevelCount = 0;
@@ -124,8 +124,8 @@ struct QMetalSampler : public QRhiSampler
QMetalSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
AddressMode u, AddressMode v, AddressMode w);
~QMetalSampler();
- void release() override;
- bool build() override;
+ void destroy() override;
+ bool create() override;
QMetalSamplerData *d;
uint generation = 0;
@@ -138,7 +138,7 @@ struct QMetalRenderPassDescriptor : public QRhiRenderPassDescriptor
{
QMetalRenderPassDescriptor(QRhiImplementation *rhi);
~QMetalRenderPassDescriptor();
- void release() override;
+ void destroy() override;
bool isCompatible(const QRhiRenderPassDescriptor *other) const override;
// there is no MTLRenderPassDescriptor here as one will be created for each pass in beginPass()
@@ -157,7 +157,7 @@ struct QMetalReferenceRenderTarget : public QRhiRenderTarget
{
QMetalReferenceRenderTarget(QRhiImplementation *rhi);
~QMetalReferenceRenderTarget();
- void release() override;
+ void destroy() override;
QSize pixelSize() const override;
float devicePixelRatio() const override;
@@ -170,14 +170,14 @@ struct QMetalTextureRenderTarget : public QRhiTextureRenderTarget
{
QMetalTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags);
~QMetalTextureRenderTarget();
- void release() override;
+ void destroy() override;
QSize pixelSize() const override;
float devicePixelRatio() const override;
int sampleCount() const override;
QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
- bool build() override;
+ bool create() override;
QMetalRenderTargetData *d;
friend class QRhiMetal;
@@ -187,8 +187,8 @@ struct QMetalShaderResourceBindings : public QRhiShaderResourceBindings
{
QMetalShaderResourceBindings(QRhiImplementation *rhi);
~QMetalShaderResourceBindings();
- void release() override;
- bool build() override;
+ void destroy() override;
+ bool create() override;
QVarLengthArray<QRhiShaderResourceBinding, 8> sortedBindings;
int maxBinding = -1;
@@ -234,8 +234,8 @@ struct QMetalGraphicsPipeline : public QRhiGraphicsPipeline
{
QMetalGraphicsPipeline(QRhiImplementation *rhi);
~QMetalGraphicsPipeline();
- void release() override;
- bool build() override;
+ void destroy() override;
+ bool create() override;
QMetalGraphicsPipelineData *d;
uint generation = 0;
@@ -249,8 +249,8 @@ struct QMetalComputePipeline : public QRhiComputePipeline
{
QMetalComputePipeline(QRhiImplementation *rhi);
~QMetalComputePipeline();
- void release() override;
- bool build() override;
+ void destroy() override;
+ bool create() override;
QMetalComputePipelineData *d;
uint generation = 0;
@@ -265,7 +265,7 @@ struct QMetalCommandBuffer : public QRhiCommandBuffer
{
QMetalCommandBuffer(QRhiImplementation *rhi);
~QMetalCommandBuffer();
- void release() override;
+ void destroy() override;
QMetalCommandBufferData *d = nullptr;
QRhiMetalCommandBufferNativeHandles nativeHandlesStruct;
@@ -307,7 +307,7 @@ struct QMetalSwapChain : public QRhiSwapChain
{
QMetalSwapChain(QRhiImplementation *rhi);
~QMetalSwapChain();
- void release() override;
+ void destroy() override;
QRhiCommandBuffer *currentFrameCommandBuffer() override;
QRhiRenderTarget *currentFrameRenderTarget() override;
@@ -315,7 +315,7 @@ struct QMetalSwapChain : public QRhiSwapChain
QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
- bool buildOrResize() override;
+ bool createOrResize() override;
void chooseFormats();