Бранимир Караџић 6 yıl önce
ebeveyn
işleme
880f932cb8
4 değiştirilmiş dosya ile 76 ekleme ve 263 silme
  1. 34 221
      bindings/cs/bgfx.cs
  2. 11 11
      bindings/d/types.d
  3. 20 20
      include/bgfx/defines.h
  4. 11 11
      scripts/bgfx.idl

+ 34 - 221
bindings/cs/bgfx.cs

@@ -195,227 +195,6 @@ public static partial class bgfx
 		/// </summary>
 		CullCw                 = 0x0000001000000000,
 	
-		/// <summary>
-		/// Cull counter-clockwise triangles.
-		/// </summary>
-		CullCcw                = 0x0000002000000000,
-		CullShift              = 36,
-		CullMask               = 0x0000003000000000,
-	}
-	
-	[Flags]
-	public enum DiscardFlags : uint
-	{
-		/// <summary>
-		/// Discard only Index Buffer
-		/// </summary>
-		IndexBuffer            = 0x00000001,
-	
-		/// <summary>
-		/// Discard only Vertex Streams
-		/// </summary>
-		VertexStreams          = 0x00000002,
-	
-		/// <summary>
-		/// Discard only texture samplers
-		/// </summary>
-		TextureSamplers        = 0x00000004,
-	
-		/// <summary>
-		/// Discard only Compute shader related state
-		/// </summary>
-		Compute                = 0x00000008,
-	
-		/// <summary>
-		/// Discard only state
-		/// </summary>
-		State                  = 0x00000010,
-	
-		/// <summary>
-		/// Discard every rendering states
-		/// </summary>
-		All                    = 0x0000001f,
-	}
-	
-	[Flags]
-	public enum StateFlags : ulong
-	{
-		/// <summary>
-		/// Enable R write.
-		/// </summary>
-		WriteR                 = 0x0000000000000001,
-	
-		/// <summary>
-		/// Enable G write.
-		/// </summary>
-		WriteG                 = 0x0000000000000002,
-	
-		/// <summary>
-		/// Enable B write.
-		/// </summary>
-		WriteB                 = 0x0000000000000004,
-	
-		/// <summary>
-		/// Enable alpha write.
-		/// </summary>
-		WriteA                 = 0x0000000000000008,
-	
-		/// <summary>
-		/// Enable depth write.
-		/// </summary>
-		WriteZ                 = 0x0000004000000000,
-	
-		/// <summary>
-		/// Enable RGB write.
-		/// </summary>
-		WriteRgb               = 0x0000000000000007,
-	
-		/// <summary>
-		/// Write all channels mask.
-		/// </summary>
-		WriteMask              = 0x000000400000000f,
-	
-		/// <summary>
-		/// Enable depth test, less.
-		/// </summary>
-		DepthTestLess          = 0x0000000000000010,
-	
-		/// <summary>
-		/// Enable depth test, less or equal.
-		/// </summary>
-		DepthTestLequal        = 0x0000000000000020,
-	
-		/// <summary>
-		/// Enable depth test, equal.
-		/// </summary>
-		DepthTestEqual         = 0x0000000000000030,
-	
-		/// <summary>
-		/// Enable depth test, greater or equal.
-		/// </summary>
-		DepthTestGequal        = 0x0000000000000040,
-	
-		/// <summary>
-		/// Enable depth test, greater.
-		/// </summary>
-		DepthTestGreater       = 0x0000000000000050,
-	
-		/// <summary>
-		/// Enable depth test, not equal.
-		/// </summary>
-		DepthTestNotequal      = 0x0000000000000060,
-	
-		/// <summary>
-		/// Enable depth test, never.
-		/// </summary>
-		DepthTestNever         = 0x0000000000000070,
-	
-		/// <summary>
-		/// Enable depth test, always.
-		/// </summary>
-		DepthTestAlways        = 0x0000000000000080,
-		DepthTestShift         = 4,
-		DepthTestMask          = 0x00000000000000f0,
-	
-		/// <summary>
-		/// 0, 0, 0, 0
-		/// </summary>
-		BlendZero              = 0x0000000000001000,
-	
-		/// <summary>
-		/// 1, 1, 1, 1
-		/// </summary>
-		BlendOne               = 0x0000000000002000,
-	
-		/// <summary>
-		/// Rs, Gs, Bs, As
-		/// </summary>
-		BlendSrcColor          = 0x0000000000003000,
-	
-		/// <summary>
-		/// 1-Rs, 1-Gs, 1-Bs, 1-As
-		/// </summary>
-		BlendInvSrcColor       = 0x0000000000004000,
-	
-		/// <summary>
-		/// As, As, As, As
-		/// </summary>
-		BlendSrcAlpha          = 0x0000000000005000,
-	
-		/// <summary>
-		/// 1-As, 1-As, 1-As, 1-As
-		/// </summary>
-		BlendInvSrcAlpha       = 0x0000000000006000,
-	
-		/// <summary>
-		/// Ad, Ad, Ad, Ad
-		/// </summary>
-		BlendDstAlpha          = 0x0000000000007000,
-	
-		/// <summary>
-		/// 1-Ad, 1-Ad, 1-Ad ,1-Ad
-		/// </summary>
-		BlendInvDstAlpha       = 0x0000000000008000,
-	
-		/// <summary>
-		/// Rd, Gd, Bd, Ad
-		/// </summary>
-		BlendDstColor          = 0x0000000000009000,
-	
-		/// <summary>
-		/// 1-Rd, 1-Gd, 1-Bd, 1-Ad
-		/// </summary>
-		BlendInvDstColor       = 0x000000000000a000,
-	
-		/// <summary>
-		/// f, f, f, 1; f = min(As, 1-Ad)
-		/// </summary>
-		BlendSrcAlphaSat       = 0x000000000000b000,
-	
-		/// <summary>
-		/// Blend factor
-		/// </summary>
-		BlendFactor            = 0x000000000000c000,
-	
-		/// <summary>
-		/// 1-Blend factor
-		/// </summary>
-		BlendInvFactor         = 0x000000000000d000,
-		BlendShift             = 12,
-		BlendMask              = 0x000000000ffff000,
-	
-		/// <summary>
-		/// Blend add: src + dst.
-		/// </summary>
-		BlendEquationAdd       = 0x0000000000000000,
-	
-		/// <summary>
-		/// Blend subtract: src - dst.
-		/// </summary>
-		BlendEquationSub       = 0x0000000010000000,
-	
-		/// <summary>
-		/// Blend reverse subtract: dst - src.
-		/// </summary>
-		BlendEquationRevsub    = 0x0000000020000000,
-	
-		/// <summary>
-		/// Blend min: min(src, dst).
-		/// </summary>
-		BlendEquationMin       = 0x0000000030000000,
-	
-		/// <summary>
-		/// Blend max: max(src, dst).
-		/// </summary>
-		BlendEquationMax       = 0x0000000040000000,
-		BlendEquationShift     = 28,
-		BlendEquationMask      = 0x00000003f0000000,
-	
-		/// <summary>
-		/// Cull clockwise triangles.
-		/// </summary>
-		CullCw                 = 0x0000001000000000,
-	
 		/// <summary>
 		/// Cull counter-clockwise triangles.
 		/// </summary>
@@ -750,6 +529,40 @@ public static partial class bgfx
 		DiscardMask            = 0x1ff8,
 	}
 	
+	[Flags]
+	public enum DiscardFlags : uint
+	{
+		/// <summary>
+		/// Discard only Index Buffer
+		/// </summary>
+		IndexBuffer            = 0x00000001,
+	
+		/// <summary>
+		/// Discard only Vertex Streams
+		/// </summary>
+		VertexStreams          = 0x00000002,
+	
+		/// <summary>
+		/// Discard only texture samplers
+		/// </summary>
+		TextureSamplers        = 0x00000004,
+	
+		/// <summary>
+		/// Discard only Compute shader related state
+		/// </summary>
+		Compute                = 0x00000008,
+	
+		/// <summary>
+		/// Discard only state
+		/// </summary>
+		State                  = 0x00000010,
+	
+		/// <summary>
+		/// Discard every rendering states
+		/// </summary>
+		All                    = 0x0000001f,
+	}
+	
 	[Flags]
 	public enum DebugFlags : uint
 	{

+ 11 - 11
bindings/d/types.d

@@ -75,17 +75,6 @@ enum ulong BGFX_STATE_CULL_CCW = 0x0000002000000000; /// Cull counter-clockwise
 enum ulong BGFX_STATE_CULL_SHIFT = 36; /// Culling mode bit shift
 enum ulong BGFX_STATE_CULL_MASK = 0x0000003000000000; /// Culling mode bit mask
 
-/**
- * Rendering state discard. When state is preserved in submit, rendering states can be discarded
- * on a finer grain.
- */
-enum ubyte BGFX_DISCARD_INDEX_BUFFER = 0x01; /// Discard only Index Buffer
-enum ubyte BGFX_DISCARD_VERTEX_STREAMS = 0x02; /// Discard only Vertex Streams
-enum ubyte BGFX_DISCARD_TEXTURE_SAMPLERS = 0x04; /// Discard only texture samplers
-enum ubyte BGFX_DISCARD_COMPUTE = 0x08; /// Discard only Compute shader related state
-enum ubyte BGFX_DISCARD_STATE = 0x10; /// Discard only state
-enum ubyte BGFX_DISCARD_ALL = 0x1f; /// Discard every rendering states
-
 /// Alpha reference value.
 enum ulong BGFX_STATE_ALPHA_REF_SHIFT = 40; /// Alpha reference bit shift
 enum ulong BGFX_STATE_ALPHA_REF_MASK = 0x0000ff0000000000; /// Alpha reference bit mask
@@ -200,6 +189,17 @@ enum ushort BGFX_CLEAR_DISCARD_STENCIL = 0x1000; /// Discard frame buffer stenci
 enum ushort BGFX_CLEAR_DISCARD_COLOR_MASK = 0x07f8;
 enum ushort BGFX_CLEAR_DISCARD_MASK = 0x1ff8;
 
+/**
+ * Rendering state discard. When state is preserved in submit, rendering states can be discarded
+ * on a finer grain.
+ */
+enum ubyte BGFX_DISCARD_INDEX_BUFFER = 0x01; /// Discard only Index Buffer
+enum ubyte BGFX_DISCARD_VERTEX_STREAMS = 0x02; /// Discard only Vertex Streams
+enum ubyte BGFX_DISCARD_TEXTURE_SAMPLERS = 0x04; /// Discard only texture samplers
+enum ubyte BGFX_DISCARD_COMPUTE = 0x08; /// Discard only Compute shader related state
+enum ubyte BGFX_DISCARD_STATE = 0x10; /// Discard only state
+enum ubyte BGFX_DISCARD_ALL = 0x1f; /// Discard every rendering states
+
 enum uint BGFX_DEBUG_NONE = 0x00000000; /// No debug.
 enum uint BGFX_DEBUG_WIREFRAME = 0x00000001; /// Enable wireframe for all primitives.
 /**

+ 20 - 20
include/bgfx/defines.h

@@ -99,26 +99,6 @@
 #define BGFX_STATE_CULL_SHIFT               36                           //!< Culling mode bit shift
 #define BGFX_STATE_CULL_MASK                UINT64_C(0x0000003000000000) //!< Culling mode bit mask
 
-/**
- * Rendering state discard. When state is preserved in submit, rendering states can be discarded
- * on a finer grain.
- *
- */
-#define BGFX_DISCARD_INDEX_BUFFER           UINT8_C(0x01) //!< Discard only Index Buffer
-#define BGFX_DISCARD_VERTEX_STREAMS         UINT8_C(0x02) //!< Discard only Vertex Streams
-#define BGFX_DISCARD_TEXTURE_SAMPLERS       UINT8_C(0x04) //!< Discard only texture samplers
-#define BGFX_DISCARD_COMPUTE                UINT8_C(0x08) //!< Discard only Compute shader related state
-#define BGFX_DISCARD_STATE                  UINT8_C(0x10) //!< Discard only state
-/// Discard every rendering states
-#define BGFX_DISCARD_ALL (0 \
-	| BGFX_DISCARD_INDEX_BUFFER \
-	| BGFX_DISCARD_VERTEX_STREAMS \
-	| BGFX_DISCARD_TEXTURE_SAMPLERS \
-	| BGFX_DISCARD_COMPUTE \
-	| BGFX_DISCARD_STATE \
-	)
-
-
 /**
  * Alpha reference value.
  *
@@ -273,6 +253,26 @@
 	)
 
 
+/**
+ * Rendering state discard. When state is preserved in submit, rendering states can be discarded
+ * on a finer grain.
+ *
+ */
+#define BGFX_DISCARD_INDEX_BUFFER           UINT8_C(0x01) //!< Discard only Index Buffer
+#define BGFX_DISCARD_VERTEX_STREAMS         UINT8_C(0x02) //!< Discard only Vertex Streams
+#define BGFX_DISCARD_TEXTURE_SAMPLERS       UINT8_C(0x04) //!< Discard only texture samplers
+#define BGFX_DISCARD_COMPUTE                UINT8_C(0x08) //!< Discard only Compute shader related state
+#define BGFX_DISCARD_STATE                  UINT8_C(0x10) //!< Discard only state
+/// Discard every rendering states
+#define BGFX_DISCARD_ALL (0 \
+	| BGFX_DISCARD_INDEX_BUFFER \
+	| BGFX_DISCARD_VERTEX_STREAMS \
+	| BGFX_DISCARD_TEXTURE_SAMPLERS \
+	| BGFX_DISCARD_COMPUTE \
+	| BGFX_DISCARD_STATE \
+	)
+
+
 #define BGFX_DEBUG_NONE                     UINT32_C(0x00000000) //!< No debug.
 #define BGFX_DEBUG_WIREFRAME                UINT32_C(0x00000001) //!< Enable wireframe for all primitives.
 /// Enable infinitely fast hardware test. No draw calls will be submitted to driver.

