Exemple #1
0
 internal D3D12GraphicsTexture(GraphicsTextureKind kind, D3D12GraphicsHeap graphicsHeap, ulong offset, ulong size, ulong width, uint height, ushort depth)
     : base(kind, graphicsHeap, offset, size, width, height, depth)
 {
     _d3d12Resource      = new ValueLazy <Pointer <ID3D12Resource> >(CreateD3D12Resource);
     _d3d12ResourceState = new ValueLazy <D3D12_RESOURCE_STATES>(GetD3D12ResourceState);
     _ = _state.Transition(to: Initialized);
 }
Exemple #2
0
 /// <summary>Initializes a new instance of the <see cref="GraphicsTexture" /> class.</summary>
 /// <param name="kind">The texture kind.</param>
 /// <param name="graphicsHeap">The graphics heap on which the texture was created.</param>
 /// <param name="offset">The offset, in bytes, of the texture in relation to <paramref name="graphicsHeap" />.</param>
 /// <param name="size">The size, in bytes, of the texture.</param>
 /// <param name="width">The width, in pixels, of the texture.</param>
 /// <param name="height">The height, in pixels, of the texture.</param>
 /// <param name="depth">The depth, in pixels, of the texture.</param>
 /// <exception cref="ArgumentNullException"><paramref name="graphicsHeap" /> is <c>null</c>.</exception>
 protected GraphicsTexture(GraphicsTextureKind kind, GraphicsHeap graphicsHeap, ulong offset, ulong size, ulong width, uint height, ushort depth)
     : base(graphicsHeap, offset, size)
 {
     _width  = width;
     _height = height;
     _depth  = depth;
     _kind   = kind;
 }
 internal VulkanGraphicsTexture(GraphicsTextureKind kind, VulkanGraphicsHeap graphicsHeap, ulong offset, ulong size, ulong width, uint height, ushort depth)
     : base(kind, graphicsHeap, offset, size, width, height, depth)
 {
     _vulkanImage     = new ValueLazy <VkImage>(CreateVulkanImage);
     _vulkanImageView = new ValueLazy <VkImageView>(CreateVulkanImageView);
     _vulkanSampler   = new ValueLazy <VkSampler>(CreateVulkanSampler);
     _ = _state.Transition(to: Initialized);
 }
Exemple #4
0
        /// <inheritdoc cref="CreateGraphicsTexture(GraphicsTextureKind, ulong, uint, ushort)" />
        public D3D12GraphicsTexture CreateD3D12GraphicsTexture(GraphicsTextureKind kind, ulong width, uint height, ushort depth)
        {
            _state.ThrowIfDisposedOrDisposing();

            var size   = width * height * depth * sizeof(uint);
            var offset = _offset;

            size    = (size + D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT - 1) & ~(D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT - 1u);
            _offset = offset + size;

            return(new D3D12GraphicsTexture(kind, this, offset, size, width, height, depth));
        }
Exemple #5
0
        /// <inheritdoc cref="CreateGraphicsTexture(GraphicsTextureKind, ulong, uint, ushort)" />
        public VulkanGraphicsTexture CreateVulkanGraphicsTexture(GraphicsTextureKind kind, ulong width, uint height, ushort depth)
        {
            _state.ThrowIfDisposedOrDisposing();

            var vulkanGraphicsAdapter = VulkanGraphicsDevice.VulkanGraphicsAdapter;
            var nonCoherentAtomSize   = 64 * 1024ul;

            var size   = width * height * depth * sizeof(uint);
            var offset = _offset;

            size    = (size + nonCoherentAtomSize - 1) & ~(nonCoherentAtomSize - 1);
            _offset = offset + size;

            return(new VulkanGraphicsTexture(kind, this, offset, size, width, height, depth));
        }
 internal D3D12GraphicsTexture(D3D12GraphicsDevice device, GraphicsTextureKind kind, in GraphicsMemoryRegion <GraphicsMemoryBlock> blockRegion, GraphicsResourceCpuAccess cpuAccess, uint width, uint height, ushort depth)
#pragma warning restore IDE0044

        internal VulkanGraphicsTexture(VulkanGraphicsDevice device, GraphicsTextureKind kind, in GraphicsMemoryRegion <GraphicsMemoryBlock> blockRegion, GraphicsResourceCpuAccess cpuAccess, uint width, uint height, ushort depth, VkImage vulkanImage)
Exemple #8
0
 /// <summary>Initializes a new instance of the <see cref="GraphicsTexture" /> class.</summary>
 /// <param name="kind">The texture kind.</param>
 /// <param name="cpuAccess">The CPU access capabilities of the resource.</param>
 /// <param name="memoryBlockRegion">The memory block region in which the resource exists.</param>
 /// <param name="width">The width, in pixels, of the graphics texture.</param>
 /// <param name="height">The height, in pixels, of the graphics texture.</param>
 /// <param name="depth">The depth, in pixels, of the graphics texture.</param>
 /// <inheritdoc cref="GraphicsResource(GraphicsResourceCpuAccess, in GraphicsMemoryBlockRegion)" />
 protected GraphicsTexture(GraphicsTextureKind kind, GraphicsResourceCpuAccess cpuAccess, in GraphicsMemoryBlockRegion memoryBlockRegion, uint width, uint height, ushort depth)
Exemple #9
0
 /// <inheritdoc />
 public override GraphicsTexture CreateGraphicsTexture(GraphicsTextureKind kind, ulong width, uint height, ushort depth) => CreateD3D12GraphicsTexture(kind, width, height, depth);
Exemple #10
0
 /// <summary>Creates a new graphics texture for the heap.</summary>
 /// <param name="kind">The kind of graphics texture to create.</param>
 /// <param name="width">The width, in pixels, of the graphics texture.</param>
 /// <param name="height">The height, in pixels, of the graphics texture.</param>
 /// <param name="depth">The depth, in pixels, of the graphics texture.</param>
 /// <returns>A new graphics texture created for the heap.</returns>
 /// <exception cref="ObjectDisposedException">The heap has been disposed.</exception>
 public abstract GraphicsTexture CreateGraphicsTexture(GraphicsTextureKind kind, ulong width, uint height = 1, ushort depth = 1);
Exemple #11
0
 internal VulkanGraphicsTexture(GraphicsTextureKind kind, GraphicsResourceCpuAccess cpuAccess, in GraphicsMemoryBlockRegion memoryBlockRegion, uint width, uint height, ushort depth, VkImage vulkanImage)