descriptor

package
v0.0.0-...-8e5a076 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2024 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDescriptorType = errors.New("invalid descriptor struct")

Functions

This section is empty.

Types

type Descriptor

type Descriptor interface {
	// Initialize the descriptor with the provided device, set, and binding index.
	// This is called automatically during Set instantiation.
	Initialize(dev *device.Device, set Set, binding int)

	BindingFlags() ext_descriptor_indexing.DescriptorBindingFlags

	// Destroy the descriptor.
	// Releasing any resources it owns, such as uniform buffers.
	Destroy()

	// LayoutBinding returns a descriptor set layout binding for this descriptor
	// using the provided binding index. This is useful for creating descriptor
	// set layouts including this descriptor.
	LayoutBinding(int) core1_0.DescriptorSetLayoutBinding
}

func CopyDescriptorStruct

func CopyDescriptorStruct[S Set](template S, blank Set) (S, []Descriptor)

CopyDescriptorStruct instantiates a descriptor struct according to the given template. Assumes that the template has passed validation beforehand.

func ParseDescriptorStruct

func ParseDescriptorStruct[S Set](template S) ([]Descriptor, error)

type DescriptorBinding

type DescriptorBinding struct {
	Name string
	Descriptor
}

type InputAttachment

type InputAttachment struct {
	Stages core1_0.ShaderStageFlags
	Layout core1_0.ImageLayout
	// contains filtered or unexported fields
}

func (*InputAttachment) BindingFlags

func (*InputAttachment) Destroy

func (d *InputAttachment) Destroy()

func (*InputAttachment) Initialize

func (d *InputAttachment) Initialize(device *device.Device, set Set, binding int)

func (*InputAttachment) LayoutBinding

func (d *InputAttachment) LayoutBinding(binding int) core1_0.DescriptorSetLayoutBinding

func (*InputAttachment) Set

func (d *InputAttachment) Set(view image.View)

func (*InputAttachment) String

func (d *InputAttachment) String() string

type Layout

type Layout[S Set] struct {
	// contains filtered or unexported fields
}

func NewLayout

func NewLayout[S Set](device *device.Device, name string, set S) *Layout[S]

func (*Layout[S]) Counts

func (d *Layout[S]) Counts() map[core1_0.DescriptorType]int

func (*Layout[S]) Destroy

func (d *Layout[S]) Destroy()

func (*Layout[S]) Instantiate

func (d *Layout[S]) Instantiate(pool *Pool) S

func (*Layout[S]) InstantiateMany

func (d *Layout[S]) InstantiateMany(pool *Pool, count int) []S

func (*Layout[S]) Name

func (d *Layout[S]) Name() string

func (*Layout[S]) Ptr

func (d *Layout[S]) Ptr() core1_0.DescriptorSetLayout

func (*Layout[S]) VariableCount

func (d *Layout[S]) VariableCount() int

type Map

type Map map[string]Descriptor

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool(device *device.Device, sets int, sizes []core1_0.DescriptorPoolSize) *Pool

func (*Pool) Allocate

func (p *Pool) Allocate(layout SetLayout) Set

func (*Pool) AllocateMany

func (p *Pool) AllocateMany(layout SetLayout, count int) []Set

func (*Pool) Destroy

func (p *Pool) Destroy()

func (*Pool) Ptr

func (p *Pool) Ptr() core1_0.DescriptorPool

func (*Pool) Recreate

func (p *Pool) Recreate()

type Resolver

type Resolver interface {
	Descriptor(string) (int, bool)
}

type Sampler

type Sampler struct {
	Stages core1_0.ShaderStageFlags
	// contains filtered or unexported fields
}

func (*Sampler) BindingFlags

func (*Sampler) Destroy

func (d *Sampler) Destroy()

func (*Sampler) Initialize

func (d *Sampler) Initialize(device *device.Device, set Set, binding int)

func (*Sampler) LayoutBinding

func (d *Sampler) LayoutBinding(binding int) core1_0.DescriptorSetLayoutBinding

func (*Sampler) Set

func (d *Sampler) Set(tex *texture.Texture)

func (*Sampler) String

