Mesh and Material Serializations

This commit is contained in:
Dynamitos
2023-11-01 13:38:49 +01:00
parent 4e7f4a56b8
commit 5a9cb13e74
20 changed files with 233 additions and 111 deletions
+4 -46
View File
@@ -2,6 +2,7 @@
#include "Enums.h"
#include "Containers/Map.h"
#include "Math/Math.h"
#include "Shader.h"
namespace Seele
{
@@ -189,15 +190,9 @@ struct ColorBlendState
} blendAttachments[16];
float blendConstants[4];
};
DECLARE_REF(VertexDeclaration)
DECLARE_REF(VertexShader)
DECLARE_REF(FragmentShader)
DECLARE_REF(TaskShader)
DECLARE_REF(MeshShader)
DECLARE_REF(ComputeShader)
DECLARE_REF(PipelineLayout)
DECLARE_REF(RenderPass)
DECLARE_REF(PipelineLayout)
struct LegacyPipelineCreateInfo
{
PVertexDeclaration vertexDeclaration;
@@ -210,45 +205,8 @@ struct LegacyPipelineCreateInfo
RasterizationState rasterizationState;
DepthStencilState depthStencilState;
ColorBlendState colorBlend;
LegacyPipelineCreateInfo()
: topology(Gfx::SE_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST)
, multisampleState(MultisampleState{
.samples = 1,
})
, rasterizationState(RasterizationState{
.polygonMode = Gfx::SE_POLYGON_MODE_FILL,
.cullMode = Gfx::SE_CULL_MODE_BACK_BIT,
.frontFace = Gfx::SE_FRONT_FACE_COUNTER_CLOCKWISE,
})
, depthStencilState(DepthStencilState{
.depthTestEnable = true,
.depthWriteEnable = true,
.stencilTestEnable = false,
.depthCompareOp = Gfx::SE_COMPARE_OP_LESS_OR_EQUAL,
.minDepthBounds = 0.0f,
.maxDepthBounds = 1.0f,
})
, colorBlend(ColorBlendState{
.logicOpEnable = false,
.attachmentCount = 0,
.blendAttachments = {
ColorBlendState::BlendAttachment{
.colorWriteMask =
Gfx::SE_COLOR_COMPONENT_R_BIT |
Gfx::SE_COLOR_COMPONENT_G_BIT |
Gfx::SE_COLOR_COMPONENT_B_BIT |
Gfx::SE_COLOR_COMPONENT_A_BIT,
}
},
.blendConstants = {
1.0f,
1.0f,
1.0f,
1.0f,
},
})
{
}
LegacyPipelineCreateInfo();
~LegacyPipelineCreateInfo();
};
struct MeshPipelineCreateInfo