Img2Num C++ (Internal Developer Docs) dev
API Documentation
Loading...
Searching...
No Matches
gpu::BindEntry Struct Reference

A single entry for bind-group construction. More...

#include <gpu_utils.h>

+ Collaboration diagram for gpu::BindEntry:

Static Public Member Functions

static BindEntry texture (uint32_t binding, const Texture &tex)
 Create a texture-view entry.
 
static BindEntry texture_raw (uint32_t binding, wgpu::TextureView tv)
 Create a texture-view entry from a raw wgpu::TextureView.
 
template<typename T >
static BindEntry buffer_entry (uint32_t binding, const Buffer< T > &buf)
 Create a buffer entry (storage or uniform).
 
static BindEntry buffer_raw (uint32_t binding, wgpu::Buffer buf, uint64_t size)
 Create a buffer entry from a raw wgpu::Buffer and size.
 

Public Attributes

uint32_t binding
 
wgpu::TextureView texture_view {}
 
wgpu::Buffer buffer {}
 
uint64_t buffer_size {0}
 
uint64_t buffer_offset {0}
 

Detailed Description

A single entry for bind-group construction.

Definition at line 411 of file gpu_utils.h.

Member Function Documentation

◆ buffer_entry()

template<typename T >
static BindEntry gpu::BindEntry::buffer_entry ( uint32_t  binding,
const Buffer< T > &  buf 
)
inlinestatic

Create a buffer entry (storage or uniform).

Definition at line 435 of file gpu_utils.h.

435 {
436 BindEntry e;
437 e.binding = binding;
438 e.buffer = buf.handle();
439 e.buffer_size = buf.byte_size();
440 return e;
441 }

References gpu::Buffer< T >::byte_size(), and gpu::Buffer< T >::handle().

+ Here is the call graph for this function:

◆ buffer_raw()

static BindEntry gpu::BindEntry::buffer_raw ( uint32_t  binding,
wgpu::Buffer  buf,
uint64_t  size 
)
inlinestatic

Create a buffer entry from a raw wgpu::Buffer and size.

Definition at line 444 of file gpu_utils.h.

444 {
445 BindEntry e;
446 e.binding = binding;
447 e.buffer = std::move(buf);
448 e.buffer_size = size;
449 return e;
450 }

◆ texture()

static BindEntry gpu::BindEntry::texture ( uint32_t  binding,
const Texture &  tex 
)
inlinestatic

Create a texture-view entry.

Definition at line 419 of file gpu_utils.h.

419 {
420 BindEntry e;
421 e.binding = binding;
422 e.texture_view = tex.view();
423 return e;
424 }

References gpu::Texture::view().

+ Here is the call graph for this function:

◆ texture_raw()

static BindEntry gpu::BindEntry::texture_raw ( uint32_t  binding,
wgpu::TextureView  tv 
)
inlinestatic

Create a texture-view entry from a raw wgpu::TextureView.

Definition at line 427 of file gpu_utils.h.

427 {
428 BindEntry e;
429 e.binding = binding;
430 e.texture_view = std::move(tv);
431 return e;
432 }

Member Data Documentation

◆ binding

uint32_t gpu::BindEntry::binding

Definition at line 412 of file gpu_utils.h.

◆ buffer

wgpu::Buffer gpu::BindEntry::buffer {}

Definition at line 414 of file gpu_utils.h.

414{};

◆ buffer_offset

uint64_t gpu::BindEntry::buffer_offset {0}

Definition at line 416 of file gpu_utils.h.

416{0};

◆ buffer_size

uint64_t gpu::BindEntry::buffer_size {0}

Definition at line 415 of file gpu_utils.h.

415{0};

◆ texture_view

wgpu::TextureView gpu::BindEntry::texture_view {}

Definition at line 413 of file gpu_utils.h.

413{};

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