Permalink
Browse files

Move the VulkanRenderManager stuff to thin3d, fits in better there.

  • Loading branch information...
hrydgard committed Aug 22, 2017
1 parent 02f76ae commit 1c5bd0f8dcea934806906430066888055a135183
View
@@ -803,7 +803,10 @@ endif()
set(THIN3D_PLATFORMS ext/native/thin3d/thin3d_gl.cpp)
if(VULKAN)
set(THIN3D_PLATFORMS ${THIN3D_PLATFORMS} ext/native/thin3d/thin3d_vulkan.cpp)
set(THIN3D_PLATFORMS ${THIN3D_PLATFORMS}
ext/native/thin3d/thin3d_vulkan.cpp
ext/native/thin3d/VulkanRenderManager.cpp
ext/native/thin3d/VulkanRenderManager.h)
endif()
if(WIN32)
set(THIN3D_PLATFORMS ${THIN3D_PLATFORMS}
View
@@ -249,8 +249,6 @@
<ClInclude Include="Vulkan\VulkanImage.h" />
<ClInclude Include="Vulkan\VulkanLoader.h" />
<ClInclude Include="Vulkan\VulkanMemory.h" />
<ClInclude Include="Vulkan\VulkanQueueRunner.h" />
<ClInclude Include="Vulkan\VulkanRenderManager.h" />
<ClInclude Include="x64Analyzer.h" />
<ClInclude Include="x64Emitter.h" />
</ItemGroup>
@@ -322,8 +320,6 @@
<ClCompile Include="Vulkan\VulkanImage.cpp" />
<ClCompile Include="Vulkan\VulkanLoader.cpp" />
<ClCompile Include="Vulkan\VulkanMemory.cpp" />
<ClCompile Include="Vulkan\VulkanQueueRunner.cpp" />
<ClCompile Include="Vulkan\VulkanRenderManager.cpp" />
<ClCompile Include="x64Analyzer.cpp" />
<ClCompile Include="x64Emitter.cpp" />
</ItemGroup>
@@ -75,12 +75,6 @@
</ClInclude>
<ClInclude Include="OSVersion.h" />
<ClInclude Include="Hashmaps.h" />
<ClInclude Include="Vulkan\VulkanRenderManager.h">
<Filter>Vulkan</Filter>
</ClInclude>
<ClInclude Include="Vulkan\VulkanQueueRunner.h">
<Filter>Vulkan</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp" />
@@ -144,12 +138,6 @@
<ClCompile Include="MemArenaAndroid.cpp" />
<ClCompile Include="MemArenaDarwin.cpp" />
<ClCompile Include="OSVersion.cpp" />
<ClCompile Include="Vulkan\VulkanRenderManager.cpp">
<Filter>Vulkan</Filter>
</ClCompile>
<ClCompile Include="Vulkan\VulkanQueueRunner.cpp">
<Filter>Vulkan</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="Crypto">
@@ -21,9 +21,9 @@
#include "base/timeutil.h"
#include "math/dataconv.h"
#include "profiler/profiler.h"
#include "thin3d/VulkanRenderManager.h"
#include "Common/MemoryUtil.h"
#include "Common/Vulkan/VulkanRenderManager.h"
#include "Core/MemMap.h"
#include "Core/Host.h"
#include "Core/System.h"
@@ -646,7 +646,7 @@ void DrawEngineVulkan::DoFlush() {
VulkanRenderManager *renderManager = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
// HACK: These two lines should only execute if we started on a new render pass.
// HACK: These two lines should only execute if we started on a new render pass. Can't tell from in here though...
lastPipeline_ = nullptr;
// Since we have a new cmdbuf, dirty our dynamic state so it gets re-set.
// gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE|DIRTY_DEPTHSTENCIL_STATE|DIRTY_BLEND_STATE);
@@ -28,7 +28,7 @@
#include "Common/Vulkan/VulkanContext.h"
#include "Common/Vulkan/VulkanMemory.h"
#include "Common/Vulkan/VulkanImage.h"
#include "Common/Vulkan/VulkanRenderManager.h"
#include "thin3d/VulkanRenderManager.h"
#include "Common/ColorConv.h"
#include "Core/Host.h"
#include "Core/MemMap.h"
@@ -16,7 +16,7 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "Common/Vulkan/VulkanLoader.h"
#include "Common/Vulkan/VulkanRenderManager.h"
#include "thin3d/VulkanRenderManager.h"
#include "math/dataconv.h"
#include "GPU/Math3D.h"
@@ -312,19 +312,20 @@ bool AndroidVulkanContext::Init(ANativeWindow *wnd, int desiredBackbufferSizeX,
int bits = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT;
g_Vulkan->InitDebugMsgCallback(&Vulkan_Dbg, bits, &g_LogOptions);
}
g_Vulkan->InitObjects(true);
g_Vulkan->InitObjects();
draw_ = Draw::T3DCreateVulkanContext(g_Vulkan);
bool success = draw_->CreatePresets(); // Doesn't fail, we ship the compiler.
assert(success);
draw_->HandleEvent(Draw::Event::GOT_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
return true;
}
void AndroidVulkanContext::Shutdown() {
ILOG("AndroidVulkanContext::Shutdown");
draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
delete draw_;
draw_ = nullptr;
NativeShutdownGraphics();
g_Vulkan->WaitUntilQueueIdle();
g_Vulkan->DestroyObjects();
g_Vulkan->DestroyDebugMsgCallback();
@@ -341,11 +342,13 @@ void AndroidVulkanContext::SwapBuffers() {
void AndroidVulkanContext::Resize() {
g_Vulkan->WaitUntilQueueIdle();
draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
g_Vulkan->DestroyObjects();
// backbufferResize updated these values. TODO: Notify another way?
g_Vulkan->ReinitSurfaceAndroid(pixel_xres, pixel_yres);
g_Vulkan->InitObjects(g_Vulkan);
g_Vulkan->InitObjects();
draw_->HandleEvent(Draw::Event::GOT_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
}
void AndroidVulkanContext::SwapInterval(int interval) {
@@ -240,6 +240,8 @@
<ClInclude Include="gfx_es2\draw_text_qt.h" />
<ClInclude Include="gfx_es2\draw_text_win.h" />
<ClInclude Include="thin3d\d3d11_loader.h" />
<ClInclude Include="thin3d\VulkanQueueRunner.h" />
<ClInclude Include="thin3d\VulkanRenderManager.h" />
<ClInclude Include="util\text\wrap_text.h" />
<ClInclude Include="gfx_es2\draw_buffer.h" />
<ClInclude Include="gfx_es2\draw_text.h" />
@@ -697,6 +699,8 @@
<ClCompile Include="math\dataconv.cpp" />
<ClCompile Include="thin3d\d3d11_loader.cpp" />
<ClCompile Include="thin3d\thin3d_d3d11.cpp" />
<ClCompile Include="thin3d\VulkanQueueRunner.cpp" />
<ClCompile Include="thin3d\VulkanRenderManager.cpp" />
<ClCompile Include="util\text\wrap_text.cpp" />
<ClCompile Include="gfx_es2\draw_buffer.cpp" />
<ClCompile Include="gfx_es2\draw_text.cpp" />
@@ -320,6 +320,12 @@
<ClInclude Include="gfx_es2\draw_text_android.h">
<Filter>gfx</Filter>
</ClInclude>
<ClInclude Include="thin3d\VulkanQueueRunner.h">
<Filter>thin3d</Filter>
</ClInclude>
<ClInclude Include="thin3d\VulkanRenderManager.h">
<Filter>thin3d</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="gfx\gl_debug_log.cpp">
@@ -781,6 +787,12 @@
<ClCompile Include="math\dataconv.cpp">
<Filter>math</Filter>
</ClCompile>
<ClCompile Include="thin3d\VulkanQueueRunner.cpp">
<Filter>thin3d</Filter>
</ClCompile>
<ClCompile Include="thin3d\VulkanRenderManager.cpp">
<Filter>thin3d</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="gfx">
@@ -2,6 +2,8 @@
#include <cstdint>
// NOTE : This profiler is very single-threaded. Cannot be used from multiple threads yet.
// #define USE_PROFILER
#ifdef USE_PROFILER
@@ -14,7 +16,6 @@ void internal_profiler_end_frame();
int internal_profiler_enter(const char *category_name); // Returns the category number.
void internal_profiler_leave(int category);
const char *Profiler_GetCategoryName(int i);
int Profiler_GetNumCategories();
int Profiler_GetHistoryLength();
@@ -1,7 +1,7 @@
#include "base/logging.h"
#include "VulkanRenderManager.h"
#include "VulkanContext.h"
#include "Common/Vulkan/VulkanContext.h"
#include "thin3d/VulkanRenderManager.h"
void CreateImage(VulkanContext *vulkan, VkCommandBuffer cmd, VKRImage &img, int width, int height, VkFormat format, VkImageLayout initialLayout, bool color) {
VkImageCreateInfo ici{ VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
@@ -30,11 +30,11 @@
#include "math/lin/matrix4x4.h"
#include "math/dataconv.h"
#include "thin3d/thin3d.h"
#include "thin3d/VulkanRenderManager.h"
#include "Common/Vulkan/VulkanContext.h"
#include "Common/Vulkan/VulkanImage.h"
#include "Common/Vulkan/VulkanMemory.h"
#include "Common/Vulkan/VulkanRenderManager.h"
// We use a simple descriptor set for all rendering: 1 sampler, 1 texture, 1 UBO binding point.
// binding 0 - uniform data

0 comments on commit 1c5bd0f

Please sign in to comment.