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

Method ConfigDepthView

vgpu/image.go:672–695  ·  view source on GitHub ↗

ConfigDepthView configures a depth view image

()

Source from the content-addressed store, hash-verified

670
671// ConfigDepthView configures a depth view image
672func (im *Image) ConfigDepthView() {
673 im.DestroyView()
674 var view vk.ImageView
675 ret := vk.CreateImageView(im.Dev, &vk.ImageViewCreateInfo{
676 SType: vk.StructureTypeImageViewCreateInfo,
677 Format: im.Format.Format,
678 Components: vk.ComponentMapping{ // this is the default anyway
679 R: vk.ComponentSwizzleIdentity,
680 G: vk.ComponentSwizzleIdentity,
681 B: vk.ComponentSwizzleIdentity,
682 A: vk.ComponentSwizzleIdentity,
683 },
684 SubresourceRange: vk.ImageSubresourceRange{
685 AspectMask: vk.ImageAspectFlags(vk.ImageAspectDepthBit),
686 LevelCount: 1,
687 LayerCount: 1,
688 },
689 ViewType: vk.ImageViewType2d,
690 Image: im.Image,
691 }, nil, &view)
692 IfPanic(NewError(ret))
693 im.View = view
694 im.SetFlag(true, ImageActive)
695}
696
697// DestroyView destroys any existing view
698func (im *Image) DestroyView() {

Callers 2

ConfigDepthMethod · 0.95
SetSizeMethod · 0.80

Calls 4

DestroyViewMethod · 0.95
SetFlagMethod · 0.95
IfPanicFunction · 0.85
NewErrorFunction · 0.85

Tested by

no test coverage detected