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

#include <incomplete.h>

Public Member Functions

 Bache ()
 
 Bache (size_t hash, VkDeviceSize align, LayoutType type)
 
Bacheoperator= (const Bache &other)
 
template<class T >
void Undo (T desc)
 
template<class T >
void Redo (T desc)
 

Public Attributes

long id
 
long refCnt
 
Hache buffer
 
VkDeviceSize align
 
VkDeviceSize reqAlign
 
VkDeviceSize size
 
VkDeviceSize offset
 
VkDeviceSize reqSize
 
std::queue< uint32_t > vacancy
 
std::string_view type
 
SRWLOCK excl
 
VkBuffer vkBuffer
 
void * mapped
 

Detailed Description

Definition at line 117 of file incomplete.h.

Constructor & Destructor Documentation

◆ Bache() [1/2]

Bache::Bache ( )

Definition at line 7 of file incomplete.cpp.

7 :
8 id(-1),
9 refCnt(0),
10 buffer({ -1,0,0}),
11 align(0),
12 reqAlign(0),
13 size(0),
14 reqSize(0),
15 vacancy(),
16 type(""),
17 excl({}),
18 vkBuffer(VK_NULL_HANDLE),
19 mapped(nullptr)
20{};
long id
Definition: incomplete.h:119
VkDeviceSize size
Definition: incomplete.h:126
VkDeviceSize align
Definition: incomplete.h:123
long refCnt
Definition: incomplete.h:120
VkBuffer vkBuffer
Definition: incomplete.h:134
SRWLOCK excl
Definition: incomplete.h:133
void * mapped
Definition: incomplete.h:135
VkDeviceSize reqSize
Definition: incomplete.h:128
Hache buffer
Definition: incomplete.h:121
VkDeviceSize reqAlign
Definition: incomplete.h:124
std::queue< uint32_t > vacancy
Definition: incomplete.h:130
std::string_view type
Definition: incomplete.h:131

◆ Bache() [2/2]

Bache::Bache ( size_t  hash,
VkDeviceSize  align,
LayoutType  type 
)

Definition at line 22 of file incomplete.cpp.

26 :
27 id(-1),
28 refCnt(0),
29 buffer({-1,0,hash}),
30 align(align),
31 reqAlign(0),
32 size(0),
33 reqSize(0),
34 vacancy(),
35 type(type),
36 excl({}),
37 vkBuffer(VK_NULL_HANDLE),
38 mapped(nullptr)
39{};

Member Function Documentation

◆ operator=()

Bache & Bache::operator= ( const Bache other)

Definition at line 41 of file incomplete.cpp.

42{
43
44 if (&other == this)
45 return *this;
46
47 this->align = other.align;
48 this->buffer.hash = other.buffer.hash;
49 this->type = other.type;
50
51 return *this;
52};
size_t hash

◆ Redo()

template<class T >
void Bache::Redo ( desc)
inline

Definition at line 155 of file incomplete.h.

155 {
156
157 AcquireSRWLockExclusive(&excl);
158 desc.id = vacancy.front();
159 vacancy.pop();
160 refCnt++;
161 ReleaseSRWLockExclusive(&excl);
162
163 };

◆ Undo()

template<class T >
void Bache::Undo ( desc)
inline

Definition at line 144 of file incomplete.h.

144 {
145
146 AcquireSRWLockExclusive(&excl);
147 vacancy.push(desc.id);
148 desc.info.buffer = VK_NULL_HANDLE;
149 refCnt--;
150 ReleaseSRWLockExclusive(&excl);
151
152 };

Member Data Documentation

◆ align

VkDeviceSize Bache::align

Definition at line 123 of file incomplete.h.

◆ buffer

Hache Bache::buffer

Definition at line 121 of file incomplete.h.

◆ excl

SRWLOCK Bache::excl

Definition at line 133 of file incomplete.h.

◆ id

long Bache::id

Definition at line 119 of file incomplete.h.

◆ mapped

void* Bache::mapped

Definition at line 135 of file incomplete.h.

◆ offset

VkDeviceSize Bache::offset

Definition at line 127 of file incomplete.h.

◆ refCnt

long Bache::refCnt

Definition at line 120 of file incomplete.h.

◆ reqAlign

VkDeviceSize Bache::reqAlign

Definition at line 124 of file incomplete.h.

◆ reqSize

VkDeviceSize Bache::reqSize

Definition at line 128 of file incomplete.h.

◆ size

VkDeviceSize Bache::size

Definition at line 126 of file incomplete.h.

◆ type

std::string_view Bache::type

Definition at line 131 of file incomplete.h.

◆ vacancy

std::queue<uint32_t> Bache::vacancy

Definition at line 130 of file incomplete.h.

◆ vkBuffer

VkBuffer Bache::vkBuffer

Definition at line 134 of file incomplete.h.


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