+ 11 - 11
scripts/bgfx.idl

@@ -83,17 +83,6 @@ flag.StateCull { bits = 64, shift = 36, range = 2, base = 1, desc = "Culling mod
 	.Ccw --- Cull counter-clockwise triangles.
 	()
 
---- Rendering state discard. When state is preserved in submit, rendering states can be discarded
---- on a finer grain.
-flag.Discard { bits = 8, base = 1, desc = "Discard flags" }
-	.IndexBuffer                                                                        --- Discard only Index Buffer
-	.VertexStreams                                                                      --- Discard only Vertex Streams
-	.TextureSamplers                                                                    --- Discard only texture samplers
-	.Compute                                                                            --- Discard only Compute shader related state
-	.State                                                                              --- Discard only state
-	.All { "IndexBuffer", "VertexStreams", "TextureSamplers", "Compute", "State" }      --- Discard every rendering states
-	()
-
 --- Alpha reference value.
 flag.StateAlphaRef { bits = 64, shift = 40, range = 8, desc = "Alpha reference", "helper" }
 
@@ -210,6 +199,17 @@ flag.Clear { bits = 16 }
 		"DiscardStencil"
 	}
 
+--- Rendering state discard. When state is preserved in submit, rendering states can be discarded
+--- on a finer grain.
+flag.Discard { bits = 8, base = 1, desc = "Discard flags" }
+	.IndexBuffer                                                                        --- Discard only Index Buffer
+	.VertexStreams                                                                      --- Discard only Vertex Streams
+	.TextureSamplers                                                                    --- Discard only texture samplers
+	.Compute                                                                            --- Discard only Compute shader related state
+	.State                                                                              --- Discard only state
+	.All { "IndexBuffer", "VertexStreams", "TextureSamplers", "Compute", "State" }      --- Discard every rendering states
+	()
+
 flag.Debug { bits = 32 }
 	.None      --- No debug.
 	.Wireframe --- Enable wireframe for all primitives.