Skip to content

Commit

Permalink
Merge pull request #94 from OSS-Cosmic/feature/global-resource-buffer…
Browse files Browse the repository at this point in the history
…-forward+

feature: forward+ renderer
  • Loading branch information
pollend authored Nov 4, 2023
2 parents 20566c9 + 4699140 commit 5b18048
Show file tree
Hide file tree
Showing 92 changed files with 5,905 additions and 2,602 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include("${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")

add_definitions(
-DUSE_THE_FORGE_LEGACY
# -DUSE_FORWARD_PLUS_BACKEND # prototype forward renderer
)


Expand All @@ -37,10 +38,6 @@ if(WIN32)
add_compile_definitions("NOMINMAX=1")
endif()

add_definitions(
-DUSE_THE_FORGE_LEGACY
)

option(COPY_GAME_ASSETS "copy games assets into output directory" OFF)
option(WITH_TOOLS "build HPL2 with tools" ON)

Expand Down
13 changes: 0 additions & 13 deletions HPL2/include/engine/SaveGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@

class TiXmlElement;

#define kSaveData_LoadFromBegin(aClass) \
__super::LoadFromSaveData(apSaveData); \
cSaveData_##aClass *pData = static_cast<cSaveData_##aClass*>(apSaveData);

#define kSaveData_SaveToBegin(aClass) \
__super::SaveToSaveData(apSaveData);\
cSaveData_##aClass *pData = static_cast<cSaveData_##aClass*>(apSaveData);

#define kSaveData_SetupBegin(aClass) \
__super::SaveDataSetup(apSaveObjectHandler,apGame);\
cSaveData_##aClass *pData = static_cast<cSaveData_##aClass*>(mpSaveData); \
const char *sClassNameString = #aClass;

#define kSaveData_BaseClass(aClass) class cSaveData_##aClass : public iSaveData
#define kSaveData_ChildClass(aParent, aChild) class cSaveData_##aChild : public cSaveData_##aParent

Expand Down
271 changes: 0 additions & 271 deletions HPL2/include/graphics/AssetBuffer.h

This file was deleted.

69 changes: 69 additions & 0 deletions HPL2/include/graphics/DrawPacket.h
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
Loading

0 comments on commit 5b18048

Please sign in to comment.