Skip to content

Commit 7ce53ee

Browse files
committed
better&better
1 parent f18211d commit 7ce53ee

18 files changed

Lines changed: 80 additions & 59 deletions

File tree

sources/Core/FileSystem/ResourceManager.h renamed to sources/Core/FileSystem/ResourceManager.ixx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
#pragma once
1+
module;
22

3+
//#include "Serialization/Serializer.h"
4+
#include "serialization/serialization_archives.h"
35

4-
#include "Serialization/Serializer.h"
6+
export module ResourceManager;
7+
import Serializer;
8+
import serialization;
59
import Utils;
610
import Log;
711
import Singleton;
@@ -11,6 +15,9 @@ import stl.memory;
1115
import FileSystem;
1216
import FileDepender;
1317

18+
export
19+
{
20+
1421
class resource_system
1522
{
1623

@@ -336,3 +343,5 @@ std::vector<typename loader<_resource, _header, _context>::loader_func> loader<_
336343
template<class _resource, class _header, class _context>
337344
bool loader<_resource, _header, _context>::inited = _resource::init_default_loaders();
338345

346+
347+
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
#pragma once
1+
module;
22

33
#include "serialization_archives.h"
44
#include "serialization_defines.h"
5+
export module Serializer;
6+
57
import Log;
68
import Utils;
79
import crc32;
810
import boost.serialization;
911
import Data;
1012
import windows;
1113
//import boost.archives;
14+
export
15+
{
1216

1317
class Serializer
1418
{
@@ -334,3 +338,5 @@ class Hasher
334338
}
335339

336340
};
341+
342+
}

sources/DirectXFramework/DX12/Buffer.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#pragma once
2-
#include "Serialization/serialization_defines.h"
3-
42
import Allocators;
53

64
import Device;
@@ -9,7 +7,6 @@ import Resource;
97
import Concepts;
108
import Log;
119
import Descriptors;
12-
#include "DX12/HLSLDescriptors.hpp"
1310

1411
import serialization;
1512
import stl.core;
@@ -535,7 +532,7 @@ namespace DX12
535532

536533
public:
537534

538-
typename StructuredBuffer<Type>::ptr buffer;
535+
StructuredBuffer<Type>::ptr buffer;
539536
using ptr = std::shared_ptr<virtual_gpu_buffer<Type, AllocatorType>>;
540537

541538

sources/DirectXFramework/DX12/Descriptors.ixx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module;
2-
2+
#include "helper.h"
33
export module Descriptors;
44

55

66
import Allocators;
77
import Vectors;
8-
8+
import Resource;
99

1010
import stl.threading;
1111
import stl.core;
@@ -852,6 +852,6 @@ export
852852

853853
}
854854

855-
855+
#include "HLSLDescriptors.hpp"
856856

857857
}

sources/DirectXFramework/DX12/HLSLDescriptors.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#pragma once
2-
#include "Buffer.h"
3-
#include "helper.h"
41
namespace DX12
52
{
63
namespace HLSL

sources/DirectXFramework/DX12/PipelineState.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#include "pch_dx.h"
22
#include "PipelineState.h"
3-
#include "Serialization/Serializer.h"
3+
//#include "Serialization/Serializer.h"
4+
//#include "serialization_archives.h"
5+
#include "serialization/serialization_archives.h"
46

7+
import Serializer;
58
import Debug;
69

710
template<D3D12_PIPELINE_STATE_SUBOBJECT_TYPE T>

sources/DirectXFramework/DX12/Shader.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#pragma once
2-
#include "FileSystem/ResourceManager.h"
2+
import ResourceManager;
33
import D3D.Shaders;
44
import Enums;
55
import stl.core;
66

77
std::optional<SlotID> get_slot(std::string_view slot_name);
88
import FileDepender;
99
import Data;
10+
import Utils;
11+
import crc32;
12+
import serialization;
13+
import Events;
14+
1015
template<class T>
1116
class shader_with_id
1217
{

sources/DirectXFramework/DX12/Texture.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#pragma once
22

33
import CommandList;
4-
#include "FileSystem/ResourceManager.h"
4+
//#include "FileSystem/ResourceManager.h"
5+
import ResourceManager;
6+
#include "serialization/serialization_archives.h"
7+
58
import Resource;
69
#include "helper.h"
710
import TextureData;

sources/DirectXFramework/SIG/PSO.ixx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
module;
2+
23
#include "DX12/dx12_types.h"
34
#include "DX12/PipelineState.h"
45

56
export module PSO;
7+
export import "PSO_defines.h";
68

79
import Data;
810
import Threading;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
#define GEN_KEY(x, dir) static inline const KeyGenerator<&Keys::x,dir> x;
3+
4+
5+
#define GEN_COMPUTE_PSO(name, ...) \
6+
using PSOState = Render::ComputePipelineState; \
7+
using SimplePSO = SimpleComputePSO; \
8+
static const PSO ID = PSO::name;\
9+
std::map<Keys, PSOState::ptr> psos = {}; \
10+
PSOState::ptr GetPSO(KeyPair<Keys> key = KeyPair<Keys>()) {return psos[key.GetKey()];}; \
11+
name() \
12+
{ \
13+
PSOBase::shuffle_pairs<name>([&](Keys& key) \
14+
{ \
15+
auto pso = init_pso(key); \
16+
psos[key] = pso.create(); \
17+
} , ## __VA_ARGS__); \
18+
}
19+
20+
21+
#define GEN_GRAPHICS_PSO(name, ...) \
22+
using PSOState = Render::PipelineState; \
23+
using SimplePSO = SimpleGraphicsPSO; \
24+
static const PSO ID = PSO::name;\
25+
std::map<Keys, PSOState::ptr> psos = {}; \
26+
PSOState::ptr GetPSO(KeyPair<Keys> key = KeyPair<Keys>()) {return psos[key.GetKey()];}; \
27+
name() \
28+
{ \
29+
PSOBase::shuffle_pairs<name>([&](Keys& key)\
30+
{\
31+
auto pso = init_pso(key);\
32+
psos[key] = pso.create();\
33+
} , ## __VA_ARGS__);\
34+
}
35+

0 commit comments

Comments
 (0)