func (d *Sampler) String() string

type SamplerArray

type SamplerArray struct {
	Count  int
	Stages core1_0.ShaderStageFlags
	// contains filtered or unexported fields
}

func (*SamplerArray) BindingFlags

func (*SamplerArray) Destroy

func (d *SamplerArray) Destroy()

func (*SamplerArray) Initialize

func (d *SamplerArray) Initialize(device *device.Device, set Set, binding int)

func (*SamplerArray) LayoutBinding

func (d *SamplerArray) LayoutBinding(binding int) core1_0.DescriptorSetLayoutBinding

func (*SamplerArray) MaxCount

func (d *SamplerArray) MaxCount() int

func (*SamplerArray) Set

func (d *SamplerArray) Set(index int, tex *texture.Texture)

func (*SamplerArray) SetRange

func (d *SamplerArray) SetRange(offset int, textures texture.Array)

func (*SamplerArray) String

func (d *SamplerArray) String() string

type Set

type Set interface {
	Ptr() core1_0.DescriptorSet
	Write(write core1_0.WriteDescriptorSet)
	Destroy()
	// contains filtered or unexported methods
}

type SetLayout

type SetLayout interface {
	device.Resource[core1_0.DescriptorSetLayout]
	Name() string
	Counts() map[core1_0.DescriptorType]int
	VariableCount() int
}

type SetMock

type SetMock struct {
}

func (*SetMock) Destroy

func (s *SetMock) Destroy()

func (*SetMock) Ptr

func (s *SetMock) Ptr() core1_0.DescriptorSet

func (*SetMock) Write

func (s *SetMock) Write(write core1_0.WriteDescriptorSet)

type Storage

type Storage[K comparable] struct {
	Stages core1_0.ShaderStageFlags
	Size   int
	// contains filtered or unexported fields
}

func (*Storage[K]) BindingFlags

func (*Storage[K]) Destroy

func (d *Storage[K]) Destroy()

func (*Storage[K]) Initialize

func (d *Storage[K]) Initialize(dev *device.Device, set Set, binding int)

func (*Storage[K]) LayoutBinding

func (d *Storage[K]) LayoutBinding(binding int) core1_0.DescriptorSetLayoutBinding

func (*Storage[K]) Set

func (d *Storage[K]) Set(index int, data K)

func (*Storage[K]) SetRange

func (d *Storage[K]) SetRange(offset int, data []K)

func (*Storage[K]) String

func (d *Storage[K]) String() string

type Uniform

type Uniform[K any] struct {
	Stages core1_0.ShaderStageFlags
	// contains filtered or unexported fields
}

func (*Uniform[K]) BindingFlags

func (*Uniform[K]) Destroy

func (d *Uniform[K]) Destroy()

func (*Uniform[K]) Initialize

func (d *Uniform[K]) Initialize(dev *device.Device, set Set, binding int)

func (*Uniform[K]) LayoutBinding

func (d *Uniform[K]) LayoutBinding(binding int) core1_0.DescriptorSetLayoutBinding

func (*Uniform[K]) Set

func (d *Uniform[K]) Set(data K)

func (*Uniform[K]) String

func (d *Uniform[K]) String() string

type UniformArray

type UniformArray[K any] struct {
	Size   int
	Stages core1_0.ShaderStageFlags
	// contains filtered or unexported fields
}

func (*UniformArray[K]) BindingFlags

func (*UniformArray[K]) Destroy

func (d *UniformArray[K]) Destroy()

func (*UniformArray[K]) Initialize

func (d *UniformArray[K]) Initialize(dev *device.Device, set Set, binding int)

func (*UniformArray[K]) LayoutBinding

func (d *UniformArray[K]) LayoutBinding(binding int) core1_0.DescriptorSetLayoutBinding

func (*UniformArray[K]) Set

func (d *UniformArray[K]) Set(index int, data K)

func (*UniformArray[K]) SetRange

func (d *UniformArray[K]) SetRange(offset int, data []K)

func (*UniformArray[K]) String

func (d *UniformArray[K]) String() string

type VariableDescriptor

type VariableDescriptor interface {
	Descriptor
	MaxCount() int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL