-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebGPU: Dummy commandbuffer, change swapchain present if building for…
… web
- Loading branch information
Showing
5 changed files
with
135 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#if RGL_WEBGPU_AVAILABLE | ||
#include "WGCommandBuffer.hpp" | ||
namespace RGL{ | ||
CommandBufferWG::CommandBufferWG(decltype(owningQueue) owningQueue) : owningQueue(owningQueue) { | ||
|
||
|
||
} | ||
CommandBufferWG::~CommandBufferWG(){ | ||
|
||
} | ||
|
||
// ICommandBuffer | ||
void CommandBufferWG::Reset() { } | ||
void CommandBufferWG::Begin() { } | ||
void CommandBufferWG::End() { } | ||
void CommandBufferWG::BindRenderPipeline(RGLRenderPipelinePtr) { } | ||
void CommandBufferWG::BeginCompute(RGLComputePipelinePtr) { } | ||
void CommandBufferWG::EndCompute() { } | ||
void CommandBufferWG::DispatchCompute(uint32_t threadsX, uint32_t threadsY, uint32_t threadsZ, uint32_t threadsPerThreadgroupX, uint32_t threadsPerThreadgroupY, uint32_t threadsPerThreadgroupZ) { } | ||
|
||
void CommandBufferWG::BeginRendering(RGLRenderPassPtr) { } | ||
void CommandBufferWG::EndRendering() { } | ||
|
||
void CommandBufferWG::BindBuffer(RGLBufferPtr buffer, uint32_t binding, uint32_t offsetIntoBuffer) { } | ||
void CommandBufferWG::BindComputeBuffer(RGLBufferPtr buffer, uint32_t binding, uint32_t offsetIntoBuffer) { } | ||
void CommandBufferWG::SetVertexBuffer(RGLBufferPtr buffer, const VertexBufferBinding& bindingInfo) { } | ||
|
||
void CommandBufferWG::SetIndexBuffer(RGLBufferPtr buffer) { } | ||
|
||
void CommandBufferWG::SetVertexBytes(const untyped_span data, uint32_t offset) { } | ||
void CommandBufferWG::SetFragmentBytes(const untyped_span data, uint32_t offset) { } | ||
void CommandBufferWG::SetComputeBytes(const untyped_span data, uint32_t offset) { } | ||
|
||
void CommandBufferWG::SetVertexSampler(RGLSamplerPtr sampler, uint32_t index) { } | ||
void CommandBufferWG::SetFragmentSampler(RGLSamplerPtr sampler, uint32_t index) { } | ||
|
||
void CommandBufferWG::SetVertexTexture(const ITexture* texture, uint32_t index) { } | ||
void CommandBufferWG::SetFragmentTexture(const ITexture* texture, uint32_t index) { } | ||
|
||
void CommandBufferWG::Draw(uint32_t nVertices, const DrawInstancedConfig&) { } | ||
void CommandBufferWG::DrawIndexed(uint32_t nIndices, const DrawIndexedInstancedConfig&) { } | ||
|
||
void CommandBufferWG::SetViewport(const Viewport&) { } | ||
void CommandBufferWG::SetScissor(const Rect&) { } | ||
|
||
void CommandBufferWG::CopyTextureToBuffer(RGL::ITexture* sourceTexture, const Rect& sourceRect, size_t offset, RGLBufferPtr desetBuffer) { } | ||
void CommandBufferWG::CopyBufferToBuffer(BufferCopyConfig from, BufferCopyConfig to, uint32_t size) { } | ||
|
||
void CommandBufferWG::Commit(const CommitConfig&) { } | ||
|
||
void CommandBufferWG::ExecuteIndirectIndexed(const IndirectConfig&) { } | ||
void CommandBufferWG::ExecuteIndirect(const IndirectConfig&) { } | ||
|
||
void CommandBufferWG::BeginRenderDebugMarker(const std::string& label) { } | ||
void CommandBufferWG::BeginComputeDebugMarker(const std::string& label) { } | ||
|
||
void CommandBufferWG::EndRenderDebugMarker() { } | ||
void CommandBufferWG::EndComputeDebugMarker() { } | ||
} | ||
|
||
#endif |
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,62 @@ | ||
#pragma once | ||
#include <RGL/CommandBuffer.hpp> | ||
|
||
namespace RGL{ | ||
struct CommandQueueWG; | ||
|
||
struct CommandBufferWG : public ICommandBuffer{ | ||
|
||
const std::shared_ptr<CommandQueueWG> owningQueue; | ||
CommandBufferWG(decltype(owningQueue)); | ||
|
||
// ICommandBuffer | ||
void Reset() final; | ||
void Begin() final; | ||
void End() final; | ||
void BindRenderPipeline(RGLRenderPipelinePtr) final; | ||
void BeginCompute(RGLComputePipelinePtr) final; | ||
void EndCompute() final; | ||
void DispatchCompute(uint32_t threadsX, uint32_t threadsY, uint32_t threadsZ, uint32_t threadsPerThreadgroupX=1, uint32_t threadsPerThreadgroupY=1, uint32_t threadsPerThreadgroupZ=1) final; | ||
|
||
void BeginRendering(RGLRenderPassPtr) final; | ||
void EndRendering() final; | ||
|
||
void BindBuffer(RGLBufferPtr buffer, uint32_t binding, uint32_t offsetIntoBuffer = 0) final; | ||
void BindComputeBuffer(RGLBufferPtr buffer, uint32_t binding, uint32_t offsetIntoBuffer = 0) final; | ||
void SetVertexBuffer(RGLBufferPtr buffer, const VertexBufferBinding& bindingInfo = {}) final; | ||
|
||
void SetIndexBuffer(RGLBufferPtr buffer) final; | ||
|
||
void SetVertexBytes(const untyped_span data, uint32_t offset) final; | ||
void SetFragmentBytes(const untyped_span data, uint32_t offset) final; | ||
void SetComputeBytes(const untyped_span data, uint32_t offset) final; | ||
|
||
void SetVertexSampler(RGLSamplerPtr sampler, uint32_t index) final; | ||
void SetFragmentSampler(RGLSamplerPtr sampler, uint32_t index) final; | ||
|
||
void SetVertexTexture(const ITexture* texture, uint32_t index) final; | ||
void SetFragmentTexture(const ITexture* texture, uint32_t index) final; | ||
|
||
void Draw(uint32_t nVertices, const DrawInstancedConfig& = {}) final; | ||
void DrawIndexed(uint32_t nIndices, const DrawIndexedInstancedConfig& = {}) final; | ||
|
||
void SetViewport(const Viewport&) final; | ||
void SetScissor(const Rect&) final; | ||
|
||
void CopyTextureToBuffer(RGL::ITexture* sourceTexture, const Rect& sourceRect, size_t offset, RGLBufferPtr desetBuffer) final; | ||
void CopyBufferToBuffer(BufferCopyConfig from, BufferCopyConfig to, uint32_t size) final; | ||
|
||
void Commit(const CommitConfig&) final; | ||
|
||
void ExecuteIndirectIndexed(const IndirectConfig&) final; | ||
void ExecuteIndirect(const IndirectConfig&) final; | ||
|
||
virtual ~CommandBufferWG(); | ||
|
||
void BeginRenderDebugMarker(const std::string& label) final; | ||
void BeginComputeDebugMarker(const std::string& label) final; | ||
|
||
void EndRenderDebugMarker() final; | ||
void EndComputeDebugMarker() final; | ||
}; | ||
} |
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