VulkanRaytracingCycles 0.0.0
Cycles Render Engine With VulkanRaytracingShaderModules. ( Experiment , in progress)
ImmidiateBufferCmd< Pool > Struct Template Reference

#include <CmdPoolVk.h>

Classes

struct  mapInfo
 

Public Member Functions

 ImmidiateBufferCmd ()
 
 ~ImmidiateBufferCmd ()
 
void alloc ()
 
void free ()
 
char * GetMap (VkDeviceSize offset, VkDeviceSize size)
 
bool Map (void *src, VkDeviceSize offset, VkDeviceSize size)
 
bool Memset (int val, VkDeviceSize offset, VkDeviceSize size)
 
bool Copy (VkBuffer dst, VkDeviceSize size, VkDeviceSize srcOffset, VkDeviceSize dstOffset)
 
template<class B >
bool Copy (B &_, VkDeviceSize size, VkDeviceSize srcOffset, VkDeviceSize dstOffset)
 

Public Attributes

struct ImmidiateBufferCmd::mapInfo stg_info
 

Detailed Description

template<class Pool>
struct ImmidiateBufferCmd< Pool >

Definition at line 152 of file CmdPoolVk.h.

Inheritance diagram for ImmidiateBufferCmd< Pool >:

Constructor & Destructor Documentation

◆ ImmidiateBufferCmd()

template<class Pool >
ImmidiateBufferCmd< Pool >::ImmidiateBufferCmd ( )
inline

Definition at line 165 of file CmdPoolVk.h.

165 {
166 alloc();
167 };

◆ ~ImmidiateBufferCmd()

template<class Pool >
ImmidiateBufferCmd< Pool >::~ImmidiateBufferCmd ( )
inline

Definition at line 170 of file CmdPoolVk.h.

170{ free(); };

Member Function Documentation

◆ alloc()

template<class Pool >
void ImmidiateBufferCmd< Pool >::alloc ( )
inline

Definition at line 172 of file CmdPoolVk.h.

172 {
173 Pool::alloc();
174 }

◆ Copy() [1/2]

template<class Pool >
template<class B >
bool ImmidiateBufferCmd< Pool >::Copy ( B &  _,
VkDeviceSize  size,
VkDeviceSize  srcOffset,
VkDeviceSize  dstOffset 
)
inline

Definition at line 223 of file CmdPoolVk.h.

223 {
224
225 VkBufferCopy copyRegion = { srcOffset ,dstOffset,size };
226 vkCmdCopyBuffer(Pool::cmd, Pool::staging.buffer, _.buffer, 1, &copyRegion);
227 return true;
228 };

◆ Copy() [2/2]

template<class Pool >
bool ImmidiateBufferCmd< Pool >::Copy ( VkBuffer  dst,
VkDeviceSize  size,
VkDeviceSize  srcOffset,
VkDeviceSize  dstOffset 
)
inline

Definition at line 215 of file CmdPoolVk.h.

215 {
216
217 VkBufferCopy copyRegion = { srcOffset ,dstOffset,size };
218 vkCmdCopyBuffer(Pool::cmd, Pool::staging.buffer, dst, 1, &copyRegion);
219 return true;
220 };

◆ free()

template<class Pool >
void ImmidiateBufferCmd< Pool >::free ( )
inline

Definition at line 176 of file CmdPoolVk.h.

176 {
177 Pool::free();
178 };

◆ GetMap()

template<class Pool >
char * ImmidiateBufferCmd< Pool >::GetMap ( VkDeviceSize  offset,
VkDeviceSize  size 
)
inline

Definition at line 185 of file CmdPoolVk.h.

185 {
186 char* dst;
187 VK_CHECK_RESULT(vkMapMemory($device, Pool::staging.memory, offset, size, 0, (void**)&dst));
188 stg_info.offset = offset;
189 stg_info.size = size;
190 return dst;
191 }
struct ImmidiateBufferCmd::mapInfo stg_info

◆ Map()

template<class Pool >
bool ImmidiateBufferCmd< Pool >::Map ( void *  src,
VkDeviceSize  offset,
VkDeviceSize  size 
)
inline

Definition at line 193 of file CmdPoolVk.h.

193 {
194
195 char* dst;
196 VK_CHECK_RESULT(vkMapMemory($device, Pool::staging.memory, offset, size, 0, (void**)&dst));
197 memcpy(dst, src, size);
198 vkUnmapMemory($device, Pool::staging.memory);
199
200 return true;
201
202 };

◆ Memset()

template<class Pool >
bool ImmidiateBufferCmd< Pool >::Memset ( int  val,
VkDeviceSize  offset,
VkDeviceSize  size 
)
inline

Definition at line 204 of file CmdPoolVk.h.

204 {
205
206 char* dst;
207 VK_CHECK_RESULT(vkMapMemory($device, Pool::staging.memory, offset, size, 0, (void**)&dst));
208 memset(dst, val, size);
209 vkUnmapMemory($device, Pool::staging.memory);
210
211 return true;
212
213 };

Member Data Documentation

◆ stg_info

template<class Pool >
struct ImmidiateBufferCmd::mapInfo ImmidiateBufferCmd< Pool >::stg_info

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