summaryrefslogtreecommitdiffstats
path: root/source/core/slang-render-api-util.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-11-06 01:47:26 +0800
committerGitHub <noreply@github.com>2024-11-05 09:47:26 -0800
commitb118451e301d734e3e783b3acdf871f3f6ea851c (patch)
tree277f160d31e2c442f724bc6a2d3c09fabff403ca /source/core/slang-render-api-util.cpp
parent53dd5928c35d5a5cb1f7d2a563348fd1fa87d672 (diff)
Move switch statement bodies to their own lines (#5493)
* Move switch statement bodies to their own lines * format --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/core/slang-render-api-util.cpp')
-rw-r--r--source/core/slang-render-api-util.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/source/core/slang-render-api-util.cpp b/source/core/slang-render-api-util.cpp
index 476188abd..1e77c2ac6 100644
--- a/source/core/slang-render-api-util.cpp
+++ b/source/core/slang-render-api-util.cpp
@@ -183,7 +183,8 @@ static Token nextToken(Slang::UnownedStringSlice& textInOut, Slang::UnownedStrin
SLANG_RETURN_ON_FAIL(findApiFlagsByName(lexeme, &apiFlags));
break;
}
- default: return SLANG_FAIL;
+ default:
+ return SLANG_FAIL;
}
while (true)
@@ -196,8 +197,10 @@ static Token nextToken(Slang::UnownedStringSlice& textInOut, Slang::UnownedStrin
*apiFlagsOut = apiFlags;
return SLANG_OK;
}
- case Token::eOp: break;
- default: return SLANG_FAIL;
+ case Token::eOp:
+ break;
+ default:
+ return SLANG_FAIL;
}
const char op = lexeme[0];
@@ -276,10 +279,13 @@ static bool _canLoadSharedLibrary(const char* libName)
return _canLoadSharedLibrary("webgpu_dawn") && _canLoadSharedLibrary("dxcompiler") &&
_canLoadSharedLibrary("dxil");
#elif SLANG_APPLE_FAMILY
- case RenderApiType::Vulkan: return true;
- case RenderApiType::Metal: return true;
+ case RenderApiType::Vulkan:
+ return true;
+ case RenderApiType::Metal:
+ return true;
#elif SLANG_UNIX_FAMILY
- case RenderApiType::Vulkan: return true;
+ case RenderApiType::Vulkan:
+ return true;
#endif
#if SLANG_ENABLE_DIRECTX
@@ -289,10 +295,13 @@ static bool _canLoadSharedLibrary(const char* libName)
return _canLoadSharedLibrary(SLANG_ENABLE_VKD3D ? "vkd3d-proton-d3d12" : "d3d12");
#endif
- case RenderApiType::CPU: return true;
+ case RenderApiType::CPU:
+ return true;
// We'll assume CUDA is available, and if not, trying to create it will detect it
- case RenderApiType::CUDA: return true;
- default: break;
+ case RenderApiType::CUDA:
+ return true;
+ default:
+ break;
}
return false;
}