VulkanRaytracingCycles 0.0.0
Cycles Render Engine With VulkanRaytracingShaderModules. ( Experiment , in progress)
Iache Struct Reference

#include <incomplete.h>

Public Member Functions

 Iache ()
 
 Iache (size_t hash)
 
 ~Iache ()
 
Iacheoperator= (size_t hash)
 
template<class T >
Iacheoperator= (T &iach)
 
template<class I >
void Delete (I *im)
 

Static Public Member Functions

static size_t rehash (std::string imgName, size_t seed) noexcept
 

Public Attributes

VkFormat format
 
uint32_t multisample
 
VkImageLayout layout
 
VkDescriptorType type
 
long refCnt
 
const size_t hash
 
Hache hach
 
VkImageView vkI
 
std::string name
 

Detailed Description

Definition at line 45 of file incomplete.h.

Constructor & Destructor Documentation

◆ Iache() [1/2]

Iache::Iache ( )
inline

Definition at line 57 of file incomplete.h.

57:hash(size_t(-1)), refCnt(0), multisample(1) {};
const size_t hash
Definition: incomplete.h:53
long refCnt
Definition: incomplete.h:52
uint32_t multisample
Definition: incomplete.h:49

◆ Iache() [2/2]

Iache::Iache ( size_t  hash)
inline

Definition at line 58 of file incomplete.h.

58:hash(hash), hach({ .id = -1,.version = 0,.hash = hash }), refCnt(0), multisample(1) { name = "new"; };
std::string name
Definition: incomplete.h:56
Hache hach
Definition: incomplete.h:54

◆ ~Iache()

Iache::~Iache ( )
inline

Definition at line 59 of file incomplete.h.

59{ log_once(" Call destructor Iache \n"); };
#define log_once(...)
DELETE ALL ^((?!\w).)*log_once(.*; ^((?!\w).)*log_once((.* )+?.*;.
Definition: log.hpp:13

Member Function Documentation

◆ Delete()

template<class I >
void Iache::Delete ( I *  im)
inline

Definition at line 107 of file incomplete.h.

107 {
108 long cnt = InterlockedDecrement(&refCnt);
109 log_once(" Decrement Iache %d \n", cnt);
110 if (cnt == 0) {
111 im->$Delete(&hach);
112 }
113 };

◆ operator=() [1/2]

Iache & Iache::operator= ( size_t  hash)
inline

Definition at line 62 of file incomplete.h.

63 {
64 if (this->hash == hash) return *this;
65 if (refCnt > 0)log_bad("Iache reference exists. you lost the hash. \n");
66 this->~Iache();
67 new (this) Iache(hash);
68 return *this;
69 };
#define log_bad(...)
Definition: log.hpp:37
~Iache()
Definition: incomplete.h:59
Iache()
Definition: incomplete.h:57

◆ operator=() [2/2]

template<class T >
Iache & Iache::operator= ( T &  iach)
inline

Definition at line 71 of file incomplete.h.

72 {
73
74 log_once(" Call Swap Iache %d %x <=> %x , %x <=> %x \n", refCnt, this->hach.id, iach.hach.id, this->hash, iach.hash);
75
76 if (this->hash == iach.hash) return *this;
77 if (refCnt > 0)log_bad("Iache reference exists. you lost the hash. \n");
78 this->~Iache();
79 new (this) Iache(iach.hash);
80 this->hach.id = iach.hach.id;
81 this->format = iach.format;
82 this->multisample = iach.multisample;
83 this->refCnt = iach.refCnt;
84 this->vkI = iach.vkI;
85 log_once(" Call Swap view %x id %x hash %x version %x\n", this->vkI, this->hach.id, this->hach.hash, this->hach.version);
86 return *this;
87 };
VkImageView vkI
Definition: incomplete.h:55
VkFormat format
Definition: incomplete.h:48

◆ rehash()

static size_t Iache::rehash ( std::string  imgName,
size_t  seed 
)
inlinestaticnoexcept

Definition at line 89 of file incomplete.h.

90 {
91 static std::hash<std::string> h_img{};
92 static std::hash<size_t> h_seed{};
93
94 std::size_t hash = 0;
95 hash += h_img(imgName);
96 hash += hash << 10;
97 hash ^= hash >> 6;
98
99 hash += h_seed(seed);
100 hash += hash << 3;
101 hash ^= hash >> 11;
102 hash += hash << 15;
103 return hash;
104 };

Member Data Documentation

◆ format

VkFormat Iache::format

Definition at line 48 of file incomplete.h.

◆ hach

Hache Iache::hach

Definition at line 54 of file incomplete.h.

◆ hash

const size_t Iache::hash

Definition at line 53 of file incomplete.h.

◆ layout

VkImageLayout Iache::layout

Definition at line 50 of file incomplete.h.

◆ multisample

uint32_t Iache::multisample

Definition at line 49 of file incomplete.h.

◆ name

std::string Iache::name

Definition at line 56 of file incomplete.h.

◆ refCnt

long Iache::refCnt

Definition at line 52 of file incomplete.h.

◆ type

VkDescriptorType Iache::type

Definition at line 51 of file incomplete.h.

◆ vkI

VkImageView Iache::vkI

Definition at line 55 of file incomplete.h.


The documentation for this struct was generated from the following file: