aboutsummaryrefslogtreecommitdiffstatsci
path: root/vke/src/base/DescriptorSetLayout.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2019-08-30 07:11:09 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2019-08-30 07:11:09 +0200
commit3898aa5bf7bde8f018c8c064574ba726ddb8553f (patch)
tree020d7c2e30be0c1958e36d705b0b2540df2e53e0 /vke/src/base/DescriptorSetLayout.cs
parent9d390ab1738507ee166ac519f3d7def15e698493 (diff)
rename vke directory to CVKL
Diffstat (limited to 'vke/src/base/DescriptorSetLayout.cs')
-rw-r--r--vke/src/base/DescriptorSetLayout.cs60
1 files changed, 0 insertions, 60 deletions
diff --git a/vke/src/base/DescriptorSetLayout.cs b/vke/src/base/DescriptorSetLayout.cs
deleted file mode 100644
index f63e5e2..0000000
--- a/vke/src/base/DescriptorSetLayout.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
-//
-// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-using System;
-using System.Collections.Generic;
-using VK;
-using static VK.Vk;
-
-namespace CVKL {
- /// <summary>
- /// Descriptor set layout, automatically activated when used in pipeline creation, so don't allocate descriptor sets using
- /// this layout unless it has been activated.
- /// </summary>
- public sealed class DescriptorSetLayout : Activable {
- internal VkDescriptorSetLayout handle;
-
- public VkDescriptorSetLayoutCreateFlags Flags { get; private set; } = 0;
- public List<VkDescriptorSetLayoutBinding> Bindings { get; private set; } = new List<VkDescriptorSetLayoutBinding> ();
-
- protected override VkDebugMarkerObjectNameInfoEXT DebugMarkerInfo
- => new VkDebugMarkerObjectNameInfoEXT(VkDebugReportObjectTypeEXT.DescriptorSetLayoutEXT, handle.Handle);
-
- #region CTORS
- public DescriptorSetLayout (Device device, VkDescriptorSetLayoutCreateFlags flags) : base (device) {
- Flags = flags;
- }
- public DescriptorSetLayout (Device device, params VkDescriptorSetLayoutBinding[] bindings)
- : this (device, 0, bindings) {
- }
- public DescriptorSetLayout (Device device, VkDescriptorSetLayoutCreateFlags flags, params VkDescriptorSetLayoutBinding[] bindings)
- : this (device, flags) {
- foreach (VkDescriptorSetLayoutBinding b in bindings)
- Bindings.Add (b);
- }
- #endregion
-
- public override void Activate () {
- if (state != ActivableState.Activated) {
- VkDescriptorSetLayoutCreateInfo info = new VkDescriptorSetLayoutCreateInfo (Flags, (uint)Bindings.Count, Bindings.Pin());
- Utils.CheckResult (vkCreateDescriptorSetLayout (Dev.VkDev, ref info, IntPtr.Zero, out handle));
- Bindings.Unpin ();
- }
- base.Activate ();
- }
-
- public override string ToString () {
- return string.Format ($"{base.ToString ()}[0x{handle.Handle.ToString("x")}]");
- }
-
- #region IDisposable Support
- protected override void Dispose (bool disposing) {
- if (!disposing)
- System.Diagnostics.Debug.WriteLine ("VKE DescriptorSetLayout disposed by finalizer");
- if (state == ActivableState.Activated)
- vkDestroyDescriptorSetLayout (Dev.VkDev, handle, IntPtr.Zero);
- base.Dispose (disposing);
- }
- #endregion
- }
-}