Vixen
dd8b0a81
csharp
public readonly record struct TextureBarrier

A texture changing what it is being used for, and therefore its layout.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Subresource ranges are here rather than implied, because the common case in a real renderer is transitioning one mip of a chain — generating mips, or reading level n while writing level n+1 — and a barrier that covers the whole texture there serialises work that did not need serialising.

Two different queues make this an ownership transfer, and an ownership transfer is two barriers, not one: the same barrier is recorded a second time on the destination queue's list, and the contents of a resource whose release was recorded without its matching acquire are undefined. Recording only one half is the shape of corruption that reproduces on one vendor and not another — a driver that happens to leave the memory alone looks correct forever. Vixen.Graphics.RenderGraph emits both halves; hand-written code has to do it in pairs.

⚠ Equal queues mean no transfer at all, and that is the default. A backend with one queue, or one whose two QueueKinds land on the same hardware family, records exactly what it records today — which is what makes an async-scheduled frame and a single-queue frame the same frame.

Fields and properties (10)

  • public TextureHandle Texture

    The texture.

  • public ResourceState Before

    What was using it.

  • public ResourceState After

    What is about to.

  • public int BaseMipLevel

    The first mip level the barrier covers.

  • public int MipLevelCount

    How many levels, or 0 for all of them.

  • public int BaseArrayLayer

    The first array layer the barrier covers.

  • public int ArrayLayerCount

    How many layers, or 0 for all of them.

  • public QueueKind SourceQueue

    Which queue owns it now.

  • public QueueKind DestinationQueue

    Which queue is to own it next.

  • public bool TransfersOwnership

    Whether this barrier hands the texture from one queue to another.

Methods (1)

  • public TextureBarrier(TextureHandle Texture, ResourceState Before, ResourceState After, int BaseMipLevel = 0, int MipLevelCount = 0, int BaseArrayLayer = 0, int ArrayLayerCount = 0, QueueKind SourceQueue = Graphics, QueueKind DestinationQueue = Graphics)

    A texture changing what it is being used for, and therefore its layout.

Used by (48, showing 40)

  • ArenaFrameThirdPersonShooter
  • ArenaIlluminationThirdPersonShooter
  • ShowcaseFramePbrShowcase
  • BarrierGroupVixen.Graphics
  • CascadeCountDeviceTestsVixen.Graphics.Golden.Tests
  • ClusteredShadingDeviceTestsVixen.Graphics.Golden.Tests
  • EnvironmentTextureVixen.Rendering
  • FoliageCullPassVixen.Rendering.Terrain
  • FoliageDrawPassVixen.Rendering.Terrain
  • GlCommandRecorderVixen.Graphics.OpenGL
  • GlDeviceVixen.Graphics.OpenGL
  • GlobalDistanceFieldTextureVixen.Rendering
  • GrassDrawPassVixen.Rendering.Terrain
  • ImpostorBakeVixen.Rendering
  • IrradianceBounceDeviceTestsVixen.Graphics.Golden.Tests
  • IrradianceCubeCaptureVixen.Rendering
  • IrradianceFieldTextureVixen.Rendering
  • IrradianceShadingDeviceTestsVixen.Graphics.Golden.Tests
  • MaxLightsDeviceTestsVixen.Graphics.Golden.Tests
  • NullCommandListVixen.Graphics.Null
  • PipelineStateImageTestsVixen.Graphics.Golden.Tests
  • QueueOwnershipTestsVixen.Graphics.Null.Tests
  • ReflectionRendererVixen.Rendering.PostFx
  • ReflectionRendererDeviceTestsVixen.Graphics.Golden.Tests
  • ReflectionTraceDeviceTestsVixen.Graphics.Golden.Tests
  • RenderGraphVixen.Graphics.RenderGraph
  • ScreenProbeBilateralImageTestsVixen.Graphics.Golden.Tests
  • ScreenProbeHistoryTextureVixen.Rendering
  • ScreenProbeTextureVixen.Rendering
  • ScreenProbeTraceDeviceTestsVixen.Graphics.Golden.Tests
  • ScreenPyramidDeviceTestsVixen.Graphics.Golden.Tests
  • SurfaceCacheTextureVixen.Rendering
  • SurfaceCardCaptureVixen.Rendering
  • TerrainRendererVixen.Rendering.Terrain
  • TrackingCommandListVixen.Graphics.RenderGraph.Tests
  • VideoRenderTargetVixen.Video.Rendering
  • VideoTextureVixen.Video
  • VulkanCommandListVixen.Graphics.Vulkan
  • WorldRendererVixen.Engine.Renderer
  • EditorUiCompositingDeviceTestsVixen.Editor.App.Tests