mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
dawn_native: Factor getting procs into a single function.
Now the backends only expose the creation of devices. Getting the procs is moved to DawnNative that will over time more backend-agnostic APIs.
This commit is contained in:
committed by
Corentin Wallez
parent
f9f44ae289
commit
dcb71a131c
@@ -32,23 +32,16 @@
|
||||
#include "dawn_native/opengl/SwapChainGL.h"
|
||||
#include "dawn_native/opengl/TextureGL.h"
|
||||
|
||||
namespace dawn_native {
|
||||
dawnProcTable GetProcs();
|
||||
} // namespace dawn_native
|
||||
|
||||
namespace dawn_native { namespace opengl {
|
||||
|
||||
void Init(void* (*getProc)(const char*), dawnProcTable* procs, dawnDevice* device) {
|
||||
*device = nullptr;
|
||||
|
||||
dawnDevice CreateDevice(void* (*getProc)(const char*)) {
|
||||
gladLoadGLLoader(reinterpret_cast<GLADloadproc>(getProc));
|
||||
|
||||
*procs = GetProcs();
|
||||
*device = reinterpret_cast<dawnDevice>(new Device);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
|
||||
|
||||
return reinterpret_cast<dawnDevice>(new Device);
|
||||
}
|
||||
|
||||
// Device
|
||||
|
||||
Reference in New Issue
Block a user