Skip to content

Commit

Permalink
Comment on possible optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jul 31, 2023
1 parent 08609a9 commit 6507890
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions GPU/Common/DrawEngineCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@ void DrawEngineCommon::UpdatePlanes() {
// It does the simplest and safest test possible: If all points of a bbox is outside a single of
// our clipping planes, we reject the box. Tighter bounds would be desirable but would take more calculations.
// The name is a slight misnomer, because any bounding shape will work, not just boxes.
//
// Potential optimizations:
// * SIMD-ify the plane culling, and also the vertex data conversion (could even group together xxxxyyyyzzzz for example)
// * Compute min/max of the verts, and then compute a bounding sphere and check that against the planes.
// - Less accurate, but..
// - Only requires six plane evaluations then.

bool DrawEngineCommon::TestBoundingBox(const void *vdata, const void *inds, int vertexCount, u32 vertType) {
// Grab temp buffer space from large offsets in decoded_. Not exactly safe for large draws.
if (vertexCount > 1024) {
Expand Down

0 comments on commit 6507890

Please sign in to comment.