Skip to content

Commit

Permalink
IGL: Linux compile fixes
Browse files Browse the repository at this point in the history
Summary: This diff adds two fixes for linux compilation.

Reviewed By: KyleFung

Differential Revision: D49716452

fbshipit-source-id: ad51a35789fd9d678ebb762ec3bb52b9ae291a52
  • Loading branch information
Eric Griffith authored and facebook-github-bot committed Sep 28, 2023
1 parent a2d626a commit 646e4ce
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion shell/renderSessions/MRTSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ static std::unique_ptr<IShaderStages> createShaderStagesForBackend(const IDevice
"",
nullptr);
}
IGL_UNREACHABLE_RETURN(nullptr);
IGL_UNREACHABLE_RETURN(nullptr)
}

static bool isDeviceCompatible(IDevice& device) noexcept {
Expand Down
2 changes: 1 addition & 1 deletion shell/shared/netservice/apple/StreamApple.mm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ - (void)stream:(NSStream*)stream handleEvent:(NSStreamEvent)eventCode {
case NSStreamStatusWriting:
return Stream::Status::Writing;
}
IGL_UNREACHABLE_RETURN(Stream::Status::Error);
IGL_UNREACHABLE_RETURN(Stream::Status::Error)
}

void StreamAdapterApple::close() noexcept {
Expand Down
2 changes: 1 addition & 1 deletion src/igl/ColorSpace.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ inline const char* IGL_NONNULL colorSpaceToString(ColorSpace colorSpace) {
IGL_ENUM_TO_STRING(ColorSpace, DISPLAY_NATIVE_AMD)
}

IGL_UNREACHABLE_RETURN("unknown color space");
IGL_UNREACHABLE_RETURN("unknown color space")
}

inline igl::TextureFormat colorSpaceToTextureFormat(igl::ColorSpace colorSpace,
Expand Down
2 changes: 1 addition & 1 deletion src/igl/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ std::string BackendTypeToString(BackendType backendType) {
// @fb-only
// @fb-only
}
IGL_UNREACHABLE_RETURN(std::string());
IGL_UNREACHABLE_RETURN(std::string())
}

} // namespace igl
2 changes: 1 addition & 1 deletion src/igl/Macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
/// MARK: Visual Studio compatibility

// not all control paths return a value
#if defined(_MSC_VER)
#if defined(_MSC_VER) || defined(__GNUC__)
#define IGL_UNREACHABLE_RETURN(value) \
IGL_ASSERT_NOT_REACHED(); \
return value;
Expand Down
2 changes: 1 addition & 1 deletion src/igl/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ TextureFormatProperties TextureFormatProperties::fromTextureFormat(TextureFormat
#endif
STENCIL(S_UInt8, 1, 1)
}
IGL_UNREACHABLE_RETURN(TextureFormatProperties{});
IGL_UNREACHABLE_RETURN(TextureFormatProperties{})
}

size_t TextureFormatProperties::getRows(TextureRangeDesc range) const noexcept {
Expand Down
2 changes: 1 addition & 1 deletion src/igl/VertexInputState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ size_t VertexInputStateDesc::sizeForVertexAttributeFormat(VertexAttributeFormat
case VertexAttributeFormat::Int_2_10_10_10_REV:
return sizeof(uint32_t);
}
IGL_UNREACHABLE_RETURN(0);
IGL_UNREACHABLE_RETURN(0)
}

bool VertexInputBinding::operator!=(const VertexInputBinding& other) const {
Expand Down
4 changes: 2 additions & 2 deletions src/igl/opengl/DepthStencilState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ GLenum DepthStencilState::convertCompareFunction(igl::CompareFunction value) {
case CompareFunction::AlwaysPass:
return GL_ALWAYS;
}
IGL_UNREACHABLE_RETURN(GL_ALWAYS);
IGL_UNREACHABLE_RETURN(GL_ALWAYS)
}

void DepthStencilState::setStencilReferenceValue(uint32_t value) {
Expand Down Expand Up @@ -72,7 +72,7 @@ GLenum DepthStencilState::convertStencilOperation(igl::StencilOperation value) {
case StencilOperation::DecrementWrap:
return GL_DECR_WRAP;
}
IGL_UNREACHABLE_RETURN(GL_ZERO);
IGL_UNREACHABLE_RETURN(GL_ZERO)
}

void DepthStencilState::bind() {
Expand Down
2 changes: 1 addition & 1 deletion src/igl/opengl/DeviceFeatureSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ bool DeviceFeatureSet::isExtensionSupported(Extensions extension) const {
case Extensions::VertexAttribDivisor:
return hasESExtension(*this, "GL_NV_instanced_arrays");
}
IGL_UNREACHABLE_RETURN(false);
IGL_UNREACHABLE_RETURN(false)
}

bool DeviceFeatureSet::isFeatureSupported(DeviceFeatures feature) const {
Expand Down
2 changes: 1 addition & 1 deletion src/igl/opengl/RenderCommandEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ constexpr int toGlType(IndexFormat format) {
case IndexFormat::UInt32:
return GL_UNSIGNED_INT;
}
IGL_UNREACHABLE_RETURN(GL_UNSIGNED_INT);
IGL_UNREACHABLE_RETURN(GL_UNSIGNED_INT)
}

} // namespace
Expand Down
4 changes: 2 additions & 2 deletions src/igl/opengl/RenderPipelineState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ GLenum RenderPipelineState::convertBlendOp(BlendOp value) {
case BlendOp::Max:
return GL_MAX;
}
IGL_UNREACHABLE_RETURN(GL_FUNC_ADD);
IGL_UNREACHABLE_RETURN(GL_FUNC_ADD)
}

GLenum RenderPipelineState::convertBlendFactor(BlendFactor value) {
Expand Down Expand Up @@ -92,7 +92,7 @@ GLenum RenderPipelineState::convertBlendFactor(BlendFactor value) {
logBlendFactorError(_IGL_TO_STRING_WRAPPER(GL_ONE_MINUS_SRC1_ALPHA));
return GL_ONE; // default for unsupported values
}
IGL_UNREACHABLE_RETURN(GL_ONE);
IGL_UNREACHABLE_RETURN(GL_ONE)
}

Result RenderPipelineState::create(const RenderPipelineDesc& desc) {
Expand Down
2 changes: 1 addition & 1 deletion src/igl/vulkan/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ VkFormat textureFormatToVkFormat(igl::TextureFormat format) {
case TextureFormat::S_UInt8:
return VK_FORMAT_S8_UINT;
}
IGL_UNREACHABLE_RETURN(VK_FORMAT_UNDEFINED);
IGL_UNREACHABLE_RETURN(VK_FORMAT_UNDEFINED)
}

igl::ColorSpace vkColorSpaceToColorSpace(VkColorSpaceKHR colorSpace) {
Expand Down
2 changes: 1 addition & 1 deletion src/igl/vulkan/VulkanContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ VkQueueFlagBits getQueueTypeFlag(igl::CommandQueueType type) {
case igl::CommandQueueType::MemoryTransfer:
return VK_QUEUE_TRANSFER_BIT;
}
IGL_UNREACHABLE_RETURN(VK_QUEUE_GRAPHICS_BIT);
IGL_UNREACHABLE_RETURN(VK_QUEUE_GRAPHICS_BIT)
}

bool validateImageLimits(VkImageType imageType,
Expand Down

0 comments on commit 646e4ce

Please sign in to comment.