feat: support rect clears for camera viewport rendering
This commit is contained in:
@@ -102,10 +102,19 @@ public:
|
||||
void DrawIndexedInstancedIndirectInternal(ID3D12Resource* argBuffer, uint64_t alignedByteOffset);
|
||||
|
||||
void Clear(float r, float g, float b, float a, uint32_t buffers) override;
|
||||
void ClearRenderTarget(RHIResourceView* renderTarget, const float color[4]) override;
|
||||
void ClearRenderTarget(
|
||||
RHIResourceView* renderTarget,
|
||||
const float color[4],
|
||||
uint32_t rectCount = 0,
|
||||
const Rect* rects = nullptr) override;
|
||||
void ClearRenderTargetView(ID3D12Resource* renderTarget, const float color[4], uint32_t rectCount = 0, const D3D12_RECT* rects = nullptr);
|
||||
void ClearRenderTargetView(D3D12_CPU_DESCRIPTOR_HANDLE renderTargetHandle, const float color[4], uint32_t rectCount = 0, const D3D12_RECT* rects = nullptr);
|
||||
void ClearDepthStencil(RHIResourceView* depthStencil, float depth, uint8_t stencil) override;
|
||||
void ClearDepthStencil(
|
||||
RHIResourceView* depthStencil,
|
||||
float depth,
|
||||
uint8_t stencil,
|
||||
uint32_t rectCount = 0,
|
||||
const Rect* rects = nullptr) override;
|
||||
void ClearDepthStencilView(ID3D12Resource* depthStencil, uint32_t clearFlags, float depth = 1.0f, uint8_t stencil = 0, uint32_t rectCount = 0, const D3D12_RECT* rects = nullptr);
|
||||
void ClearDepthStencilView(D3D12_CPU_DESCRIPTOR_HANDLE depthStencilHandle, uint32_t clearFlags, float depth = 1.0f, uint8_t stencil = 0, uint32_t rectCount = 0, const D3D12_RECT* rects = nullptr);
|
||||
void ClearUnorderedAccessView(D3D12_GPU_DESCRIPTOR_HANDLE viewHandle, D3D12_CPU_DESCRIPTOR_HANDLE resourceHandle, ID3D12Resource* unorderedAccess, const float values[4], uint32_t rectCount = 0, const D3D12_RECT* rects = nullptr);
|
||||
@@ -154,4 +163,4 @@ private:
|
||||
};
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
} // namespace XCEngine
|
||||
|
||||
@@ -192,8 +192,17 @@ public:
|
||||
void SetRenderTargets(uint32_t count, RHIResourceView** renderTargets, RHIResourceView* depthStencil = nullptr) override;
|
||||
void SetStencilRef(uint8_t ref) override;
|
||||
void SetBlendFactor(const float factor[4]) override;
|
||||
void ClearRenderTarget(RHIResourceView* renderTarget, const float color[4]) override;
|
||||
void ClearDepthStencil(RHIResourceView* depthStencil, float depth, uint8_t stencil) override;
|
||||
void ClearRenderTarget(
|
||||
RHIResourceView* renderTarget,
|
||||
const float color[4],
|
||||
uint32_t rectCount = 0,
|
||||
const Rect* rects = nullptr) override;
|
||||
void ClearDepthStencil(
|
||||
RHIResourceView* depthStencil,
|
||||
float depth,
|
||||
uint8_t stencil,
|
||||
uint32_t rectCount = 0,
|
||||
const Rect* rects = nullptr) override;
|
||||
void Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t startVertex, uint32_t startInstance) override;
|
||||
void DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t startIndex, int32_t baseVertex, uint32_t startInstance) override;
|
||||
|
||||
@@ -212,6 +221,8 @@ private:
|
||||
std::vector<unsigned int> m_enabledVertexAttributes;
|
||||
OpenGLShader* m_currentShader;
|
||||
OpenGLFramebuffer* m_composedFramebuffer;
|
||||
uint32_t m_currentRenderTargetWidth;
|
||||
uint32_t m_currentRenderTargetHeight;
|
||||
};
|
||||
|
||||
} // namespace RHI
|
||||
|
||||
@@ -92,8 +92,17 @@ public:
|
||||
virtual void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t startIndex = 0, int32_t baseVertex = 0, uint32_t startInstance = 0) = 0;
|
||||
|
||||
virtual void Clear(float r, float g, float b, float a, uint32_t buffers) = 0;
|
||||
virtual void ClearRenderTarget(RHIResourceView* renderTarget, const float color[4]) = 0;
|
||||
virtual void ClearDepthStencil(RHIResourceView* depthStencil, float depth, uint8_t stencil) = 0;
|
||||
virtual void ClearRenderTarget(
|
||||
RHIResourceView* renderTarget,
|
||||
const float color[4],
|
||||
uint32_t rectCount = 0,
|
||||
const Rect* rects = nullptr) = 0;
|
||||
virtual void ClearDepthStencil(
|
||||
RHIResourceView* depthStencil,
|
||||
float depth,
|
||||
uint8_t stencil,
|
||||
uint32_t rectCount = 0,
|
||||
const Rect* rects = nullptr) = 0;
|
||||
|
||||
virtual void CopyResource(RHIResourceView* dst, RHIResourceView* src) = 0;
|
||||
|
||||
|
||||
@@ -52,8 +52,17 @@ public:
|
||||
void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t startIndex = 0, int32_t baseVertex = 0, uint32_t startInstance = 0) override;
|
||||
|
||||
void Clear(float r, float g, float b, float a, uint32_t buffers) override;
|
||||
void ClearRenderTarget(RHIResourceView* renderTarget, const float color[4]) override;
|
||||
void ClearDepthStencil(RHIResourceView* depthStencil, float depth, uint8_t stencil) override;
|
||||
void ClearRenderTarget(
|
||||
RHIResourceView* renderTarget,
|
||||
const float color[4],
|
||||
uint32_t rectCount = 0,
|
||||
const Rect* rects = nullptr) override;
|
||||
void ClearDepthStencil(
|
||||
RHIResourceView* depthStencil,
|
||||
float depth,
|
||||
uint8_t stencil,
|
||||
uint32_t rectCount = 0,
|
||||
const Rect* rects = nullptr) override;
|
||||
|
||||
void CopyResource(RHIResourceView* dst, RHIResourceView* src) override;
|
||||
void Dispatch(uint32_t x, uint32_t y, uint32_t z) override;
|
||||
|
||||
Reference in New Issue
Block a user