瀏覽代碼

Cleanup dicard flags.

Бранимир Караџић 5 年之前
父節點
當前提交
23f9ba6552
共有 4 個文件被更改,包括 11 次插入19 次删除
  1. 1 1
      bindings/cs/bgfx.cs
  2. 1 1
      bindings/d/types.d
  3. 1 9
      include/bgfx/defines.h
  4. 8 8
      scripts/bgfx.idl

+ 1 - 1
bindings/cs/bgfx.cs

@@ -565,7 +565,7 @@ public static partial class bgfx
 		/// <summary>
 		/// Discard every rendering states
 		/// </summary>
-		All                    = 0x0000001f,
+		All                    = 0x000000ff,
 	}
 	
 	[Flags]

+ 1 - 1
bindings/d/types.d

@@ -199,7 +199,7 @@ 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 ubyte BGFX_DISCARD_ALL = 0xff; /// Discard every rendering states
 
 enum uint BGFX_DEBUG_NONE = 0x00000000; /// No debug.
 enum uint BGFX_DEBUG_WIREFRAME = 0x00000001; /// Enable wireframe for all primitives.

+ 1 - 9
include/bgfx/defines.h

@@ -264,15 +264,7 @@
 #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_DISCARD_ALL                    UINT8_C(0xff) //!< Discard every rendering states
 
 #define BGFX_DEBUG_NONE                     UINT32_C(0x00000000) //!< No debug.
 #define BGFX_DEBUG_WIREFRAME                UINT32_C(0x00000001) //!< Enable wireframe for all primitives.

+ 8 - 8
scripts/bgfx.idl

@@ -201,14 +201,14 @@ flag.Clear { bits = 16 }
 
 --- Rendering state discard. When state is preserved in submit, rendering states can be discarded
 --- on a finer grain.
-flag.Discard { bits = 8, desc = "Discard flags" }
-	.None(0)                                                                            --- Discard nothing
-	.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.Discard { bits = 8, const, desc = "Discard flags" }
+	.None            (0x00) --- Discard nothing
+	.IndexBuffer     (0x01) --- Discard only Index Buffer
+	.VertexStreams   (0x02) --- Discard only Vertex Streams
+	.TextureSamplers (0x04) --- Discard only texture samplers
+	.Compute         (0x08) --- Discard only Compute shader related state
+	.State           (0x10) --- Discard only state
+	.All             (0xff) --- Discard every rendering states
 	()
 
 flag.Debug { bits = 32 }