16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 13:59:19 +02:00

add cpu-side submodel structure for ray testing

This commit is contained in:
MichauSto
2025-11-16 17:46:57 +01:00
committed by Hirek
parent acc4cca4c2
commit 0bde1e44db
8 changed files with 240 additions and 20 deletions

View File

@@ -14,18 +14,16 @@ struct MaResourceMapping {
entt::hashed_string m_key;
nvrhi::ResourceType m_type;
#define MA_RESOURCE_MAPPING_INITIALIZER(type) \
template <typename KeyType> \
static MaResourceMapping type(int slot, const KeyType& key) { \
MaResourceMapping mapping{}; \
mapping.m_slot = slot; \
mapping.m_key = static_cast<entt::hashed_string>(key); \
mapping.m_type = nvrhi::ResourceType::type; \
return mapping; \
#define MA_RESOURCE_MAPPING_INITIALIZER(type) \
static MaResourceMapping type(int slot, const char* key) { \
MaResourceMapping mapping{}; \
mapping.m_slot = slot; \
mapping.m_key = static_cast<entt::hashed_string>(key); \
mapping.m_type = nvrhi::ResourceType::type; \
return mapping; \
}
template <typename KeyType>
static MaResourceMapping Texture_SRV(int slot, const KeyType& key) {
static MaResourceMapping Texture_SRV(int slot, const char* key) {
MaResourceMapping mapping{};
mapping.m_slot = slot;
mapping.m_key = static_cast<entt::hashed_string>(key);