Fill out basic WebGPU header/source gfx files
This commit is contained in:
parent
fe45e382bc
commit
57c2bbc83a
8 changed files with 22 additions and 79 deletions
|
@ -1,4 +1,4 @@
|
||||||
#include "gfx_dummy.hpp"
|
#include "gfx_webgpu.hpp"
|
||||||
|
|
||||||
bool GFXDummy::is_supported() {
|
bool GFXDummy::is_supported() {
|
||||||
return true;
|
return true;
|
|
@ -1,3 +1,3 @@
|
||||||
add_library(GFXWebGPU STATIC src/gfx_dummy.cpp)
|
add_library(GFXWebGPU STATIC src/gfx_webgpu.cpp)
|
||||||
target_include_directories(GFXWebGPU PUBLIC include)
|
target_include_directories(GFXWebGPU PUBLIC include)
|
||||||
target_link_libraries(GFXWebGPU PUBLIC GFX)
|
target_link_libraries(GFXWebGPU PUBLIC GFX)
|
|
@ -1,30 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "gfx.hpp"
|
|
||||||
|
|
||||||
class GFXDummy : public GFX {
|
|
||||||
public:
|
|
||||||
bool initialize() override;
|
|
||||||
void initializeView(void* native_handle, uint32_t width, uint32_t height) override;
|
|
||||||
|
|
||||||
// buffer operations
|
|
||||||
GFXBuffer* createBuffer(void* data, GFXSize size, GFXBufferUsage usage) override;
|
|
||||||
void copyBuffer(GFXBuffer* buffer, void* data, GFXSize offset, GFXSize size) override;
|
|
||||||
|
|
||||||
// texture operations
|
|
||||||
GFXTexture* createTexture(uint32_t width, uint32_t height, GFXPixelFormat format, GFXStorageMode storageMode, GFXTextureUsage usage) override;
|
|
||||||
void copyTexture(GFXTexture* texture, void* data, GFXSize size) override;
|
|
||||||
|
|
||||||
// framebuffer operations
|
|
||||||
GFXFramebuffer* createFramebuffer(GFXFramebufferCreateInfo& info) override;
|
|
||||||
|
|
||||||
// render pass operations
|
|
||||||
GFXRenderPass* createRenderPass(GFXRenderPassCreateInfo& info) override;
|
|
||||||
|
|
||||||
// pipeline operations
|
|
||||||
GFXPipeline* createPipeline(GFXPipelineCreateInfo& info) override;
|
|
||||||
|
|
||||||
void render(GFXCommandBuffer* command_buffer) override;
|
|
||||||
|
|
||||||
const char* getName() override;
|
|
||||||
};
|
|
10
engine/gfx/webgpu/include/gfx_webgpu.hpp
Executable file
10
engine/gfx/webgpu/include/gfx_webgpu.hpp
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "gfx.hpp"
|
||||||
|
|
||||||
|
class GFXWebGPU : public GFX {
|
||||||
|
public:
|
||||||
|
bool initialize(const GFXCreateInfo& createInfo) override;
|
||||||
|
|
||||||
|
const char* get_name() override;
|
||||||
|
};
|
|
@ -1,46 +0,0 @@
|
||||||
#include "gfx_dummy.hpp"
|
|
||||||
|
|
||||||
bool GFXDummy::initialize() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GFXDummy::initializeView(void* native_handle, uint32_t width, uint32_t height) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
GFXBuffer* GFXDummy::createBuffer(void* data, GFXSize size, GFXBufferUsage usage) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GFXDummy::copyBuffer(GFXBuffer* buffer, void* data, GFXSize offset, GFXSize size) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
GFXTexture* GFXDummy::createTexture(uint32_t width, uint32_t height, GFXPixelFormat format, GFXStorageMode storageMode, GFXTextureUsage usage) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GFXDummy::copyTexture(GFXTexture* texture, void* data, GFXSize size) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GFXFramebuffer* GFXDummy::createFramebuffer(GFXFramebufferCreateInfo& info) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
GFXRenderPass* GFXDummy::createRenderPass(GFXRenderPassCreateInfo& info) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
GFXPipeline* GFXDummy::createPipeline(GFXPipelineCreateInfo& info) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GFXDummy::render(GFXCommandBuffer* command_buffer) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* GFXDummy::getName() {
|
|
||||||
return "None";
|
|
||||||
}
|
|
9
engine/gfx/webgpu/src/gfx_webgpu.cpp
Executable file
9
engine/gfx/webgpu/src/gfx_webgpu.cpp
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#include "gfx_webgpu.hpp"
|
||||||
|
|
||||||
|
bool GFXWebGPU::initialize(const GFXCreateInfo& createInfo) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* GFXWebGPU::get_name() {
|
||||||
|
return "WebGPU";
|
||||||
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
add_library(Platform INTERFACE)
|
add_library(Platform INTERFACE)
|
||||||
target_include_directories(Platform INTERFACE include)
|
target_include_directories(Platform INTERFACE include)
|
||||||
target_link_libraries(Platform INTERFACE Utility)
|
target_link_libraries(Platform INTERFACE Utility Log)
|
||||||
|
|
Reference in a new issue