-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2115c78
commit 3adf0dc
Showing
50 changed files
with
6,183 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "wgpu-api.h" | ||
|
||
namespace rhi::wgpu { | ||
|
||
API::~API() | ||
{ | ||
if (m_module) | ||
{ | ||
unloadSharedLibrary(m_module); | ||
} | ||
} | ||
|
||
Result API::init() | ||
{ | ||
#if SLANG_WINDOWS_FAMILY | ||
SLANG_RETURN_ON_FAIL(loadSharedLibrary("dawn.dll", m_module)); | ||
#elif SLANG_LINUX_FAMILY | ||
SLANG_RETURN_ON_FAIL(loadSharedLibrary("libdawn.so", m_module)); | ||
#elif SLANG_APPLE_FAMILY | ||
SLANG_RETURN_ON_FAIL(loadSharedLibrary("libdawn.dylib", m_module)); | ||
#else | ||
return SLANG_FAIL; | ||
#endif | ||
|
||
#define LOAD_PROC(name) wgpu##name = (WGPUProc##name)findSymbolAddressByName(m_module, "wgpu" #name); | ||
SLANG_RHI_WGPU_PROCS(LOAD_PROC) | ||
#undef LOAD_PROC | ||
return SLANG_OK; | ||
} | ||
|
||
} // namespace rhi::wgpu |
Oops, something went wrong.