Vulkan: Clearing Framebuffer + Scissors #106044

Merged
Jeroen Bakker merged 49 commits from Jeroen-Bakker/blender:vulkan-framebuffer-clear into main 2023-03-28 11:51:45 +02:00
7 changed files with 37 additions and 7 deletions
Showing only changes of commit ce34c913cd - Show all commits

View File

@ -617,10 +617,12 @@ endif()
option(WITH_OPENGL "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON)
option(WITH_GPU_BUILDTIME_SHADER_BUILDER "Shader builder is a developer option enabling linting on GLSL during compilation" OFF)
option(WITH_RENDERDOC "Use Renderdoc API to capture frames" OFF)
mark_as_advanced(
WITH_OPENGL
WITH_GPU_BUILDTIME_SHADER_BUILDER
WITH_RENDERDOC
)
# Vulkan

View File

@ -67,7 +67,7 @@ if(UNIX AND NOT APPLE)
add_subdirectory(libc_compat)
endif()
if (NOT APPLE)
if (WITH_RENDERDOC)
add_subdirectory(renderdoc_dynload)
endif()

View File

@ -40,10 +40,16 @@ set(INC
../../../intern/ghost
../../../intern/guardedalloc
../../../intern/mantaflow/extern
../../../extern/renderdoc/include
../../../intern/renderdoc_dynload/include
)
if(WITH_RENDERDOC)
list(APPEND INC
../../../extern/renderdoc/include
../../../intern/renderdoc_dynload/include
)
add_definitions(-DWITH_RENDERDOC)
endif()
set(INC_SYS
${Epoxy_INCLUDE_DIRS}
)
@ -739,13 +745,16 @@ target_link_libraries(bf_gpu PUBLIC
bf_compositor_shaders
bf_draw_shaders
bf_gpu_shaders
bf_intern_renderdoc_dynload
)
if(WITH_OPENCOLORIO)
target_link_libraries(bf_gpu PUBLIC bf_ocio_shaders)
endif()
if(WITH_RENDERDOC)
target_link_libraries(bf_gpu PUBLIC bf_intern_renderdoc_dynload)
endif()
if(CXX_WARN_NO_SUGGEST_OVERRIDE)
target_compile_options(bf_gpu PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wsuggest-override>)
@ -784,7 +793,6 @@ if(WITH_GPU_BUILDTIME_SHADER_BUILDER)
bf_intern_clog
bf_blenlib
bf_intern_ghost
bf_intern_renderdoc_dynload
${PLATFORM_LINKLIBS}
)
target_include_directories(shader_builder PRIVATE ${INC} ${CMAKE_CURRENT_BINARY_DIR})

View File

@ -11,7 +11,9 @@
#include "BLI_vector.hh"
#include "renderdoc_api.hh"
#ifdef WITH_RENDERDOC
# include "renderdoc_api.hh"
#endif
#include "gl_batch.hh"
#include "gl_compute.hh"
@ -32,7 +34,9 @@ namespace gpu {
class GLBackend : public GPUBackend {
private:
GLSharedOrphanLists shared_orphan_list_;
#ifdef WITH_RENDERDOC
renderdoc::api::Renderdoc renderdoc_;
#endif
public:
GLBackend()

View File

@ -389,7 +389,9 @@ bool GLContext::debug_capture_begin()
void GLBackend::debug_capture_begin()
{
#ifdef WITH_RENDERDOC
renderdoc_.start_frame_capture(nullptr, nullptr);
#endif
}
void GLContext::debug_capture_end()
@ -399,7 +401,9 @@ void GLContext::debug_capture_end()
void GLBackend::debug_capture_end()
{
#ifdef WITH_RENDERDOC
renderdoc_.end_frame_capture(nullptr, nullptr);
#endif
}
void *GLContext::debug_capture_scope_create(const char * /*name*/)

View File

@ -9,7 +9,9 @@
#include "gpu_backend.hh"
#include "renderdoc_api.hh"
#ifdef WITH_RENDERDOC
# include "renderdoc_api.hh"
#endif
#include "vk_common.hh"
@ -22,7 +24,9 @@ class VKContext;
class VKBackend : public GPUBackend {
private:
shaderc::Compiler shaderc_compiler_;
#ifdef WITH_RENDERDOC
renderdoc::api::Renderdoc renderdoc_api_;
#endif
public:
VKBackend()

View File

@ -25,7 +25,11 @@ bool VKContext::debug_capture_begin()
void VKBackend::debug_capture_begin(VkInstance vk_instance)
{
#ifdef WITH_RENDERDOC
renderdoc_api_.start_frame_capture(vk_instance, nullptr);
#else
UNUSED_VARS(vk_instance);
#endif
}
void VKContext::debug_capture_end()
@ -35,7 +39,11 @@ void VKContext::debug_capture_end()
void VKBackend::debug_capture_end(VkInstance vk_instance)
{
#ifdef WITH_RENDERDOC
renderdoc_api_.end_frame_capture(vk_instance, nullptr);
#else
UNUSED_VARS(vk_instance);
#endif
}
void *VKContext::debug_capture_scope_create(const char * /*name*/)