diff --git a/bindings/bf/bgfx.bf b/bindings/bf/bgfx.bf
index 76eadf98d..5bcf7eaeb 100644
--- a/bindings/bf/bgfx.bf
+++ b/bindings/bf/bgfx.bf
@@ -1241,50 +1241,50 @@ public static class bgfx
///
TextureFramebuffer = 0x00001000,
- ///
- /// Texture format can be used as MSAA frame buffer.
- ///
- TextureFramebufferMsaa = 0x00002000,
-
///
/// Texture can be sampled as MSAA.
///
- TextureMsaa = 0x00004000,
+ TextureMsaa = 0x00002000,
///
/// Texture format supports auto-generated mips.
///
- TextureMipAutogen = 0x00008000,
+ TextureMipAutogen = 0x00004000,
///
/// Texture format can be used as back buffer format.
///
- TextureBackbuffer = 0x00010000,
+ TextureBackbuffer = 0x00008000,
///
/// Texture format can be used as video decode destination.
///
- TextureVideoDecodeDst = 0x00020000,
+ TextureVideoDecodeDst = 0x00010000,
///
/// Texture format can be used as MSAA frame buffer with 2 samples.
///
- TextureFramebufferMsaaX2 = 0x00040000,
+ TextureFramebufferMsaaX2 = 0x00020000,
///
/// Texture format can be used as MSAA frame buffer with 4 samples.
///
- TextureFramebufferMsaaX4 = 0x00080000,
+ TextureFramebufferMsaaX4 = 0x00040000,
///
/// Texture format can be used as MSAA frame buffer with 8 samples.
///
- TextureFramebufferMsaaX8 = 0x00100000,
+ TextureFramebufferMsaaX8 = 0x00080000,
///
/// Texture format can be used as MSAA frame buffer with 16 samples.
///
- TextureFramebufferMsaaX16 = 0x00200000,
+ TextureFramebufferMsaaX16 = 0x00100000,
+
+ ///
+ /// Texture format can be used as MSAA frame buffer with any sample count.
+ ///
+ TextureFramebufferMsaa = 0x001e0000,
}
[AllowDuplicates]
diff --git a/bindings/c3/bgfx.c3 b/bindings/c3/bgfx.c3
index 7e306947b..63a70dea2 100644
--- a/bindings/c3/bgfx.c3
+++ b/bindings/c3/bgfx.c3
@@ -788,32 +788,32 @@ constdef CapsFormatFlags : inline uint
// Texture format can be used as frame buffer.
TEXTUREFRAMEBUFFER = 0x00001000,
- // Texture format can be used as MSAA frame buffer.
- TEXTUREFRAMEBUFFERMSAA = 0x00002000,
-
// Texture can be sampled as MSAA.
- TEXTUREMSAA = 0x00004000,
+ TEXTUREMSAA = 0x00002000,
// Texture format supports auto-generated mips.
- TEXTUREMIPAUTOGEN = 0x00008000,
+ TEXTUREMIPAUTOGEN = 0x00004000,
// Texture format can be used as back buffer format.
- TEXTUREBACKBUFFER = 0x00010000,
+ TEXTUREBACKBUFFER = 0x00008000,
// Texture format can be used as video decode destination.
- TEXTUREVIDEODECODEDST = 0x00020000,
+ TEXTUREVIDEODECODEDST = 0x00010000,
// Texture format can be used as MSAA frame buffer with 2 samples.
- TEXTUREFRAMEBUFFERMSAAX2 = 0x00040000,
+ TEXTUREFRAMEBUFFERMSAAX2 = 0x00020000,
// Texture format can be used as MSAA frame buffer with 4 samples.
- TEXTUREFRAMEBUFFERMSAAX4 = 0x00080000,
+ TEXTUREFRAMEBUFFERMSAAX4 = 0x00040000,
// Texture format can be used as MSAA frame buffer with 8 samples.
- TEXTUREFRAMEBUFFERMSAAX8 = 0x00100000,
+ TEXTUREFRAMEBUFFERMSAAX8 = 0x00080000,
// Texture format can be used as MSAA frame buffer with 16 samples.
- TEXTUREFRAMEBUFFERMSAAX16 = 0x00200000,
+ TEXTUREFRAMEBUFFERMSAAX16 = 0x00100000,
+
+ // Texture format can be used as MSAA frame buffer with any sample count.
+ TEXTUREFRAMEBUFFERMSAA = 0x001e0000,
}
constdef CapsVideoCodecFlags : inline uint
@@ -1791,8 +1791,10 @@ struct Caps
// and written to.
// - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER` - Texture format can be used as frame
// buffer.
- // - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` - Texture format can be used as MSAA
- // frame buffer.
+ // - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2`, `_X4`, `_X8`, `_X16` - Texture
+ // format can be used as MSAA frame buffer with that many samples. A
+ // `BGFX_TEXTURE_RT_MSAA_X*` request is clamped to the highest one set.
+ // `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` is the mask of all of them.
// - `BGFX_CAPS_FORMAT_TEXTURE_MSAA` - Texture can be sampled as MSAA.
// - `BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN` - Texture format supports auto-generated
// mips.
diff --git a/bindings/cs/bgfx.cs b/bindings/cs/bgfx.cs
index 2a59fb881..dbc536c98 100644
--- a/bindings/cs/bgfx.cs
+++ b/bindings/cs/bgfx.cs
@@ -1240,50 +1240,50 @@ public static partial class bgfx
///
TextureFramebuffer = 0x00001000,
- ///
- /// Texture format can be used as MSAA frame buffer.
- ///
- TextureFramebufferMsaa = 0x00002000,
-
///
/// Texture can be sampled as MSAA.
///
- TextureMsaa = 0x00004000,
+ TextureMsaa = 0x00002000,
///
/// Texture format supports auto-generated mips.
///
- TextureMipAutogen = 0x00008000,
+ TextureMipAutogen = 0x00004000,
///
/// Texture format can be used as back buffer format.
///
- TextureBackbuffer = 0x00010000,
+ TextureBackbuffer = 0x00008000,
///
/// Texture format can be used as video decode destination.
///
- TextureVideoDecodeDst = 0x00020000,
+ TextureVideoDecodeDst = 0x00010000,
///
/// Texture format can be used as MSAA frame buffer with 2 samples.
///
- TextureFramebufferMsaaX2 = 0x00040000,
+ TextureFramebufferMsaaX2 = 0x00020000,
///
/// Texture format can be used as MSAA frame buffer with 4 samples.
///
- TextureFramebufferMsaaX4 = 0x00080000,
+ TextureFramebufferMsaaX4 = 0x00040000,
///
/// Texture format can be used as MSAA frame buffer with 8 samples.
///
- TextureFramebufferMsaaX8 = 0x00100000,
+ TextureFramebufferMsaaX8 = 0x00080000,
///
/// Texture format can be used as MSAA frame buffer with 16 samples.
///
- TextureFramebufferMsaaX16 = 0x00200000,
+ TextureFramebufferMsaaX16 = 0x00100000,
+
+ ///
+ /// Texture format can be used as MSAA frame buffer with any sample count.
+ ///
+ TextureFramebufferMsaa = 0x001e0000,
}
[Flags]
diff --git a/bindings/d/package.d b/bindings/d/package.d
index 42cde0499..de97102ee 100644
--- a/bindings/d/package.d
+++ b/bindings/d/package.d
@@ -579,15 +579,15 @@ enum CapsFormat: CapsFormat_{
textureImageRead = 0x0000_0400, ///Texture format can be used as image and read from.
textureImageWrite = 0x0000_0800, ///Texture format can be used as image and written to.
textureFramebuffer = 0x0000_1000, ///Texture format can be used as frame buffer.
- textureFramebufferMSAA = 0x0000_2000, ///Texture format can be used as MSAA frame buffer.
- textureMSAA = 0x0000_4000, ///Texture can be sampled as MSAA.
- textureMIPAutogen = 0x0000_8000, ///Texture format supports auto-generated mips.
- textureBackbuffer = 0x0001_0000, ///Texture format can be used as back buffer format.
- textureVideoDecodeDst = 0x0002_0000, ///Texture format can be used as video decode destination.
- textureFramebufferMSAAX2 = 0x0004_0000, ///Texture format can be used as MSAA frame buffer with 2 samples.
- textureFramebufferMSAAX4 = 0x0008_0000, ///Texture format can be used as MSAA frame buffer with 4 samples.
- textureFramebufferMSAAX8 = 0x0010_0000, ///Texture format can be used as MSAA frame buffer with 8 samples.
- textureFramebufferMSAAX16 = 0x0020_0000, ///Texture format can be used as MSAA frame buffer with 16 samples.
+ textureMSAA = 0x0000_2000, ///Texture can be sampled as MSAA.
+ textureMIPAutogen = 0x0000_4000, ///Texture format supports auto-generated mips.
+ textureBackbuffer = 0x0000_8000, ///Texture format can be used as back buffer format.
+ textureVideoDecodeDst = 0x0001_0000, ///Texture format can be used as video decode destination.
+ textureFramebufferMSAAX2 = 0x0002_0000, ///Texture format can be used as MSAA frame buffer with 2 samples.
+ textureFramebufferMSAAX4 = 0x0004_0000, ///Texture format can be used as MSAA frame buffer with 4 samples.
+ textureFramebufferMSAAX8 = 0x0008_0000, ///Texture format can be used as MSAA frame buffer with 8 samples.
+ textureFramebufferMSAAX16 = 0x0010_0000, ///Texture format can be used as MSAA frame buffer with 16 samples.
+ textureFramebufferMSAA = 0x001E_0000, ///Texture format can be used as MSAA frame buffer with any sample count.
}
alias CapsVideoCodec_ = uint;
@@ -1270,8 +1270,10 @@ extern(C++, "bgfx") struct Caps{
and written to.
- `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER` - Texture format can be used as frame
buffer.
- - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` - Texture format can be used as MSAA
- frame buffer.
+ - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2`, `_X4`, `_X8`, `_X16` - Texture
+ format can be used as MSAA frame buffer with that many samples. A
+ `BGFX_TEXTURE_RT_MSAA_X*` request is clamped to the highest one set.
+ `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` is the mask of all of them.
- `BGFX_CAPS_FORMAT_TEXTURE_MSAA` - Texture can be sampled as MSAA.
- `BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN` - Texture format supports auto-generated
mips.
diff --git a/bindings/java/io/github/bkaradzic/bgfx/Bgfx.java b/bindings/java/io/github/bkaradzic/bgfx/Bgfx.java
index fc336d5b5..094a87675 100644
--- a/bindings/java/io/github/bkaradzic/bgfx/Bgfx.java
+++ b/bindings/java/io/github/bkaradzic/bgfx/Bgfx.java
@@ -5039,50 +5039,50 @@ public final class Bgfx {
*/
public static final int TextureFramebuffer = 0x00001000;
- /**
- * Texture format can be used as MSAA frame buffer.
- */
- public static final int TextureFramebufferMsaa = 0x00002000;
-
/**
* Texture can be sampled as MSAA.
*/
- public static final int TextureMsaa = 0x00004000;
+ public static final int TextureMsaa = 0x00002000;
/**
* Texture format supports auto-generated mips.
*/
- public static final int TextureMipAutogen = 0x00008000;
+ public static final int TextureMipAutogen = 0x00004000;
/**
* Texture format can be used as back buffer format.
*/
- public static final int TextureBackbuffer = 0x00010000;
+ public static final int TextureBackbuffer = 0x00008000;
/**
* Texture format can be used as video decode destination.
*/
- public static final int TextureVideoDecodeDst = 0x00020000;
+ public static final int TextureVideoDecodeDst = 0x00010000;
/**
* Texture format can be used as MSAA frame buffer with 2 samples.
*/
- public static final int TextureFramebufferMsaaX2 = 0x00040000;
+ public static final int TextureFramebufferMsaaX2 = 0x00020000;
/**
* Texture format can be used as MSAA frame buffer with 4 samples.
*/
- public static final int TextureFramebufferMsaaX4 = 0x00080000;
+ public static final int TextureFramebufferMsaaX4 = 0x00040000;
/**
* Texture format can be used as MSAA frame buffer with 8 samples.
*/
- public static final int TextureFramebufferMsaaX8 = 0x00100000;
+ public static final int TextureFramebufferMsaaX8 = 0x00080000;
/**
* Texture format can be used as MSAA frame buffer with 16 samples.
*/
- public static final int TextureFramebufferMsaaX16 = 0x00200000;
+ public static final int TextureFramebufferMsaaX16 = 0x00100000;
+
+ /**
+ * Texture format can be used as MSAA frame buffer with any sample count.
+ */
+ public static final int TextureFramebufferMsaa = 0x001e0000;
}
/**
@@ -7019,8 +7019,10 @@ public final class Bgfx {
* and written to.
* - {@code BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER} - Texture format can be used as frame
* buffer.
- * - {@code BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA} - Texture format can be used as MSAA
- * frame buffer.
+ * - {@code BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2}, {@code _X4}, {@code _X8}, {@code _X16} - Texture
+ * format can be used as MSAA frame buffer with that many samples. A
+ * {@code BGFX_TEXTURE_RT_MSAA_X*} request is clamped to the highest one set.
+ * {@code BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA} is the mask of all of them.
* - {@code BGFX_CAPS_FORMAT_TEXTURE_MSAA} - Texture can be sampled as MSAA.
* - {@code BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN} - Texture format supports auto-generated
* mips.
diff --git a/bindings/py/bgfx.py b/bindings/py/bgfx.py
index b63f6cd99..1f38d0405 100644
--- a/bindings/py/bgfx.py
+++ b/bindings/py/bgfx.py
@@ -604,15 +604,15 @@ class CapsFormatFlags(enum.IntFlag):
TextureImageRead = 0x400
TextureImageWrite = 0x800
TextureFramebuffer = 0x1000
- TextureFramebufferMsaa = 0x2000
- TextureMsaa = 0x4000
- TextureMipAutogen = 0x8000
- TextureBackbuffer = 0x10000
- TextureVideoDecodeDst = 0x20000
- TextureFramebufferMsaaX2 = 0x40000
- TextureFramebufferMsaaX4 = 0x80000
- TextureFramebufferMsaaX8 = 0x100000
- TextureFramebufferMsaaX16 = 0x200000
+ TextureMsaa = 0x2000
+ TextureMipAutogen = 0x4000
+ TextureBackbuffer = 0x8000
+ TextureVideoDecodeDst = 0x10000
+ TextureFramebufferMsaaX2 = 0x20000
+ TextureFramebufferMsaaX4 = 0x40000
+ TextureFramebufferMsaaX8 = 0x80000
+ TextureFramebufferMsaaX16 = 0x100000
+ TextureFramebufferMsaa = 0x1e0000
class CapsVideoCodecFlags(enum.IntFlag):
None_ = 0x0
diff --git a/bindings/py/bgfx.pyi b/bindings/py/bgfx.pyi
index 92d94dfd0..c5d64d282 100644
--- a/bindings/py/bgfx.pyi
+++ b/bindings/py/bgfx.pyi
@@ -1116,24 +1116,24 @@ class CapsFormatFlags(enum.IntFlag):
TextureImageWrite = 0x800
# Texture format can be used as frame buffer.
TextureFramebuffer = 0x1000
- # Texture format can be used as MSAA frame buffer.
- TextureFramebufferMsaa = 0x2000
# Texture can be sampled as MSAA.
- TextureMsaa = 0x4000
+ TextureMsaa = 0x2000
# Texture format supports auto-generated mips.
- TextureMipAutogen = 0x8000
+ TextureMipAutogen = 0x4000
# Texture format can be used as back buffer format.
- TextureBackbuffer = 0x10000
+ TextureBackbuffer = 0x8000
# Texture format can be used as video decode destination.
- TextureVideoDecodeDst = 0x20000
+ TextureVideoDecodeDst = 0x10000
# Texture format can be used as MSAA frame buffer with 2 samples.
- TextureFramebufferMsaaX2 = 0x40000
+ TextureFramebufferMsaaX2 = 0x20000
# Texture format can be used as MSAA frame buffer with 4 samples.
- TextureFramebufferMsaaX4 = 0x80000
+ TextureFramebufferMsaaX4 = 0x40000
# Texture format can be used as MSAA frame buffer with 8 samples.
- TextureFramebufferMsaaX8 = 0x100000
+ TextureFramebufferMsaaX8 = 0x80000
# Texture format can be used as MSAA frame buffer with 16 samples.
- TextureFramebufferMsaaX16 = 0x200000
+ TextureFramebufferMsaaX16 = 0x100000
+ # Texture format can be used as MSAA frame buffer with any sample count.
+ TextureFramebufferMsaa = 0x1e0000
class CapsVideoCodecFlags(enum.IntFlag):
# Video codec is not supported.
@@ -1349,8 +1349,10 @@ class Caps(ctypes.Structure):
# and written to.
# - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER` - Texture format can be used as frame
# buffer.
- # - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` - Texture format can be used as MSAA
- # frame buffer.
+ # - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2`, `_X4`, `_X8`, `_X16` - Texture
+ # format can be used as MSAA frame buffer with that many samples. A
+ # `BGFX_TEXTURE_RT_MSAA_X*` request is clamped to the highest one set.
+ # `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` is the mask of all of them.
# - `BGFX_CAPS_FORMAT_TEXTURE_MSAA` - Texture can be sampled as MSAA.
# - `BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN` - Texture format supports auto-generated
# mips.
diff --git a/bindings/zig/bgfx.zig b/bindings/zig/bgfx.zig
index bbedc9a11..de5a59592 100644
--- a/bindings/zig/bgfx.zig
+++ b/bindings/zig/bgfx.zig
@@ -766,32 +766,32 @@ pub const CapsFormatFlags_TextureImageWrite: CapsFormatFlags = 0x00000800;
/// Texture format can be used as frame buffer.
pub const CapsFormatFlags_TextureFramebuffer: CapsFormatFlags = 0x00001000;
-/// Texture format can be used as MSAA frame buffer.
-pub const CapsFormatFlags_TextureFramebufferMsaa: CapsFormatFlags = 0x00002000;
-
/// Texture can be sampled as MSAA.
-pub const CapsFormatFlags_TextureMsaa: CapsFormatFlags = 0x00004000;
+pub const CapsFormatFlags_TextureMsaa: CapsFormatFlags = 0x00002000;
/// Texture format supports auto-generated mips.
-pub const CapsFormatFlags_TextureMipAutogen: CapsFormatFlags = 0x00008000;
+pub const CapsFormatFlags_TextureMipAutogen: CapsFormatFlags = 0x00004000;
/// Texture format can be used as back buffer format.
-pub const CapsFormatFlags_TextureBackbuffer: CapsFormatFlags = 0x00010000;
+pub const CapsFormatFlags_TextureBackbuffer: CapsFormatFlags = 0x00008000;
/// Texture format can be used as video decode destination.
-pub const CapsFormatFlags_TextureVideoDecodeDst: CapsFormatFlags = 0x00020000;
+pub const CapsFormatFlags_TextureVideoDecodeDst: CapsFormatFlags = 0x00010000;
/// Texture format can be used as MSAA frame buffer with 2 samples.
-pub const CapsFormatFlags_TextureFramebufferMsaaX2: CapsFormatFlags = 0x00040000;
+pub const CapsFormatFlags_TextureFramebufferMsaaX2: CapsFormatFlags = 0x00020000;
/// Texture format can be used as MSAA frame buffer with 4 samples.
-pub const CapsFormatFlags_TextureFramebufferMsaaX4: CapsFormatFlags = 0x00080000;
+pub const CapsFormatFlags_TextureFramebufferMsaaX4: CapsFormatFlags = 0x00040000;
/// Texture format can be used as MSAA frame buffer with 8 samples.
-pub const CapsFormatFlags_TextureFramebufferMsaaX8: CapsFormatFlags = 0x00100000;
+pub const CapsFormatFlags_TextureFramebufferMsaaX8: CapsFormatFlags = 0x00080000;
/// Texture format can be used as MSAA frame buffer with 16 samples.
-pub const CapsFormatFlags_TextureFramebufferMsaaX16: CapsFormatFlags = 0x00200000;
+pub const CapsFormatFlags_TextureFramebufferMsaaX16: CapsFormatFlags = 0x00100000;
+
+/// Texture format can be used as MSAA frame buffer with any sample count.
+pub const CapsFormatFlags_TextureFramebufferMsaa: CapsFormatFlags = 0x001e0000;
pub const CapsVideoCodecFlags = u32;
/// Video codec is not supported.
diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h
index 6b2b91ca3..8dbe2670c 100644
--- a/include/bgfx/bgfx.h
+++ b/include/bgfx/bgfx.h
@@ -669,17 +669,16 @@ namespace bgfx
/// and written to.
/// - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER` - Texture format can be used as frame
/// buffer.
- /// - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` - Texture format can be used as MSAA
- /// frame buffer.
+ /// - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2`, `_X4`, `_X8`, `_X16` - Texture
+ /// format can be used as MSAA frame buffer with that many samples. A
+ /// `BGFX_TEXTURE_RT_MSAA_X*` request is clamped to the highest one set.
+ /// `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` is the mask of all of them.
/// - `BGFX_CAPS_FORMAT_TEXTURE_MSAA` - Texture can be sampled as MSAA.
/// - `BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN` - Texture format supports auto-generated
/// mips.
/// - `BGFX_CAPS_FORMAT_TEXTURE_BACKBUFFER` - Texture format can be used as back buffer format.
/// - `BGFX_CAPS_FORMAT_TEXTURE_VIDEO_DECODE_DST` - Texture format can be used as video
/// decode destination.
- /// - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2`, `_X4`, `_X8`, `_X16` - Texture
- /// format can be used as MSAA frame buffer with that many samples. A
- /// `BGFX_TEXTURE_RT_MSAA_X*` request is clamped to the highest one set.
uint32_t codecs[VideoCodec::Count]; //!< Supported video codec capabilities flags. A non-zero entry means the codec is
/// supported for hardware decode; bits describe sample depths and chroma
/// subsamplings:
diff --git a/include/bgfx/c99/bgfx.h b/include/bgfx/c99/bgfx.h
index da817174c..312e3296d 100644
--- a/include/bgfx/c99/bgfx.h
+++ b/include/bgfx/c99/bgfx.h
@@ -740,8 +740,10 @@ typedef struct bgfx_caps_s
* and written to.
* - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER` - Texture format can be used as frame
* buffer.
- * - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` - Texture format can be used as MSAA
- * frame buffer.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2`, `_X4`, `_X8`, `_X16` - Texture
+ * format can be used as MSAA frame buffer with that many samples. A
+ * `BGFX_TEXTURE_RT_MSAA_X*` request is clamped to the highest one set.
+ * `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` is the mask of all of them.
* - `BGFX_CAPS_FORMAT_TEXTURE_MSAA` - Texture can be sampled as MSAA.
* - `BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN` - Texture format supports auto-generated
* mips.
diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h
index f9b23e86e..432effa19 100644
--- a/include/bgfx/defines.h
+++ b/include/bgfx/defines.h
@@ -519,15 +519,22 @@
#define BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ UINT32_C(0x00000400) //!< Texture format can be used as image and read from.
#define BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE UINT32_C(0x00000800) //!< Texture format can be used as image and written to.
#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER UINT32_C(0x00001000) //!< Texture format can be used as frame buffer.
-#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA UINT32_C(0x00002000) //!< Texture format can be used as MSAA frame buffer.
-#define BGFX_CAPS_FORMAT_TEXTURE_MSAA UINT32_C(0x00004000) //!< Texture can be sampled as MSAA.
-#define BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN UINT32_C(0x00008000) //!< Texture format supports auto-generated mips.
-#define BGFX_CAPS_FORMAT_TEXTURE_BACKBUFFER UINT32_C(0x00010000) //!< Texture format can be used as back buffer format.
-#define BGFX_CAPS_FORMAT_TEXTURE_VIDEO_DECODE_DST UINT32_C(0x00020000) //!< Texture format can be used as video decode destination.
-#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2 UINT32_C(0x00040000) //!< Texture format can be used as MSAA frame buffer with 2 samples.
-#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X4 UINT32_C(0x00080000) //!< Texture format can be used as MSAA frame buffer with 4 samples.
-#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X8 UINT32_C(0x00100000) //!< Texture format can be used as MSAA frame buffer with 8 samples.
-#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X16 UINT32_C(0x00200000) //!< Texture format can be used as MSAA frame buffer with 16 samples.
+#define BGFX_CAPS_FORMAT_TEXTURE_MSAA UINT32_C(0x00002000) //!< Texture can be sampled as MSAA.
+#define BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN UINT32_C(0x00004000) //!< Texture format supports auto-generated mips.
+#define BGFX_CAPS_FORMAT_TEXTURE_BACKBUFFER UINT32_C(0x00008000) //!< Texture format can be used as back buffer format.
+#define BGFX_CAPS_FORMAT_TEXTURE_VIDEO_DECODE_DST UINT32_C(0x00010000) //!< Texture format can be used as video decode destination.
+#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2 UINT32_C(0x00020000) //!< Texture format can be used as MSAA frame buffer with 2 samples.
+#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X4 UINT32_C(0x00040000) //!< Texture format can be used as MSAA frame buffer with 4 samples.
+#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X8 UINT32_C(0x00080000) //!< Texture format can be used as MSAA frame buffer with 8 samples.
+#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X16 UINT32_C(0x00100000) //!< Texture format can be used as MSAA frame buffer with 16 samples.
+/// Texture format can be used as MSAA frame buffer with any sample count.
+#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA (0 \
+ | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2 \
+ | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X4 \
+ | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X8 \
+ | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X16 \
+ )
+
#define BGFX_CAPS_VIDEO_CODEC_NONE UINT32_C(0x00000000) //!< Video codec is not supported.
#define BGFX_CAPS_VIDEO_CODEC_BIT_8 UINT32_C(0x00000001) //!< 8-bit sample depth is supported.
diff --git a/scripts/bgfx.idl b/scripts/bgfx.idl
index 4dd47d187..b626bb296 100644
--- a/scripts/bgfx.idl
+++ b/scripts/bgfx.idl
@@ -432,7 +432,6 @@ flag.CapsFormat { bits = 32 }
.TextureImageRead --- Texture format can be used as image and read from.
.TextureImageWrite --- Texture format can be used as image and written to.
.TextureFramebuffer --- Texture format can be used as frame buffer.
- .TextureFramebufferMsaa --- Texture format can be used as MSAA frame buffer.
.TextureMsaa --- Texture can be sampled as MSAA.
.TextureMipAutogen --- Texture format supports auto-generated mips.
.TextureBackbuffer --- Texture format can be used as back buffer format.
@@ -441,6 +440,12 @@ flag.CapsFormat { bits = 32 }
.TextureFramebufferMsaaX4 --- Texture format can be used as MSAA frame buffer with 4 samples.
.TextureFramebufferMsaaX8 --- Texture format can be used as MSAA frame buffer with 8 samples.
.TextureFramebufferMsaaX16 --- Texture format can be used as MSAA frame buffer with 16 samples.
+ .TextureFramebufferMsaa {
+ "TextureFramebufferMsaaX2",
+ "TextureFramebufferMsaaX4",
+ "TextureFramebufferMsaaX8",
+ "TextureFramebufferMsaaX16"
+ } --- Texture format can be used as MSAA frame buffer with any sample count.
()
flag.CapsVideoCodec { bits = 32 }
@@ -899,8 +904,10 @@ struct.Caps { section = "Capabilities" }
--- and written to.
--- - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER` - Texture format can be used as frame
--- buffer.
- --- - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` - Texture format can be used as MSAA
- --- frame buffer.
+ --- - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2`, `_X4`, `_X8`, `_X16` - Texture
+ --- format can be used as MSAA frame buffer with that many samples. A
+ --- `BGFX_TEXTURE_RT_MSAA_X*` request is clamped to the highest one set.
+ --- `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` is the mask of all of them.
--- - `BGFX_CAPS_FORMAT_TEXTURE_MSAA` - Texture can be sampled as MSAA.
--- - `BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN` - Texture format supports auto-generated
--- mips.
diff --git a/src/bgfx.cpp b/src/bgfx.cpp
index f4f692372..a80e7460f 100644
--- a/src/bgfx.cpp
+++ b/src/bgfx.cpp
@@ -2146,46 +2146,52 @@ namespace bgfx
BX_TRACE("");
BX_TRACE("Supported texture formats:");
- BX_TRACE("\t +----------------- 2D: x = supported / * = emulated");
- BX_TRACE("\t |+---------------- 2D: sRGB format");
- BX_TRACE("\t ||+--------------- 3D: x = supported / * = emulated");
- BX_TRACE("\t |||+-------------- 3D: sRGB format");
- BX_TRACE("\t ||||+------------- Cube: x = supported / * = emulated");
- BX_TRACE("\t |||||+------------ Cube: sRGB format");
- BX_TRACE("\t ||||||+----------- Vertex format");
- BX_TRACE("\t |||||||+---------- Image: i = read-write / r = read / w = write");
- BX_TRACE("\t ||||||||+--------- Framebuffer");
- BX_TRACE("\t |||||||||+-------- MSAA framebuffer");
- BX_TRACE("\t ||||||||||+------- MSAA texture");
- BX_TRACE("\t |||||||||||+------ Auto-generated mips");
- BX_TRACE("\t ||||||||||||+----- Back-buffer");
- BX_TRACE("\t ||||||||||||| +-- name");
+ BX_TRACE("\t +-------------------- 2D: x = supported / * = emulated");
+ BX_TRACE("\t |+------------------- 2D: sRGB format");
+ BX_TRACE("\t ||+------------------ 3D: x = supported / * = emulated");
+ BX_TRACE("\t |||+----------------- 3D: sRGB format");
+ BX_TRACE("\t ||||+---------------- Cube: x = supported / * = emulated");
+ BX_TRACE("\t |||||+--------------- Cube: sRGB format");
+ BX_TRACE("\t ||||||+-------------- Vertex format");
+ BX_TRACE("\t |||||||+------------- Image: i = read-write / r = read / w = write");
+ BX_TRACE("\t ||||||||+------------ Framebuffer");
+ BX_TRACE("\t |||||||||+----------- MSAA framebuffer: 2 = 2x samples");
+ BX_TRACE("\t ||||||||||+---------- MSAA framebuffer: 4 = 4x samples");
+ BX_TRACE("\t |||||||||||+--------- MSAA framebuffer: 8 = 8x samples");
+ BX_TRACE("\t ||||||||||||+-------- MSAA framebuffer: G = 16x samples");
+ BX_TRACE("\t |||||||||||||+------- MSAA texture");
+ BX_TRACE("\t ||||||||||||||+------ Auto-generated mips");
+ BX_TRACE("\t |||||||||||||||+----- Back-buffer");
+ BX_TRACE("\t |||||||||||||||| +-- name");
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
{
if (TextureFormat::Unknown != ii
&& TextureFormat::UnknownDepth != ii)
{
uint32_t flags = g_caps.formats[ii];
- BX_TRACE("\t[%c%c%c%c%c%c%c%c%c%c%c%c%c] %s"
- , flags & BGFX_CAPS_FORMAT_TEXTURE_2D ? 'x'
- : flags & BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED ? '*' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB ? 'l' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_3D ? 'x'
- : flags & BGFX_CAPS_FORMAT_TEXTURE_3D_EMULATED ? '*' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB ? 'l' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_CUBE ? 'x'
- : flags & BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED ? '*' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB ? 'l' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_VERTEX ? 'v' : ' '
+ BX_TRACE("\t[%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c] %s"
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_2D ? 'x'
+ : flags & BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED ? '*' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB ? 'l' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_3D ? 'x'
+ : flags & BGFX_CAPS_FORMAT_TEXTURE_3D_EMULATED ? '*' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB ? 'l' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_CUBE ? 'x'
+ : flags & BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED ? '*' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB ? 'l' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_VERTEX ? 'v' : ' '
, (flags & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ) &&
- (flags & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE) ? 'i'
- : flags & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ ? 'r'
- : flags & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE ? 'w' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER ? 'f' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA ? '+' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_MSAA ? 'm' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN ? 'M' : ' '
- , flags & BGFX_CAPS_FORMAT_TEXTURE_BACKBUFFER ? 'b' : ' '
+ (flags & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE) ? 'i'
+ : flags & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ ? 'r'
+ : flags & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE ? 'w' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER ? 'f' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2 ? '2' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X4 ? '4' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X8 ? '8' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X16 ? 'G' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_MSAA ? 'm' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN ? 'M' : ' '
+ , flags & BGFX_CAPS_FORMAT_TEXTURE_BACKBUFFER ? 'b' : ' '
, getName(TextureFormat::Enum(ii) )
);
BX_UNUSED(flags);
@@ -2648,20 +2654,6 @@ namespace bgfx
g_caps.formats[ii] |= 0 == (g_caps.formats[ii] & BGFX_CAPS_FORMAT_TEXTURE_CUBE) && convertable ? BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED : 0;
}
- for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
- {
- uint32_t& formatCaps = g_caps.formats[ii];
-
- if (0 == (formatCaps & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA) )
- {
- formatCaps &= ~kCapsFormatTextureFramebufferMsaaMask;
- }
- else if (0 == (formatCaps & kCapsFormatTextureFramebufferMsaaMask) )
- {
- formatCaps |= kCapsFormatTextureFramebufferMsaaMask;
- }
- }
-
g_caps.rendererType = m_renderCtx->getRendererType();
initAttribTypeSizeTable(g_caps.rendererType);
diff --git a/src/bgfx_p.h b/src/bgfx_p.h
index 175482074..b0839d8ac 100644
--- a/src/bgfx_p.h
+++ b/src/bgfx_p.h
@@ -3000,13 +3000,6 @@ namespace bgfx
int16_t m_refCount;
};
- constexpr uint32_t kCapsFormatTextureFramebufferMsaaMask = 0
- | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2
- | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X4
- | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X8
- | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X16
- ;
-
inline uint64_t clampTextureMsaa(TextureFormat::Enum _format, uint64_t _flags)
{
const uint32_t rt = uint32_t( (_flags & BGFX_TEXTURE_RT_MSAA_MASK) >> BGFX_TEXTURE_RT_MSAA_SHIFT);
diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp
index a6d286aa2..71036b835 100644
--- a/src/renderer_d3d11.cpp
+++ b/src/renderer_d3d11.cpp
@@ -1497,6 +1497,8 @@ namespace bgfx { namespace d3d11
if (0 != (support & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA) )
{
+ support &= ~BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA;
+
for (uint32_t jj = 1; jj < BX_COUNTOF(s_checkMsaa); ++jj)
{
UINT quality = 0;
@@ -1508,11 +1510,6 @@ namespace bgfx { namespace d3d11
support |= BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2 << (jj - 1);
}
}
-
- if (0 == (support & kCapsFormatTextureFramebufferMsaaMask) )
- {
- support &= ~BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA;
- }
}
if (0 != (support & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ) )
diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp
index 671147b0d..889467b80 100644
--- a/src/renderer_d3d12.cpp
+++ b/src/renderer_d3d12.cpp
@@ -1937,6 +1937,8 @@ namespace bgfx { namespace d3d12
if (0 != (support & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA) )
{
+ support &= ~BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA;
+
for (uint32_t jj = 1; jj < BX_COUNTOF(s_checkMsaa); ++jj)
{
D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS msaaData =
@@ -1954,11 +1956,6 @@ namespace bgfx { namespace d3d12
support |= BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X2 << (jj - 1);
}
}
-
- if (0 == (support & kCapsFormatTextureFramebufferMsaaMask) )
- {
- support &= ~BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA;
- }
}
if (0 != (support & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ) )
diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp
index c0eace460..720696a9e 100644
--- a/src/renderer_gl.cpp
+++ b/src/renderer_gl.cpp
@@ -2773,11 +2773,6 @@ namespace bgfx { namespace gl
}
}
- supported |= 0 != (supported & kCapsFormatTextureFramebufferMsaaMask)
- ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA
- : BGFX_CAPS_FORMAT_TEXTURE_NONE
- ;
-
if (m_textureMultisampleSupport)
{
GLint maxSamples = 0;
diff --git a/src/renderer_mtl.cpp b/src/renderer_mtl.cpp
index a6ec0ba98..b8c94bc12 100644
--- a/src/renderer_mtl.cpp
+++ b/src/renderer_mtl.cpp
@@ -1151,8 +1151,8 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames
if (0 != (formatCaps & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA) )
{
+ formatCaps &= ~BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA;
formatCaps |= msaaCaps;
- formatCaps &= 0 != msaaCaps ? UINT32_MAX : ~BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA;
}
g_caps.formats[ii] = formatCaps;
diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp
index cd20dfe10..69fa5c5fd 100644
--- a/src/renderer_vk.cpp
+++ b/src/renderer_vk.cpp
@@ -2238,10 +2238,7 @@ VK_IMPORT_INSTANCE
if (it.usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) )
{
- support |= 0
- | BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN
- | (multisample ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA : 0)
- ;
+ support |= BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN;
for (uint32_t kk = 1; kk < BX_COUNTOF(s_msaa); ++kk)
{
@@ -9696,7 +9693,7 @@ VK_DESTROY
const uint64_t textureFlags = (uint64_t(samplerIndex + 1) << BGFX_TEXTURE_RT_MSAA_SHIFT) | BGFX_TEXTURE_RT | BGFX_TEXTURE_RT_WRITE_ONLY;
m_sampler = s_msaa[samplerIndex];
- const uint16_t requiredCaps = m_sampler.Count > 1
+ const uint32_t requiredCaps = m_sampler.Count > 1
? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA
: BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER
;
diff --git a/src/renderer_webgpu.cpp b/src/renderer_webgpu.cpp
index ebb1d9f56..3ef5a0046 100644
--- a/src/renderer_webgpu.cpp
+++ b/src/renderer_webgpu.cpp
@@ -723,8 +723,7 @@ namespace bgfx { namespace wgpu
if (multisample)
{
- caps |= BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA
- | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X4
+ caps |= BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA_X4
| BGFX_CAPS_FORMAT_TEXTURE_MSAA
;
}