MCPcopy Create free account
hub / github.com/cogentcore/core / NewBuffer

Method NewBuffer

vgpu/cmds.go:49–63  ·  view source on GitHub ↗

NewBuffer makes a buffer in pool, setting Buff to point to it if Buff == nil, returning the buffer.

(dv *Device)

Source from the content-addressed store, hash-verified

47// NewBuffer makes a buffer in pool, setting Buff to point to it
48// if Buff == nil, returning the buffer.
49func (cp *CmdPool) NewBuffer(dv *Device) vk.CommandBuffer {
50 var cmdBuff = make([]vk.CommandBuffer, 1)
51 ret := vk.AllocateCommandBuffers(dv.Device, &vk.CommandBufferAllocateInfo{
52 SType: vk.StructureTypeCommandBufferAllocateInfo,
53 CommandPool: cp.Pool,
54 Level: vk.CommandBufferLevelPrimary,
55 CommandBufferCount: 1,
56 }, cmdBuff)
57 IfPanic(NewError(ret))
58 cBuff := cmdBuff[0]
59 if cp.Buff == nil {
60 cp.Buff = cBuff
61 }
62 return cBuff
63}
64
65// BeginCmd does BeginCommandBuffer on buffer
66func (cp *CmdPool) BeginCmd() vk.CommandBuffer {

Callers 6

InitCmdMethod · 0.45
NewCmdBuffMethod · 0.45
MemCmdStartMethod · 0.45
ReadMDFunction · 0.45
FromMimeDataMethod · 0.45
ReadBytesFunction · 0.45

Calls 2

IfPanicFunction · 0.85
NewErrorFunction · 0.85

Tested by

no test coverage detected