diff options
Diffstat (limited to 'src/gui/rhi/qrhi_p.h')
-rw-r--r-- | src/gui/rhi/qrhi_p.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h index 588347d111..d17112a241 100644 --- a/src/gui/rhi/qrhi_p.h +++ b/src/gui/rhi/qrhi_p.h @@ -728,6 +728,8 @@ public: RGBA16F, RGBA32F, + R16F, + R32F, D16, D32F, @@ -760,6 +762,11 @@ public: ASTC_12x12 }; + struct NativeTexture { + const void *object; + int layout; + }; + QRhiResource::Type resourceType() const override; Format format() const { return m_format; } @@ -775,8 +782,8 @@ public: void setSampleCount(int s) { m_sampleCount = s; } virtual bool build() = 0; - virtual const QRhiNativeHandles *nativeHandles(); - virtual bool buildFrom(const QRhiNativeHandles *src); + virtual NativeTexture nativeTexture(); + virtual bool buildFrom(NativeTexture src); protected: QRhiTexture(QRhiImplementation *rhi, Format format_, const QSize &pixelSize_, @@ -801,9 +808,7 @@ public: enum AddressMode { Repeat, ClampToEdge, - Border, Mirror, - MirrorOnce }; enum CompareOp { @@ -845,7 +850,7 @@ public: protected: QRhiSampler(QRhiImplementation *rhi, Filter magFilter_, Filter minFilter_, Filter mipmapMode_, - AddressMode u_, AddressMode v_); + AddressMode u_, AddressMode v_, AddressMode w_); Filter m_magFilter; Filter m_minFilter; Filter m_mipmapMode; @@ -902,6 +907,7 @@ class Q_GUI_EXPORT QRhiRenderPassDescriptor : public QRhiResource public: QRhiResource::Type resourceType() const override; + virtual bool isCompatible(const QRhiRenderPassDescriptor *other) const = 0; virtual const QRhiNativeHandles *nativeHandles(); protected: @@ -1149,6 +1155,12 @@ public: float lineWidth() const { return m_lineWidth; } void setLineWidth(float width) { m_lineWidth = width; } + int depthBias() const { return m_depthBias; } + void setDepthBias(int bias) { m_depthBias = bias; } + + float slopeScaledDepthBias() const { return m_slopeScaledDepthBias; } + void setSlopeScaledDepthBias(float bias) { m_slopeScaledDepthBias = bias; } + void setShaderStages(std::initializer_list<QRhiShaderStage> list) { m_shaderStages = list; } template<typename InputIterator> void setShaderStages(InputIterator first, InputIterator last) @@ -1187,6 +1199,8 @@ protected: quint32 m_stencilWriteMask = 0xFF; int m_sampleCount = 1; float m_lineWidth = 1.0f; + int m_depthBias = 0; + float m_slopeScaledDepthBias = 0.0f; QVarLengthArray<QRhiShaderStage, 4> m_shaderStages; QRhiVertexInputLayout m_vertexInputLayout; QRhiShaderResourceBindings *m_shaderResourceBindings = nullptr; @@ -1468,9 +1482,12 @@ public: int sampleCount = 1, QRhiTexture::Flags flags = QRhiTexture::Flags()); - QRhiSampler *newSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, + QRhiSampler *newSampler(QRhiSampler::Filter magFilter, + QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, - QRhiSampler::AddressMode u, QRhiSampler::AddressMode v); + QRhiSampler::AddressMode addressU, + QRhiSampler::AddressMode addressV, + QRhiSampler::AddressMode addressW = QRhiSampler::Repeat); QRhiTextureRenderTarget *newTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags = QRhiTextureRenderTarget::Flags()); |