diff --git a/bindings/bf/bgfx.bf b/bindings/bf/bgfx.bf index 8d8b06691..b51d52a90 100644 --- a/bindings/bf/bgfx.bf +++ b/bindings/bf/bgfx.bf @@ -2114,7 +2114,7 @@ public static class bgfx public uint32 reset; public uint8 numBackBuffers; public uint8 maxFrameLatency; - public uint8 scaleDebug; + public uint8 debugTextScale; } [CRepr] diff --git a/bindings/cs/bgfx.cs b/bindings/cs/bgfx.cs index c1b5d994f..f9847b3f2 100644 --- a/bindings/cs/bgfx.cs +++ b/bindings/cs/bgfx.cs @@ -2093,7 +2093,7 @@ public static partial class bgfx public uint reset; public byte numBackBuffers; public byte maxFrameLatency; - public byte scaleDebug; + public byte debugTextScale; } public unsafe struct Init diff --git a/bindings/d/types.d b/bindings/d/types.d index e5d06eb9b..0f7a20273 100644 --- a/bindings/d/types.d +++ b/bindings/d/types.d @@ -18,7 +18,7 @@ enum expandEnum(EnumType, string fqnEnumType = EnumType.stringof) = (){ extern(C) @nogc nothrow: -enum uint BGFX_API_VERSION = 119; +enum uint BGFX_API_VERSION = 120; alias bgfx_view_id_t = ushort; @@ -886,7 +886,7 @@ struct bgfx_resolution_t uint reset; /// Reset parameters. ubyte numBackBuffers; /// Number of back buffers. ubyte maxFrameLatency; /// Maximum frame latency. - ubyte scaleDebug; /// Scale factor for debug view. + ubyte debugTextScale; /// Scale factor for debug text. } /// Configurable runtime limits parameters. diff --git a/bindings/zig/bgfx.zig b/bindings/zig/bgfx.zig index dc854a4f0..cd71c84a0 100644 --- a/bindings/zig/bgfx.zig +++ b/bindings/zig/bgfx.zig @@ -1338,7 +1338,7 @@ pub const Caps = extern struct { reset: u32, numBackBuffers: u8, maxFrameLatency: u8, - scaleDebug: u8, + debugTextScale: u8, }; pub const Init = extern struct { diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h index 1c9feb7fc..2b2694cbc 100644 --- a/include/bgfx/bgfx.h +++ b/include/bgfx/bgfx.h @@ -647,7 +647,7 @@ namespace bgfx uint32_t reset; //!< Reset parameters. uint8_t numBackBuffers; //!< Number of back buffers. uint8_t maxFrameLatency; //!< Maximum frame latency. - uint8_t scaleDebug; //!< Scale factor for debug view. + uint8_t debugTextScale; //!< Scale factor for debug text. }; /// Initialization parameters used by `bgfx::init`. diff --git a/include/bgfx/c99/bgfx.h b/include/bgfx/c99/bgfx.h index 1a6411cd9..df5c6818a 100644 --- a/include/bgfx/c99/bgfx.h +++ b/include/bgfx/c99/bgfx.h @@ -639,7 +639,7 @@ typedef struct bgfx_resolution_s uint32_t reset; /** Reset parameters. */ uint8_t numBackBuffers; /** Number of back buffers. */ uint8_t maxFrameLatency; /** Maximum frame latency. */ - uint8_t scaleDebug; /** Scale factor for debug view. */ + uint8_t debugTextScale; /** Scale factor for debug text. */ } bgfx_resolution_t; diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h index 068fc9cc2..38f12eea2 100644 --- a/include/bgfx/defines.h +++ b/include/bgfx/defines.h @@ -15,7 +15,7 @@ #ifndef BGFX_DEFINES_H_HEADER_GUARD #define BGFX_DEFINES_H_HEADER_GUARD -#define BGFX_API_VERSION UINT32_C(119) +#define BGFX_API_VERSION UINT32_C(120) /** * Color RGB/alpha/depth write. When it's not specified write will be disabled. diff --git a/scripts/bgfx.idl b/scripts/bgfx.idl index 0d4b37595..075c58828 100644 --- a/scripts/bgfx.idl +++ b/scripts/bgfx.idl @@ -1,7 +1,7 @@ -- vim: syntax=lua -- bgfx interface -version(119) +version(120) typedef "bool" typedef "char" @@ -791,7 +791,7 @@ struct.Resolution { ctor } .reset "uint32_t" --- Reset parameters. .numBackBuffers "uint8_t" --- Number of back buffers. .maxFrameLatency "uint8_t" --- Maximum frame latency. - .scaleDebug "uint8_t" --- Scale factor for debug view. + .debugTextScale "uint8_t" --- Scale factor for debug text. --- Configurable runtime limits parameters. struct.Limits { namespace = "Init" } diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 663d8d137..0a7972a1b 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -1895,7 +1895,7 @@ namespace bgfx m_init.resolution.reset &= ~BGFX_RESET_INTERNAL_FORCE; m_init.resolution.numBackBuffers = bx::clamp(_init.resolution.numBackBuffers, 2, BGFX_CONFIG_MAX_BACK_BUFFERS); m_init.resolution.maxFrameLatency = bx::min(_init.resolution.maxFrameLatency, BGFX_CONFIG_MAX_FRAME_LATENCY); - m_init.resolution.scaleDebug = bx::clamp(_init.resolution.scaleDebug, 1, BGFX_CONFIG_MAX_SCALE_DEBUG); + m_init.resolution.debugTextScale = bx::clamp(_init.resolution.debugTextScale, 1, BGFX_CONFIG_DEBUG_TEXT_MAX_SCALE); dump(m_init.resolution); if (true @@ -2032,7 +2032,7 @@ namespace bgfx dumpCaps(); - m_textVideoMemBlitter.init(m_init.resolution.scaleDebug); + m_textVideoMemBlitter.init(m_init.resolution.debugTextScale); m_clearQuad.init(); m_submit->m_transientVb = createTransientVertexBuffer(_init.limits.transientVbSize); @@ -3436,7 +3436,7 @@ namespace bgfx , reset(BGFX_RESET_NONE) , numBackBuffers(2) , maxFrameLatency(0) - , scaleDebug(0) + , debugTextScale(0) { } diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 5a864de06..509312841 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -3250,7 +3250,12 @@ namespace bgfx { BGFX_MUTEX_SCOPE(m_resourceApiLock); - m_submit->m_textVideoMem->resize(_small, (uint16_t)m_init.resolution.width / m_init.resolution.scaleDebug , (uint16_t)m_init.resolution.height / m_init.resolution.scaleDebug ); + const uint8_t debugTextScale = m_init.resolution.debugTextScale; + m_submit->m_textVideoMem->resize( + _small + , (uint16_t)m_init.resolution.width / debugTextScale + , (uint16_t)m_init.resolution.height / debugTextScale + ); m_submit->m_textVideoMem->clear(_attr); } diff --git a/src/config.h b/src/config.h index 8904e7b0b..678d1f5b8 100644 --- a/src/config.h +++ b/src/config.h @@ -195,6 +195,11 @@ # define BGFX_CONFIG_USE_TINYSTL 1 #endif // BGFX_CONFIG_USE_TINYSTL +/// Debug text maximum scale factor. +#ifndef BGFX_CONFIG_DEBUG_TEXT_MAX_SCALE +# define BGFX_CONFIG_DEBUG_TEXT_MAX_SCALE 4 +#endif // BGFX_CONFIG_DEBUG_TEXT_MAX_SCALE + /// Enable nVidia PerfHUD integration. #ifndef BGFX_CONFIG_DEBUG_PERFHUD # define BGFX_CONFIG_DEBUG_PERFHUD 0 @@ -381,10 +386,6 @@ BX_STATIC_ASSERT(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS m # define BGFX_CONFIG_MAX_FRAME_LATENCY 3 #endif // BGFX_CONFIG_MAX_FRAME_LATENCY -#ifndef BGFX_CONFIG_MAX_SCALE_DEBUG -# define BGFX_CONFIG_MAX_SCALE_DEBUG 4 -#endif // BGFX_CONFIG_MAX_SCALE_DEBUG - #ifndef BGFX_CONFIG_PREFER_DISCRETE_GPU // On laptops with integrated and discrete GPU, prefer selection of discrete GPU. // nVidia and AMD, on Windows only. diff --git a/src/version.h b/src/version.h index 37f8c9bb2..660934cd0 100644 --- a/src/version.h +++ b/src/version.h @@ -9,5 +9,5 @@ * */ -#define BGFX_REV_NUMBER 8489 -#define BGFX_REV_SHA1 "121f9dbfb85ccf143d7aa935b8b7b3a44acddb96" +#define BGFX_REV_NUMBER 8495 +#define BGFX_REV_SHA1 "498c34273b59b957504c82fe396595a75dcfb3b0"