Add FrameGraph (WIP)
This commit is contained in:
@@ -55,7 +55,7 @@ namespace Nz
|
||||
inline std::size_t GetPoolIndex() const;
|
||||
inline const OpenGLCommandPool& GetOwner() const;
|
||||
|
||||
inline void SetFramebuffer(const OpenGLFramebuffer& framebuffer, const RenderPass& renderPass, std::initializer_list<CommandBufferBuilder::ClearValues> clearValues);
|
||||
inline void SetFramebuffer(const OpenGLFramebuffer& framebuffer, const RenderPass& renderPass, const CommandBufferBuilder::ClearValues* clearValues, std::size_t clearValueCount);
|
||||
inline void SetScissor(Nz::Recti scissorRegion);
|
||||
inline void SetViewport(Nz::Recti viewportRegion);
|
||||
|
||||
|
||||
@@ -133,13 +133,13 @@ namespace Nz
|
||||
return *m_owner;
|
||||
}
|
||||
|
||||
inline void OpenGLCommandBuffer::SetFramebuffer(const OpenGLFramebuffer& framebuffer, const RenderPass& /*renderPass*/, std::initializer_list<CommandBufferBuilder::ClearValues> clearValues)
|
||||
inline void OpenGLCommandBuffer::SetFramebuffer(const OpenGLFramebuffer& framebuffer, const RenderPass& /*renderPass*/, const CommandBufferBuilder::ClearValues* clearValues, std::size_t clearValueCount)
|
||||
{
|
||||
SetFrameBufferData setFramebuffer;
|
||||
setFramebuffer.framebuffer = &framebuffer;
|
||||
|
||||
assert(clearValues.size() < setFramebuffer.clearValues.size());
|
||||
std::copy(clearValues.begin(), clearValues.end(), setFramebuffer.clearValues.begin());
|
||||
assert(clearValueCount < setFramebuffer.clearValues.size());
|
||||
std::copy(clearValues, clearValues + clearValueCount, setFramebuffer.clearValues.begin());
|
||||
|
||||
m_commands.emplace_back(std::move(setFramebuffer));
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Nz
|
||||
~OpenGLCommandBufferBuilder() = default;
|
||||
|
||||
void BeginDebugRegion(const std::string_view& regionName, const Nz::Color& color) override;
|
||||
void BeginRenderPass(const Framebuffer& framebuffer, const RenderPass& renderPass, Nz::Recti renderRect, std::initializer_list<ClearValues> clearValues) override;
|
||||
void BeginRenderPass(const Framebuffer& framebuffer, const RenderPass& renderPass, Nz::Recti renderRect, const ClearValues* clearValues, std::size_t clearValueCount) override;
|
||||
|
||||
void BindIndexBuffer(AbstractBuffer* indexBuffer, UInt64 offset = 0) override;
|
||||
void BindPipeline(const RenderPipeline& pipeline) override;
|
||||
@@ -40,12 +40,16 @@ namespace Nz
|
||||
void EndDebugRegion() override;
|
||||
void EndRenderPass() override;
|
||||
|
||||
void NextSubpass() override;
|
||||
|
||||
void PreTransferBarrier() override;
|
||||
void PostTransferBarrier() override;
|
||||
|
||||
void SetScissor(Nz::Recti scissorRegion) override;
|
||||
void SetViewport(Nz::Recti viewportRegion) override;
|
||||
|
||||
void TextureBarrier(PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, MemoryAccessFlags srcAccessMask, MemoryAccessFlags dstAccessMask, TextureLayout oldLayout, TextureLayout newLayout, const Texture& texture) override;
|
||||
|
||||
OpenGLCommandBufferBuilder& operator=(const OpenGLCommandBufferBuilder&) = delete;
|
||||
OpenGLCommandBufferBuilder& operator=(OpenGLCommandBufferBuilder&&) = delete;
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@ namespace Nz
|
||||
// TODO: Fill this switch
|
||||
switch (pixelFormat)
|
||||
{
|
||||
case PixelFormat_A8: return GLTextureFormat{ GL_R8, GL_RED, GL_UNSIGNED_BYTE, GL_ZERO, GL_ZERO, GL_ZERO, GL_RED };
|
||||
case PixelFormat_A8: return GLTextureFormat{ GL_R8, GL_RED, GL_UNSIGNED_BYTE, GL_ZERO, GL_ZERO, GL_ZERO, GL_RED };
|
||||
case PixelFormat_BGR8: return GLTextureFormat{ GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, GL_BLUE, GL_GREEN, GL_RED, GL_ONE };
|
||||
case PixelFormat_BGR8_SRGB: return GLTextureFormat{ GL_SRGB8, GL_RGB, GL_UNSIGNED_BYTE, GL_BLUE, GL_GREEN, GL_RED, GL_ONE };
|
||||
case PixelFormat_BGRA8: return GLTextureFormat{ GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA };
|
||||
case PixelFormat_BGRA8_SRGB: return GLTextureFormat{ GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA };
|
||||
case PixelFormat_Depth24Stencil8: return GLTextureFormat{ GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_RED, GL_GREEN, GL_ZERO, GL_ZERO };
|
||||
case PixelFormat_Depth24Stencil8: return GLTextureFormat{ GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_RED, GL_GREEN, GL_ZERO, GL_ZERO };
|
||||
case PixelFormat_RGB8: return GLTextureFormat{ GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, GL_RED, GL_GREEN, GL_BLUE, GL_ONE };
|
||||
case PixelFormat_RGB8_SRGB: return GLTextureFormat{ GL_SRGB8, GL_RGB, GL_UNSIGNED_BYTE, GL_RED, GL_GREEN, GL_BLUE, GL_ONE };
|
||||
case PixelFormat_RGBA8: return GLTextureFormat{ GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA };
|
||||
|
||||
Reference in New Issue
Block a user