Repository Analysis

bkaradzic/bgfx

Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.

4.5 Likely human-written View on GitHub
4.5
Adjusted Score
4.5
Raw Score
100%
Time Factor
2026-05-29
Last Push
17,097
Stars
C
Language
1,075,093
Lines of Code
1784
Files
5476
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 0MEDIUM 41LOW 5435

Pattern Findings

5476 matches across 9 categories. Click a row to expand file-level details.

Over-Commented Block5401 hits · 4587 pts
SeverityFileLineSnippet
LOWtools/shaderc/shaderc_hlsl.cpp1/*
LOWtools/shaderc/shaderc.cpp61 {
LOWtools/shaderc/shaderc.cpp81 // 4.3 430 vhdgf+c
LOWtools/shaderc/shaderc.cpp101 // 3.1 | 1.4 | 3114
LOWtools/shaderc/shaderc_wgsl.cpp21#include <spirv_msl.hpp>
LOWtools/shaderc/shaderc_dxil.cpp1/*
LOWtools/shaderc/shaderc.h21# if __has_include(<d3dcompiler.h>)
LOWtools/shaderc/shaderc.h41 || BX_PLATFORM_WINDOWS \
LOWtools/shaderc/shaderc.h61#endif
LOWtools/texturev/texturev.cpp1/*
LOWtools/texturev/texturev.cpp21#include <entry/cmd.h>
LOWtools/geometryv/geometryv.cpp1/*
LOWtools/geometryv/geometryv.cpp21#include <imgui/imgui.h>
LOWinclude/bgfx/defines.h61 * helper macros.
LOWinclude/bgfx/defines.h81 * Use BGFX_STATE_BLEND_EQUATION(_equation) or BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)
LOWinclude/bgfx/defines.h121#define BGFX_STATE_POINT_SIZE_SHIFT 52 //!< Point size bit shift
LOWinclude/bgfx/defines.h161#define BGFX_STENCIL_FUNC_REF_SHIFT 0
LOWinclude/bgfx/defines.h181#define BGFX_STENCIL_TEST_GREATER UINT32_C(0x00050000) //!< Enable stencil test, greater.
LOWinclude/bgfx/defines.h201#define BGFX_STENCIL_OP_FAIL_Z_REPLACE UINT32_C(0x02000000) //!< Replace.
LOWinclude/bgfx/defines.h221#define BGFX_CLEAR_NONE UINT16_C(0x0000) //!< No clear flags.
LOWinclude/bgfx/defines.h261#define BGFX_DISCARD_INSTANCE_DATA UINT8_C(0x04) //!< Discard instance data.
LOWinclude/bgfx/defines.h281#define BGFX_BUFFER_COMPUTE_FORMAT_16X2 UINT16_C(0x0005) //!< 2 x 16-bit values
LOWinclude/bgfx/defines.h301#define BGFX_BUFFER_COMPUTE_READ_WRITE (0 \
LOWinclude/bgfx/defines.h321#define BGFX_TEXTURE_RT_MSAA_MASK UINT64_C(0x0000007000000000)
LOWinclude/bgfx/defines.h341#define BGFX_SAMPLER_V_MASK UINT32_C(0x0000000c)
LOWinclude/bgfx/defines.h361#define BGFX_SAMPLER_MIP_MASK UINT32_C(0x00000400)
LOWinclude/bgfx/defines.h421#define BGFX_RESET_MSAA_X16 UINT32_C(0x00000040) //!< Enable 16x MSAA.
LOWinclude/bgfx/defines.h441
LOWinclude/bgfx/defines.h461#define BGFX_CAPS_INSTANCING UINT64_C(0x0000000000002000) //!< Instancing is supported.
LOWinclude/bgfx/defines.h481#define BGFX_CAPS_VIEWPORT_LAYER_ARRAY UINT64_C(0x0000000200000000) //!< Viewport layer is available in verte
LOWinclude/bgfx/defines.h501#define BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE UINT32_C(0x00000800) //!< Texture format can be used as image and writ
LOWinclude/bgfx/defines.h521#define BGFX_CUBE_MAP_NEGATIVE_X UINT8_C(0x01) //!< Cubemap -x.
LOWinclude/bgfx/bgfx.h141 Int16, //!< Int16
LOWinclude/bgfx/bgfx.h561 /// - `BGFX_CAPS_FORMAT_TEXTURE_3D` - Texture format is supported.
LOWinclude/bgfx/bgfx.h761 /// @attention C99's equivalent binding is `bgfx_attachment_t`.
LOWinclude/bgfx/bgfx.h881 /// @attention C99's equivalent binding is `bgfx_vertex_layout_t`.
LOWinclude/bgfx/bgfx.h901 /// @param[in] _type Element type.
LOWinclude/bgfx/bgfx.h941
LOWinclude/bgfx/bgfx.h961 ///
LOWinclude/bgfx/bgfx.h1001 /// Sets a debug marker. This allows you to group graphics calls together for easy browsing in
LOWinclude/bgfx/bgfx.h1021 /// - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.
LOWinclude/bgfx/bgfx.h1061 /// @param[in] _fstencil Front stencil state.
LOWinclude/bgfx/bgfx.h1081 /// @remarks
LOWinclude/bgfx/bgfx.h1101 ///
LOWinclude/bgfx/bgfx.h1121 ///
LOWinclude/bgfx/bgfx.h1141 /// @attention C99's equivalent binding is `bgfx_encoder_alloc_transform`.
LOWinclude/bgfx/bgfx.h1161 );
LOWinclude/bgfx/bgfx.h1181 );
LOWinclude/bgfx/bgfx.h1201 );
LOWinclude/bgfx/bgfx.h1221 );
LOWinclude/bgfx/bgfx.h1261 );
LOWinclude/bgfx/bgfx.h1281 );
LOWinclude/bgfx/bgfx.h1301 /// of vertex buffer will be used.
LOWinclude/bgfx/bgfx.h1321 ///
LOWinclude/bgfx/bgfx.h1341 , uint32_t _num
LOWinclude/bgfx/bgfx.h1361 /// @param[in] _startVertex First instance data.
LOWinclude/bgfx/bgfx.h1381 void setInstanceCount(uint32_t _numInstances);
LOWinclude/bgfx/bgfx.h1401 , uint32_t _flags = UINT32_MAX
LOWinclude/bgfx/bgfx.h1421 /// @param[in] _program Program.
LOWinclude/bgfx/bgfx.h1441 ///
5341 more matches not shown…
Decorative Section Separators22 hits · 96 pts
SeverityFileLineSnippet
MEDIUM3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py4#------------------------------------------------------------------------------
MEDIUM3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py32#------------------------------------------------------------------------------
MEDIUM3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py58#------------------------------------------------------------------------------
MEDIUM3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py66#------------------------------------------------------------------------------
MEDIUM3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py71#------------------------------------------------------------------------------
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/loop.h47/// ┣━━━━━━━━━━━┓
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/loop.h49/// ┌─────────────────┐ ┃
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/loop.h52/// └─────────────────┘ ┃
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/loop.h54/// ┃◀━━━━━━━━━━┫
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/loop.h56/// ┌─────────────────┐ ┃
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/loop.h58/// ┃ └─────────────────┘ ┃
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/loop.h61/// ┃ ┌─────────────────┐ ┃ BreakIf(false)
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/loop.h64/// ┃ └─────────────────┘
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/loop.h67/// ┗━━━━━━━━━━▶┃
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/switch.h47/// ╌╌╌╌╌╌╌╌┲━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━┱╌╌╌╌╌╌╌╌
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/switch.h49/// ┌────────┐ ┌────────┐ ┌────────┐
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/switch.h51/// └────────┘ └────────┘ └────────┘
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/switch.h54/// ╌╌╌╌╌╌╌╌┺━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━┹╌╌╌╌╌╌╌╌
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/if.h42/// ┏━━━━━━━━━━┻━━━━━━━━━━┓
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/if.h44/// ┌────────────┐ ┌────────────┐
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/if.h47/// └────────────┘ └────────────┘
MEDIUM3rdparty/dawn/src/tint/lang/core/ir/if.h49/// ┗━━━━━━━━━━┳━━━━━━━━━━┛
AI Slop Vocabulary21 hits · 59 pts
SeverityFileLineSnippet
LOWexamples/39-assao/cs_assao_generate_q.sh38#define SSAO_TILT_SAMPLES_ENABLE_AT_QUALITY_PRESET (99) // to disable simply set to 99 or si
LOWexamples/39-assao/cs_assao_generate_q.sh41#define SSAO_HALOING_REDUCTION_ENABLE_AT_QUALITY_PRESET (1) // to disable simply set to 99 or si
LOWexamples/39-assao/cs_assao_generate_q.sh44#define SSAO_NORMAL_BASED_EDGES_ENABLE_AT_QUALITY_PRESET (2) // to disable simply set to 99 or si
LOWexamples/39-assao/cs_assao_generate_q.sh47#define SSAO_DETAIL_AO_ENABLE_AT_QUALITY_PRESET (1) // whether to use DetailAOStrength;
MEDIUMexamples/common/shaderlib.sh379 // https://web.archive.org/web/20190411181934/http://the-witness.net/news/2012/02/seamless-cube-map-filtering/
MEDIUM3rdparty/spirv-cross/spirv_glsl.cpp346 // Sanity check the iteration count to be robust against a certain class of bugs where
MEDIUM3rdparty/spirv-cross/spirv_glsl.cpp12050 // Essentially, we can only remove one set of swizzles, since that's what we have control over ...
MEDIUM3rdparty/spirv-cross/spirv_glsl.cpp12309 // We can look at result type which is more robust.
MEDIUM3rdparty/spirv-cross/spirv_msl.cpp18613 // We don't always use proper type hierarchy for synthesized types, so be robust.
MEDIUM3rdparty/spirv-cross/spirv_cross.cpp4003 // Essentially a map of block -> { variables accessed in the basic block }
MEDIUM3rdparty/spirv-cross/spirv_hlsl.cpp1843 // Sort input and output variables based on, from more robust to less robust:
MEDIUM3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp770// Creates a graphics robust access pass.
MEDIUM3rdparty/spirv-tools/source/diagnostic.cpp92 case SPV_REQUESTED_TERMINATION: // Essentially success.
MEDIUM3rdparty/spirv-tools/source/opt/ir_loader.h33// libspirv.h so that we can leverage the syntax checks implemented behind it.
MEDIUM3rdparty/spirv-tools/source/opt/ccp_pass.h62 // CCP lattice. Essentially, if all the operands in |phi| have the same
MEDIUM3rdparty/glslang/SPIRV/GlslangToSpv.cpp6530 // TODO: It would be more robust to do a full recursive verification of the types satisfying SPIR-V rules.
MEDIUM…rty/glslang/glslang/MachineIndependent/ParseHelper.cpp9859// for the parameter to the constructor (passed to this function). Essentially, it converts
MEDIUM3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp8561// for the parameter to the constructor (passed to this function). Essentially, it converts
MEDIUM3rdparty/dear-imgui/imgui.cpp6675 // FIXME: Essentially we want to restrict manual resizing to WindowMinSize+Decoration, and allow api resizing to be
MEDIUM3rdparty/dear-imgui/imgui.cpp9036// FIXME-NEWATLAS-V2: perhaps we can now leverage ImFontAtlasUpdateDrawListsTextures() ?
MEDIUM…rty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp977 // take precision from it. This isn't fully robust now, but oh well.
Verbosity Indicators17 hits · 28 pts
SeverityFileLineSnippet
LOWexamples/16-shadowmaps/common.sh355 // Step 1: Blocker Search
LOWexamples/16-shadowmaps/common.sh367 // Step 2: Penumbra Estimation (standard PCSS, Fernando 2005)
LOWexamples/16-shadowmaps/common.sh382 // Step 3: Percentage-Closer Filtering
LOWexamples/16-shadowmaps/common.sh387 // Step 4: Edge fade based on blocker ratio
LOW3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp155 // Step 1: Create the if merge block for structured modules.
LOW3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp235 // Step 2: Build a new preheader for |loop_|, use the old one
LOW3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp361 // Step 3: Duplicate |loop_|.
LOW3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp373 // Step 4: Specialize the loop. //
LOW3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp380 // Step 5: Connect convergent edges to the landing pads. //
LOW3rdparty/glslang/SPIRV/SpvBuilder.cpp4320 // Step 2: Construct a matrix from that array.
LOW3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp7773 // Step 1: If there's an exact match, use it.
LOW3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp7776 // Step 3: Re-select after type promotion is applied, to find proper candidate.
LOW3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp7778 // Step 1: If there's an exact match, use it.
LOW3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp7834 // Step 3: Re-select after type promotion, to find proper candidate
LOW3rdparty/dear-imgui/imgui.cpp3371 // Step 0: Let you process the first element (regardless of it being visible or not, so we can measure the element h
LOW3rdparty/dear-imgui/imgui.cpp3388 // Step 1: Let the clipper infer height from first range
LOW…y/dawn/src/tint/lang/core/ir/referenced_module_decls.h148 // For a compute entry point, we need to check if subgroup size or any of the workgroup
Fake / Example Data9 hits · 11 pts
SeverityFileLineSnippet
LOWexamples/20-nanovg/nanovg.cpp1100 const char* text = "This is longer chunk of text.\n \n Would have used lorem ipsum but she was busy jumping over t
LOW3rdparty/dear-imgui/imgui_demo.cpp7572 ImGui::TextWrapped("Lorem ipsum dolor sit amet");
LOW3rdparty/dear-imgui/imgui_demo.cpp7572 ImGui::TextWrapped("Lorem ipsum dolor sit amet");
LOW3rdparty/dear-imgui/imgui_demo.cpp7574 ImGui::Text("Lorem ipsum dolor sit amet");
LOW3rdparty/dear-imgui/imgui_demo.cpp7574 ImGui::Text("Lorem ipsum dolor sit amet");
LOW3rdparty/dear-imgui/imgui_demo.cpp9450 ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i
LOW3rdparty/dear-imgui/imgui_demo.cpp9450 ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i
LOW3rdparty/dear-imgui/imgui_demo.cpp10411 ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
LOW3rdparty/dear-imgui/imgui_demo.cpp10411 ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
Slop Phrases3 hits · 7 pts
SeverityFileLineSnippet
MEDIUMexamples/48-drawindirect/drawindirect.cpp392 // This is done here for demonstration purposes
MEDIUM3rdparty/dear-imgui/imgui_widgets.cpp7351// Tip: pass a non-visible label (e.g. "##hello") then you can use the space to draw other text or image.
LOW3rdparty/dear-imgui/imgui.cpp995 - 2017/08/25 (1.52) - io.MousePos needs to be set to ImVec2(-FLT_MAX,-FLT_MAX) when mouse is unavailable/missing. Previ
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippet
LOW3rdparty/dawn/src/tint/utils/rtti/castable.h418/// Example usage:
Hyper-Verbose Identifiers1 hit · 1 pts
SeverityFileLineSnippet
LOW3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py109 def get_intermediate_representation( cls ):
Excessive Try-Catch Wrapping1 hit · 1 pts
SeverityFileLineSnippet
LOW3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py527 except Exception as e: