From 5772c54b9935f5e294c522ef5741ce888f33457c Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 22 Feb 2022 00:53:17 -0500 Subject: [PATCH] BoolConvertible: Hacks to fix MSVC build --- src/dawn/native/BindGroup.cpp | 2 +- src/dawn/native/Format.cpp | 10 +++++----- src/dawn/native/ShaderModule.cpp | 2 +- src/dawn/native/Texture.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dawn/native/BindGroup.cpp b/src/dawn/native/BindGroup.cpp index a96843c848..f60cf35076 100644 --- a/src/dawn/native/BindGroup.cpp +++ b/src/dawn/native/BindGroup.cpp @@ -153,7 +153,7 @@ namespace dawn::native { texture->GetSampleCount(), texture, bindingInfo.texture.multisampled); // TODO(dawn:563): Improve error message. - DAWN_INVALID_IF((supportedTypes & requiredType) == 0, + DAWN_INVALID_IF((supportedTypes & requiredType).value == 0, "Texture component type usage mismatch."); DAWN_INVALID_IF( diff --git a/src/dawn/native/Format.cpp b/src/dawn/native/Format.cpp index e4eb963f19..dde3131ab8 100644 --- a/src/dawn/native/Format.cpp +++ b/src/dawn/native/Format.cpp @@ -84,19 +84,19 @@ namespace dawn::native { } bool Format::HasDepth() const { - return (aspects & Aspect::Depth) != 0; + return (aspects & Aspect::Depth).value != 0; } bool Format::HasStencil() const { - return (aspects & Aspect::Stencil) != 0; + return (aspects & Aspect::Stencil).value != 0; } bool Format::HasDepthOrStencil() const { - return (aspects & (Aspect::Depth | Aspect::Stencil)) != 0; + return (aspects & (Aspect::Depth | Aspect::Stencil)).value != 0; } bool Format::IsMultiPlanar() const { - return (aspects & (Aspect::Plane0 | Aspect::Plane1)) != 0; + return (aspects & (Aspect::Plane0 | Aspect::Plane1)).value != 0; } bool Format::CopyCompatibleWith(const Format& format) const { @@ -196,7 +196,7 @@ namespace dawn::native { UNREACHABLE(); } } else { - ASSERT((sampleTypes & SampleTypeBit::Float) != 0); + ASSERT((sampleTypes & SampleTypeBit::Float).value != 0); firstAspect->baseType = wgpu::TextureComponentType::Float; } firstAspect->supportedSampleTypes = sampleTypes; diff --git a/src/dawn/native/ShaderModule.cpp b/src/dawn/native/ShaderModule.cpp index 3b46d156ba..830dedb73d 100644 --- a/src/dawn/native/ShaderModule.cpp +++ b/src/dawn/native/ShaderModule.cpp @@ -500,7 +500,7 @@ namespace dawn::native { // TODO(dawn:563): Provide info about the sample types. DAWN_INVALID_IF((SampleTypeToSampleTypeBit(layoutInfo.texture.sampleType) & - shaderInfo.texture.compatibleSampleTypes) == 0, + shaderInfo.texture.compatibleSampleTypes).value == 0, "The sample type in the shader is not compatible with the " "sample type of the layout."); diff --git a/src/dawn/native/Texture.cpp b/src/dawn/native/Texture.cpp index ef0ee26beb..f8a4ec0b3b 100644 --- a/src/dawn/native/Texture.cpp +++ b/src/dawn/native/Texture.cpp @@ -317,7 +317,7 @@ namespace dawn::native { // doesn't support depth/stencil formats on 3D textures. DAWN_INVALID_IF( descriptor->dimension != wgpu::TextureDimension::e2D && - (format->aspects & (Aspect::Depth | Aspect::Stencil)) != 0, + (format->aspects & (Aspect::Depth | Aspect::Stencil)).value != 0, "The dimension (%s) of a texture with a depth/stencil format (%s) is not 2D.", descriptor->dimension, format->format);