mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-08-31 02:20:04 +02:00
Cull atomics if vbuf is nearly full
This commit is contained in:
12
vendor/librw/src/dc/rwdc.cpp
vendored
12
vendor/librw/src/dc/rwdc.cpp
vendored
@@ -3219,6 +3219,15 @@ void pvr_poly_cxt_txr_fast(pvr_poly_hdr_t *hdr, pvr_list_t list,
|
||||
|
||||
|
||||
|
||||
size_t vertexBufferFree() {
|
||||
size_t end = PVR_GET(PVR_TA_VERTBUF_END);
|
||||
size_t pos = PVR_GET(PVR_TA_VERTBUF_POS);
|
||||
|
||||
size_t free = end - pos;
|
||||
|
||||
return free;
|
||||
}
|
||||
|
||||
|
||||
void defaultRenderCB(ObjPipeline *pipe, Atomic *atomic) {
|
||||
rw::Camera *cam = engine->currentCamera;
|
||||
@@ -3400,6 +3409,9 @@ void defaultRenderCB(ObjPipeline *pipe, Atomic *atomic) {
|
||||
|
||||
// clipping performed per meshlet
|
||||
auto renderCB = [contextId, n] {
|
||||
if (vertexBufferFree() < (128 * 1024)) {
|
||||
return;
|
||||
}
|
||||
const atomic_context_t* acp = &atomicContexts[contextId];
|
||||
auto geo = acp->geo;
|
||||
auto mesh = geo->meshHeader->getMeshes() + n;
|
||||
|
Reference in New Issue
Block a user