Commit 4f9b99f5 authored by Laszlo Agocs's avatar Laszlo Agocs

Rename D32 to D32F

parent 2f6d6a84
...@@ -1318,7 +1318,7 @@ QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription(const QRh ...@@ -1318,7 +1318,7 @@ QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription(const QRh
with \a depthTexture. with \a depthTexture.
\note \a depthTexture must have a suitable format, such as QRhiTexture::D16 \note \a depthTexture must have a suitable format, such as QRhiTexture::D16
or QRhiTexture::D32. or QRhiTexture::D32F.
*/ */
QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription(const QRhiColorAttachment &colorAttachment, QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription(const QRhiColorAttachment &colorAttachment,
QRhiTexture *depthTexture) QRhiTexture *depthTexture)
...@@ -1888,7 +1888,7 @@ QRhiRenderBuffer::QRhiRenderBuffer(QRhiImplementation *rhi, Type type_, const QS ...@@ -1888,7 +1888,7 @@ QRhiRenderBuffer::QRhiRenderBuffer(QRhiImplementation *rhi, Type type_, const QS
\value D16 16-bit depth (normalized unsigned integer) \value D16 16-bit depth (normalized unsigned integer)
\value D32 32-bit depth (32-bit float) \value D32F 32-bit depth (32-bit float)
\value BC1 \value BC1
\value BC2 \value BC2
...@@ -3254,7 +3254,7 @@ void QRhiImplementation::textureFormatInfo(QRhiTexture::Format format, const QSi ...@@ -3254,7 +3254,7 @@ void QRhiImplementation::textureFormatInfo(QRhiTexture::Format format, const QSi
case QRhiTexture::D16: case QRhiTexture::D16:
bpc = 2; bpc = 2;
break; break;
case QRhiTexture::D32: case QRhiTexture::D32F:
bpc = 4; bpc = 4;
break; break;
......
...@@ -647,7 +647,7 @@ public: ...@@ -647,7 +647,7 @@ public:
RGBA32F, RGBA32F,
D16, D16,
D32, D32F,
BC1, BC1,
BC2, BC2,
......
...@@ -875,7 +875,7 @@ static inline DXGI_FORMAT toD3DTextureFormat(QRhiTexture::Format format, QRhiTex ...@@ -875,7 +875,7 @@ static inline DXGI_FORMAT toD3DTextureFormat(QRhiTexture::Format format, QRhiTex
case QRhiTexture::D16: case QRhiTexture::D16:
return DXGI_FORMAT_R16_TYPELESS; return DXGI_FORMAT_R16_TYPELESS;
case QRhiTexture::D32: case QRhiTexture::D32F:
return DXGI_FORMAT_R32_TYPELESS; return DXGI_FORMAT_R32_TYPELESS;
case QRhiTexture::BC1: case QRhiTexture::BC1:
...@@ -968,7 +968,7 @@ static inline bool isDepthTextureFormat(QRhiTexture::Format format) ...@@ -968,7 +968,7 @@ static inline bool isDepthTextureFormat(QRhiTexture::Format format)
switch (format) { switch (format) {
case QRhiTexture::Format::D16: case QRhiTexture::Format::D16:
Q_FALLTHROUGH(); Q_FALLTHROUGH();
case QRhiTexture::Format::D32: case QRhiTexture::Format::D32F:
return true; return true;
default: default:
...@@ -1976,7 +1976,7 @@ static inline DXGI_FORMAT toD3DDepthTextureSRVFormat(QRhiTexture::Format format) ...@@ -1976,7 +1976,7 @@ static inline DXGI_FORMAT toD3DDepthTextureSRVFormat(QRhiTexture::Format format)
switch (format) { switch (format) {
case QRhiTexture::Format::D16: case QRhiTexture::Format::D16:
return DXGI_FORMAT_R16_FLOAT; return DXGI_FORMAT_R16_FLOAT;
case QRhiTexture::Format::D32: case QRhiTexture::Format::D32F:
return DXGI_FORMAT_R32_FLOAT; return DXGI_FORMAT_R32_FLOAT;
default: default:
Q_UNREACHABLE(); Q_UNREACHABLE();
...@@ -1989,7 +1989,7 @@ static inline DXGI_FORMAT toD3DDepthTextureDSVFormat(QRhiTexture::Format format) ...@@ -1989,7 +1989,7 @@ static inline DXGI_FORMAT toD3DDepthTextureDSVFormat(QRhiTexture::Format format)
switch (format) { switch (format) {
case QRhiTexture::Format::D16: case QRhiTexture::Format::D16:
return DXGI_FORMAT_D16_UNORM; return DXGI_FORMAT_D16_UNORM;
case QRhiTexture::Format::D32: case QRhiTexture::Format::D32F:
return DXGI_FORMAT_D32_FLOAT; return DXGI_FORMAT_D32_FLOAT;
default: default:
Q_UNREACHABLE(); Q_UNREACHABLE();
......
...@@ -473,7 +473,7 @@ bool QRhiGles2::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture ...@@ -473,7 +473,7 @@ bool QRhiGles2::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture
switch (format) { switch (format) {
case QRhiTexture::D16: case QRhiTexture::D16:
Q_FALLTHROUGH(); Q_FALLTHROUGH();
case QRhiTexture::D32: case QRhiTexture::D32F:
return caps.depthTexture; return caps.depthTexture;
case QRhiTexture::BGRA8: case QRhiTexture::BGRA8:
...@@ -2104,7 +2104,7 @@ bool QGles2Texture::prepareBuild(QSize *adjustedSize) ...@@ -2104,7 +2104,7 @@ bool QGles2Texture::prepareBuild(QSize *adjustedSize)
glformat = GL_DEPTH_COMPONENT; glformat = GL_DEPTH_COMPONENT;
gltype = GL_UNSIGNED_SHORT; gltype = GL_UNSIGNED_SHORT;
break; break;
case QRhiTexture::D32: case QRhiTexture::D32F:
glintformat = GL_DEPTH_COMPONENT32F; glintformat = GL_DEPTH_COMPONENT32F;
glformat = GL_DEPTH_COMPONENT; glformat = GL_DEPTH_COMPONENT;
gltype = GL_FLOAT; gltype = GL_FLOAT;
......
...@@ -1895,8 +1895,12 @@ static inline MTLPixelFormat toMetalTextureFormat(QRhiTexture::Format format, QR ...@@ -1895,8 +1895,12 @@ static inline MTLPixelFormat toMetalTextureFormat(QRhiTexture::Format format, QR
return MTLPixelFormatRGBA32Float; return MTLPixelFormatRGBA32Float;
case QRhiTexture::D16: case QRhiTexture::D16:
#ifdef Q_OS_MAC
return MTLPixelFormatDepth16Unorm; return MTLPixelFormatDepth16Unorm;
case QRhiTexture::D32: #else
return MTLPixelFormatDepth32Float;
#endif
case QRhiTexture::D32F:
return MTLPixelFormatDepth32Float; return MTLPixelFormatDepth32Float;
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
......
...@@ -374,7 +374,7 @@ void QRhiProfilerPrivate::newRenderBuffer(QRhiRenderBuffer *rb, bool transientBa ...@@ -374,7 +374,7 @@ void QRhiProfilerPrivate::newRenderBuffer(QRhiRenderBuffer *rb, bool transientBa
const QRhiRenderBuffer::Type type = rb->type(); const QRhiRenderBuffer::Type type = rb->type();
const QSize sz = rb->pixelSize(); const QSize sz = rb->pixelSize();
// just make up something, ds is likely D24S8 while color is RGBA8 or similar // just make up something, ds is likely D24S8 while color is RGBA8 or similar
const QRhiTexture::Format assumedFormat = type == QRhiRenderBuffer::DepthStencil ? QRhiTexture::D32 : QRhiTexture::RGBA8; const QRhiTexture::Format assumedFormat = type == QRhiRenderBuffer::DepthStencil ? QRhiTexture::D32F : QRhiTexture::RGBA8;
quint32 byteSize = rhiDWhenEnabled->approxByteSizeForTexture(assumedFormat, sz, 1, 1); quint32 byteSize = rhiDWhenEnabled->approxByteSizeForTexture(assumedFormat, sz, 1, 1);
if (sampleCount > 1) if (sampleCount > 1)
byteSize *= sampleCount; byteSize *= sampleCount;
......
...@@ -651,7 +651,7 @@ static inline VkFormat toVkTextureFormat(QRhiTexture::Format format, QRhiTexture ...@@ -651,7 +651,7 @@ static inline VkFormat toVkTextureFormat(QRhiTexture::Format format, QRhiTexture
case QRhiTexture::D16: case QRhiTexture::D16:
return VK_FORMAT_D16_UNORM; return VK_FORMAT_D16_UNORM;
case QRhiTexture::D32: case QRhiTexture::D32F:
return VK_FORMAT_D32_SFLOAT; return VK_FORMAT_D32_SFLOAT;
case QRhiTexture::BC1: case QRhiTexture::BC1:
...@@ -746,7 +746,7 @@ static inline bool isDepthTextureFormat(QRhiTexture::Format format) ...@@ -746,7 +746,7 @@ static inline bool isDepthTextureFormat(QRhiTexture::Format format)
switch (format) { switch (format) {
case QRhiTexture::Format::D16: case QRhiTexture::Format::D16:
Q_FALLTHROUGH(); Q_FALLTHROUGH();
case QRhiTexture::Format::D32: case QRhiTexture::Format::D32F:
return true; return true;
default: default:
......
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