瀏覽代碼

RLGL: restore draw batch state after limit check (#2018)

pull/2021/head
mausimus 4 年之前
committed by GitHub
父節點
當前提交
dfbb134bfe
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 7 行新增0 行删除
  1. +7
    -0
      src/rlgl.h

+ 7
- 0
src/rlgl.h 查看文件

@ -2548,8 +2548,15 @@ bool rlCheckRenderBatchLimit(int vCount)
if ((RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter + vCount) >=
(RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementCount*4))
{
int currentMode = RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode;
int currentTexture = RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId;
overflow = true;
rlDrawRenderBatch(RLGL.currentBatch); // NOTE: Stereo rendering is checked inside
// restore state of last batch so we can continue adding vertices
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode = currentMode;
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId = currentTexture;
}
#endif

Loading…
取消
儲存