forked from FrictionalGames/AmnesiaTheDarkDescent
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from OSS-Cosmic/feature/global-resource-buffer…
…-forward+ feature: forward+ renderer
- Loading branch information
Showing
92 changed files
with
5,905 additions
and
2,602 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
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 was deleted.
Oops, something went wrong.
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,69 @@ | ||
#pragma once | ||
|
||
#include "Common_3/Graphics/Interfaces/IGraphics.h" | ||
#include "graphics/ForgeHandles.h" | ||
#include "graphics/ForgeRenderer.h" | ||
#include "graphics/GraphicsAllocator.h" | ||
#include "graphics/GraphicsTypes.h" | ||
#include <cstdint> | ||
|
||
namespace hpl { | ||
class DrawPacket { | ||
public: | ||
static constexpr uint32_t MaxVertexBindings = 15; | ||
|
||
enum DrawPacketType { | ||
Unknown, | ||
DrawIndvidualBuffers, // everything will be bound indvidually for the moment until | ||
DrawGeometryset | ||
}; | ||
|
||
struct IndvidualBindings { | ||
uint32_t m_numIndices; | ||
uint32_t m_numStreams; | ||
struct { | ||
SharedBuffer* m_buffer; | ||
uint64_t m_offset; | ||
uint32_t m_stride; | ||
} m_vertexStream[MaxVertexBindings]; | ||
struct { | ||
SharedBuffer* buffer; | ||
uint64_t m_offset; | ||
} m_indexStream; | ||
}; | ||
|
||
struct GeometrySetBinding { | ||
uint32_t m_numStreams; | ||
eVertexBufferElement m_elements[MaxVertexBindings]; | ||
GraphicsAllocator::AllocationSet m_set; | ||
GeometrySet::GeometrySetSubAllocation* m_subAllocation; | ||
uint32_t m_numIndices; | ||
uint32_t m_vertexOffset; | ||
uint32_t m_indexOffset; | ||
}; | ||
inline uint32_t numberOfIndecies() { | ||
switch(m_type) { | ||
case DrawPacketType::DrawGeometryset: | ||
return m_unified.m_numIndices; | ||
case DrawPacketType::DrawIndvidualBuffers: | ||
return m_indvidual.m_numIndices; | ||
default: | ||
break; | ||
} | ||
return 0; | ||
} | ||
|
||
|
||
static void cmdBindBuffers(Cmd* cmd, ForgeRenderer::CommandResourcePool* resourcePool, DrawPacket* packet); | ||
|
||
DrawPacket() | ||
: m_type(DrawPacketType::Unknown) { | ||
} | ||
DrawPacketType m_type; | ||
union { | ||
struct IndvidualBindings m_indvidual; | ||
struct GeometrySetBinding m_unified; | ||
}; | ||
}; | ||
|
||
} // namespace hpl |
Oops, something went wrong.