Nebula
Loading...
Searching...
No Matches
materialloader.cc File Reference
#include "materialloader.h"
#include "io/bxmlreader.h"
#include "resources/resourceserver.h"
#include "materials/materialtemplates.h"
#include "materials/material_interfaces.h"

Classes

struct  Materials::MaterialBuffer< INTERFACE_TYPE >
 

Namespaces

namespace  Materials
 Material special version of variant.
 

Macros

#define MATERIAL_LIST
 
#define PROPERTIES_LIST
 
#define X(x)
 
#define ALLOC_MATERIAL(x)
 
#define X(x)
 
#define X(x)
 
#define X(x)
 

Typedefs

using Materials::LoaderFunc = void(*)(Ptr<IO::BXmlReader>, Materials::MaterialId, Util::StringAtom)
 

Functions

 Materials::__ImplementClass (Materials::MaterialLoader, 'MALO', Resources::ResourceLoader)
 
void Materials::LoadTexture (const Ptr< IO::BXmlReader > &reader, CoreGraphics::TextureId def, const char *name, const char *tag, uint &handle, bool &dirtyFlag)
 
void Materials::LoadVec4 (const Ptr< IO::BXmlReader > &reader, const char *name, float value[4], const Math::vec4 &def)
 
void Materials::LoadVec3 (const Ptr< IO::BXmlReader > &reader, const char *name, float value[3], const Math::vec3 &def)
 
void Materials::LoadFloat (const Ptr< IO::BXmlReader > &reader, const char *name, float &value, const float def)
 
void Materials::LoadMaterialParameter (Ptr< IO::BXmlReader > reader, Util::StringAtom name, const MaterialTemplates::Entry *entry, const Materials::MaterialId id, bool immediate)
 

Variables

Util::Dictionary< MaterialTemplates::MaterialProperties, LoaderFuncMaterials::LoaderMap
 
struct { 
 
   MATERIAL_LIST MaterialInterfaces::MaterialBindings   Materials::bindings 
 
   CoreGraphics::BufferWithStaging   Materials::materialBindingBuffer 
 
   Threading::CriticalSection   Materials::variantAllocatorLock 
 
   Memory::ArenaAllocator< 4096 >   Materials::variantAllocator 
 
   union DirtySet
 
      struct { 
 
         bool   Materials::graphicsDirty: 1 
 
         bool   Materials::computeDirty: 1 
 
      }  
 
      int   Materials::bits 
 
   }   Materials::dirtySet 
 
Materials::state 
 

Macro Definition Documentation

◆ ALLOC_MATERIAL

#define ALLOC_MATERIAL ( x)
Value:
Ids::Id32 id = state.x##s.Alloc();\
state.bindings.x##s = CoreGraphics::BufferGetDeviceAddress(state.x##s.deviceBuffer);\
MaterialInterfaces::x& material = state.x##s.Get(id);\
state.x##s.dirty = true;
CoreGraphics::DeviceAddress BufferGetDeviceAddress(const BufferId id)
Get buffer device address.
Definition vkbuffer.cc:548
uint32_t Id32
Definition id.h:138

◆ MATERIAL_LIST

#define MATERIAL_LIST
Value:
X(BRDFMaterial) \
X(BSDFMaterial) \
X(GLTFMaterial) \
X(UnlitMaterial) \
X(BlendAddMaterial) \
X(SkyboxMaterial) \
X(TerrainMaterial) \
#define X(x)
Definition materialloader.cc:153

◆ PROPERTIES_LIST

#define PROPERTIES_LIST
Value:
X(BRDF) \
X(BSDF) \
X(GLTF) \
X(Unlit) \
X(BlendAdd) \
X(Skybox) \
X(Terrain) \
The occupancy quad tree implements a tree which allows for a quick search.
Definition occupancyquadtree.h:15

◆ X [1/4]

#define X ( x)
Value:
MaterialBuffer<MaterialInterfaces::x> x##s = #x;

◆ X [2/4]

#define X ( x)
Value:
if (state.x##s.hostBuffer != CoreGraphics::InvalidBufferId) \
{ \
hostBuffers.Append({.buf = state.x##s.hostBuffer});\
deviceBuffers.Append({.buf = state.x##s.deviceBuffer});\
}

◆ X [3/4]

#define X ( x)
Value:
state.x##s.Flush(id, queue);

◆ X [4/4]

#define X ( x)
Value:
case MaterialTemplates::MaterialProperties::x:\
return state.x##Materials.deviceBuffer;\
Material special version of variant.
Definition material.cc:11