Skip to content

Commit

Permalink
Inline "DecodeVertexToPushPool" for ease of change.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Oct 12, 2023
1 parent 12a98ba commit f842f16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
16 changes: 4 additions & 12 deletions GPU/Vulkan/DrawEngineVulkan.cpp
Expand Up @@ -185,17 +185,6 @@ void DrawEngineVulkan::EndFrame() {
stats_.pushIndexSpaceUsed = (int)pushIndex_->GetUsedThisFrame();
}

void DrawEngineVulkan::DecodeVertsToPushPool(VulkanPushPool *push, uint32_t *bindOffset, VkBuffer *vkbuf) {
u8 *dest = decoded_;

// Figure out how much pushbuffer space we need to allocate.
if (push) {
int vertsToDecode = ComputeNumVertsToDecode();
dest = push->Allocate(vertsToDecode * dec_->GetDecVtxFmt().stride, 4, vkbuf, bindOffset);
}
DecodeVerts(dest);
}

void DrawEngineVulkan::DirtyAllUBOs() {
baseUBOOffset = 0;
lightUBOOffset = 0;
Expand Down Expand Up @@ -263,8 +252,11 @@ void DrawEngineVulkan::DoFlush() {
u8 *dest = (u8 *)pushVertex_->Allocate(size, 4, &vbuf, &vbOffset);
memcpy(dest, decoded_, size);
} else {
// Figure out how much pushbuffer space we need to allocate.
int vertsToDecode = ComputeNumVertsToDecode();
// Decode directly into the pushbuffer
DecodeVertsToPushPool(pushVertex_, &vbOffset, &vbuf);
u8 *dest = pushVertex_->Allocate(vertsToDecode * dec_->GetDecVtxFmt().stride, 4, &vbuf, &vbOffset);
DecodeVerts(dest);
}
DecodeInds();

Expand Down
2 changes: 0 additions & 2 deletions GPU/Vulkan/DrawEngineVulkan.h
Expand Up @@ -184,8 +184,6 @@ class DrawEngineVulkan : public DrawEngineCommon {

void DestroyDeviceObjects();

void DecodeVertsToPushPool(VulkanPushPool *push, uint32_t *bindOffset, VkBuffer *vkbuf);

void DoFlush();
void UpdateUBOs();

Expand Down

0 comments on commit f842f16

Please sign in to comment.