mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Use thin3d's push pool in the draw engine too.
This commit is contained in:
parent
23fe57e774
commit
9fcd6d6612
4 changed files with 9 additions and 10 deletions
|
@ -349,9 +349,11 @@ void VulkanPushPool::NextBlock(VkDeviceSize allocationSize) {
|
||||||
curBlockIndex_++;
|
curBlockIndex_++;
|
||||||
while (curBlockIndex_ < blocks_.size()) {
|
while (curBlockIndex_ < blocks_.size()) {
|
||||||
Block &block = blocks_[curBlockIndex_];
|
Block &block = blocks_[curBlockIndex_];
|
||||||
if (block.frameIndex == curFrameIndex) {
|
// Grab the first matching block, or unused block (frameIndex == -1).
|
||||||
|
if ((block.frameIndex == curFrameIndex || block.frameIndex == -1) && block.size >= allocationSize) {
|
||||||
_assert_(block.used == 0);
|
_assert_(block.used == 0);
|
||||||
block.used = allocationSize;
|
block.used = allocationSize;
|
||||||
|
block.frameIndex = curFrameIndex;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
curBlockIndex_++;
|
curBlockIndex_++;
|
||||||
|
|
|
@ -981,7 +981,7 @@ VKContext::VKContext(VulkanContext *vulkan)
|
||||||
// 200 textures per frame was not enough for the UI.
|
// 200 textures per frame was not enough for the UI.
|
||||||
dp.maxSets = 4096;
|
dp.maxSets = 4096;
|
||||||
|
|
||||||
VkBufferUsageFlags usage = VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
|
VkBufferUsageFlags usage = VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
|
||||||
push_ = new VulkanPushPool(vulkan_, "pushBuffer", 1024 * 1024, usage);
|
push_ = new VulkanPushPool(vulkan_, "pushBuffer", 1024 * 1024, usage);
|
||||||
|
|
||||||
for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) {
|
for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) {
|
||||||
|
@ -1770,7 +1770,8 @@ uint64_t VKContext::GetNativeObject(NativeObject obj, void *srcObject) {
|
||||||
return (uint64_t)curFramebuffer_->GetFB()->GetRTView();
|
return (uint64_t)curFramebuffer_->GetFB()->GetRTView();
|
||||||
case NativeObject::THIN3D_PIPELINE_LAYOUT:
|
case NativeObject::THIN3D_PIPELINE_LAYOUT:
|
||||||
return (uint64_t)pipelineLayout_;
|
return (uint64_t)pipelineLayout_;
|
||||||
|
case NativeObject::PUSH_POOL:
|
||||||
|
return (uint64_t)push_;
|
||||||
default:
|
default:
|
||||||
Crash();
|
Crash();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -252,6 +252,7 @@ enum class NativeObject {
|
||||||
NULL_IMAGEVIEW,
|
NULL_IMAGEVIEW,
|
||||||
NULL_IMAGEVIEW_ARRAY,
|
NULL_IMAGEVIEW_ARRAY,
|
||||||
THIN3D_PIPELINE_LAYOUT,
|
THIN3D_PIPELINE_LAYOUT,
|
||||||
|
PUSH_POOL,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FBChannel {
|
enum FBChannel {
|
||||||
|
|
|
@ -173,7 +173,7 @@ void DrawEngineVulkan::InitDeviceObjects() {
|
||||||
// the null texture. This should be cleaned up...
|
// the null texture. This should be cleaned up...
|
||||||
}
|
}
|
||||||
|
|
||||||
pushUBO = new VulkanPushPool(vulkan, "pushUBO", 4 * 1024 * 1024, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT);
|
pushUBO = (VulkanPushPool *)draw_->GetNativeObject(Draw::NativeObject::PUSH_POOL);
|
||||||
pushVertex = new VulkanPushPool(vulkan, "pushVertex", 2 * 1024 * 1024, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
|
pushVertex = new VulkanPushPool(vulkan, "pushVertex", 2 * 1024 * 1024, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
|
||||||
pushIndex = new VulkanPushPool(vulkan, "pushIndex", 1 * 1024 * 1024, VK_BUFFER_USAGE_INDEX_BUFFER_BIT);
|
pushIndex = new VulkanPushPool(vulkan, "pushIndex", 1 * 1024 * 1024, VK_BUFFER_USAGE_INDEX_BUFFER_BIT);
|
||||||
|
|
||||||
|
@ -252,11 +252,6 @@ void DrawEngineVulkan::DestroyDeviceObjects() {
|
||||||
delete pushIndex;
|
delete pushIndex;
|
||||||
pushIndex = nullptr;
|
pushIndex = nullptr;
|
||||||
}
|
}
|
||||||
if (pushUBO) {
|
|
||||||
pushUBO->Destroy();
|
|
||||||
delete pushUBO;
|
|
||||||
pushUBO = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (samplerSecondaryNearest_ != VK_NULL_HANDLE)
|
if (samplerSecondaryNearest_ != VK_NULL_HANDLE)
|
||||||
vulkan->Delete().QueueDeleteSampler(samplerSecondaryNearest_);
|
vulkan->Delete().QueueDeleteSampler(samplerSecondaryNearest_);
|
||||||
|
@ -297,7 +292,7 @@ void DrawEngineVulkan::BeginFrame() {
|
||||||
|
|
||||||
lastPipeline_ = nullptr;
|
lastPipeline_ = nullptr;
|
||||||
|
|
||||||
pushUBO->BeginFrame();
|
// pushUBO is the thin3d push pool, don't need to BeginFrame again.
|
||||||
pushVertex->BeginFrame();
|
pushVertex->BeginFrame();
|
||||||
pushIndex->BeginFrame();
|
pushIndex->BeginFrame();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue