softgpu: Small optimization to clut updates.

This commit is contained in:
Unknown W. Brackets 2023-04-16 10:15:42 -07:00
parent e766f11f2b
commit 59fb374c38
2 changed files with 5 additions and 3 deletions

View File

@ -368,8 +368,9 @@ void BinManager::UpdateClut(const void *src) {
PROFILE_THIS_SCOPE("bin_clut");
if (cluts_.Full())
Flush("cluts");
clutIndex_ = (uint16_t)cluts_.Push(BinClut());
memcpy(cluts_[clutIndex_].readable, src, sizeof(BinClut));
BinClut &clut = cluts_.PeekPush();
memcpy(clut.readable, src, sizeof(BinClut));
clutIndex_ = (uint16_t)cluts_.PushPeeked();
}
void BinManager::AddTriangle(const VertexData &v0, const VertexData &v1, const VertexData &v2) {

View File

@ -117,11 +117,12 @@ struct BinQueue {
return items_[tail_];
}
void PushPeeked() {
size_t PushPeeked() {
size_t i = tail_++;
if (i + 1 == N)
tail_ -= N;
size_++;
return i;
}
size_t Size() const {