Skip to content
Snippets Groups Projects
Commit 020bdcdd authored by Alexander Gauggel's avatar Alexander Gauggel
Browse files

[#66] Remove depth buffer from core and take image handle vector as input for renderMesh

parent c367ec77
No related branches found
No related tags found
1 merge request!54Resolve "Cmd/Sync-Rework"
Showing
with 99 additions and 5 deletions
...@@ -81,8 +81,6 @@ namespace vkcv ...@@ -81,8 +81,6 @@ namespace vkcv
SyncResources m_SyncResources; SyncResources m_SyncResources;
uint32_t m_currentSwapchainImageIndex; uint32_t m_currentSwapchainImageIndex;
std::vector<vk::Framebuffer> m_TemporaryFramebuffers; std::vector<vk::Framebuffer> m_TemporaryFramebuffers;
ImageHandle m_DepthImage;
/** /**
* recreates the swapchain * recreates the swapchain
...@@ -240,7 +238,8 @@ namespace vkcv ...@@ -240,7 +238,8 @@ namespace vkcv
const BufferHandle indexBuffer, const BufferHandle indexBuffer,
const size_t indexCount, const size_t indexCount,
const vkcv::ResourcesHandle resourceHandle, const vkcv::ResourcesHandle resourceHandle,
const size_t resourceDescriptorSetIndex); const size_t resourceDescriptorSetIndex,
const std::vector<ImageHandle> &renderTargets);
/** /**
* @brief end recording and present image * @brief end recording and present image
......
...@@ -93,9 +93,8 @@ namespace vkcv ...@@ -93,9 +93,8 @@ namespace vkcv
class ImageHandle : public Handle { class ImageHandle : public Handle {
friend class ImageManager; friend class ImageManager;
private:
using Handle::Handle; using Handle::Handle;
public:
[[nodiscard]] [[nodiscard]]
bool isSwapchainImage() const; bool isSwapchainImage() const;
......
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
# Add new projects/examples here: # Add new projects/examples here:
add_subdirectory(first_triangle) add_subdirectory(first_triangle)
add_subdirectory(first_mesh) add_subdirectory(first_mesh)
add_subdirectory(cmd_sync_test)
\ No newline at end of file
first_mesh
\ No newline at end of file
cmake_minimum_required(VERSION 3.16)
project(cmd_sync_test)
# setting c++ standard for the project
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# this should fix the execution path to load local files from the project
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# adding source files to the project
add_executable(cmd_sync_test src/main.cpp)
# this should fix the execution path to load local files from the project (for MSVC)
if(MSVC)
set_target_properties(cmd_sync_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set_target_properties(cmd_sync_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
# in addition to setting the output directory, the working directory has to be set
# by default visual studio sets the working directory to the build directory, when using the debugger
set_target_properties(cmd_sync_test PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()
# including headers of dependencies and the VkCV framework
target_include_directories(cmd_sync_test SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_asset_loader_include} ${vkcv_camera_include})
# linking with libraries from all dependencies and the VkCV framework
target_link_libraries(cmd_sync_test vkcv ${vkcv_libraries} vkcv_asset_loader ${vkcv_asset_loader_libraries} vkcv_camera)
projects/cmd_sync_test/resources/cube/boards2_vcyc_jpg.jpg

132 B

File added
File added
File added
File added
Source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
%VULKAN_SDK%\Bin32\glslc.exe shader.vert -o vert.spv
%VULKAN_SDK%\Bin32\glslc.exe shader.frag -o frag.spv
pause
\ No newline at end of file
File added
#version 450
#extension GL_ARB_separate_shader_objects : enable
layout(location = 0) in vec3 passNormal;
layout(location = 1) in vec2 passUV;
layout(location = 0) out vec3 outColor;
layout(set=0, binding=0) uniform texture2D meshTexture;
layout(set=0, binding=1) uniform sampler textureSampler;
void main() {
outColor = texture(sampler2D(meshTexture, textureSampler), passUV).rgb;
}
\ No newline at end of file
#version 450
#extension GL_ARB_separate_shader_objects : enable
layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec3 inNormal;
layout(location = 2) in vec2 inUV;
layout(location = 0) out vec3 passNormal;
layout(location = 1) out vec2 passUV;
layout( push_constant ) uniform constants{
mat4 mvp;
};
void main() {
gl_Position = mvp * vec4(inPosition, 1.0);
passNormal = inNormal;
passUV = inUV;
}
\ No newline at end of file
File added
File added
File added
File added
Source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment