Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 119-graphicspipeline-refactoring
  • 129-projekte-und-assets-auslagern
  • 132-denoising-module
  • 143-ar-vr-support-via-openxr
  • 43-multi-threading
  • 91-compute-first-network
  • 95-arm64-raspberry-pi-4-support
  • develop
  • master
  • optimizations
  • 0.1.0
  • 0.2.0
12 results

Target

Select target project
  • vulkan2021/vkcv-framework
1 result
Select Git revision
  • 119-graphicspipeline-refactoring
  • 129-projekte-und-assets-auslagern
  • 132-denoising-module
  • 143-ar-vr-support-via-openxr
  • 43-multi-threading
  • 91-compute-first-network
  • 95-arm64-raspberry-pi-4-support
  • develop
  • master
  • optimizations
  • 0.1.0
  • 0.2.0
12 results
Show changes
Showing
with 164 additions and 78 deletions
...@@ -50,11 +50,11 @@ namespace vkcv::camera { ...@@ -50,11 +50,11 @@ namespace vkcv::camera {
} }
// handle yaw rotation // handle yaw rotation
float yaw = camera.getYaw() + static_cast<float>(xOffset) * m_cameraSpeed; float yaw = camera.getYaw() + static_cast<float>(xOffset) * 90.0f * m_cameraSpeed;
camera.setYaw(yaw); camera.setYaw(yaw);
// handle pitch rotation // handle pitch rotation
float pitch = camera.getPitch() - static_cast<float>(yOffset) * m_cameraSpeed; float pitch = camera.getPitch() - static_cast<float>(yOffset) * 90.0f * m_cameraSpeed;
pitch = glm::clamp(pitch, -89.0f, 89.0f); pitch = glm::clamp(pitch, -89.0f, 89.0f);
camera.setPitch(pitch); camera.setPitch(pitch);
} }
...@@ -82,22 +82,22 @@ namespace vkcv::camera { ...@@ -82,22 +82,22 @@ namespace vkcv::camera {
void PilotCameraController::keyCallback(int key, int scancode, int action, int mods, Camera &camera) { void PilotCameraController::keyCallback(int key, int scancode, int action, int mods, Camera &camera) {
switch (key) { switch (key) {
case GLFW_KEY_W: case GLFW_KEY_W:
moveForward(action); m_forward = static_cast<bool>(action);
break; break;
case GLFW_KEY_S: case GLFW_KEY_S:
moveBackward(action); m_backward = static_cast<bool>(action);
break; break;
case GLFW_KEY_A: case GLFW_KEY_A:
moveLeft(action); m_left = static_cast<bool>(action);
break; break;
case GLFW_KEY_D: case GLFW_KEY_D:
moveRight(action); m_right = static_cast<bool>(action);
break; break;
case GLFW_KEY_E: case GLFW_KEY_E:
moveUpward(action); m_upward = static_cast<bool>(action);
break; break;
case GLFW_KEY_Q: case GLFW_KEY_Q:
moveDownward(action); m_downward = static_cast<bool>(action);
break; break;
default: default:
break; break;
...@@ -109,31 +109,25 @@ namespace vkcv::camera { ...@@ -109,31 +109,25 @@ namespace vkcv::camera {
} }
void PilotCameraController::mouseMoveCallback(double xoffset, double yoffset, Camera &camera) { void PilotCameraController::mouseMoveCallback(double xoffset, double yoffset, Camera &camera) {
if(!m_rotationActive){ xoffset *= static_cast<float>(m_rotationActive);
return; yoffset *= static_cast<float>(m_rotationActive);
}
float sensitivity = 0.05f;
xoffset *= sensitivity;
yoffset *= sensitivity;
panView(xoffset , yoffset, camera); panView(xoffset , yoffset, camera);
} }
void PilotCameraController::mouseButtonCallback(int button, int action, int mods, Camera &camera) { void PilotCameraController::mouseButtonCallback(int button, int action, int mods, Camera &camera) {
if(button == GLFW_MOUSE_BUTTON_2 && m_rotationActive == false && action == GLFW_PRESS){ if (button == GLFW_MOUSE_BUTTON_2) {
m_rotationActive = true; if (m_rotationActive != (action == GLFW_PRESS)) {
} m_rotationActive = (action == GLFW_PRESS);
else if(button == GLFW_MOUSE_BUTTON_2 && m_rotationActive == true && action == GLFW_RELEASE){ }
m_rotationActive = false; }
}
} }
void PilotCameraController::gamepadCallback(int gamepadIndex, Camera &camera, double frametime) { void PilotCameraController::gamepadCallback(int gamepadIndex, Camera &camera, double frametime) {
GLFWgamepadstate gamepadState; GLFWgamepadstate gamepadState;
glfwGetGamepadState(gamepadIndex, &gamepadState); glfwGetGamepadState(gamepadIndex, &gamepadState);
float sensitivity = 100.0f; float sensitivity = 1.0f;
double threshold = 0.1; double threshold = 0.1;
// handle rotations // handle rotations
...@@ -162,29 +156,4 @@ namespace vkcv::camera { ...@@ -162,29 +156,4 @@ namespace vkcv::camera {
* -copysign(1.0, stickLeftX); * -copysign(1.0, stickLeftX);
} }
void PilotCameraController::moveForward(int action){
m_forward = static_cast<bool>(action);
}
void PilotCameraController::moveBackward(int action){
m_backward = static_cast<bool>(action);
}
void PilotCameraController::moveLeft(int action){
m_left = static_cast<bool>(action);
}
void PilotCameraController::moveRight(int action){
m_right = static_cast<bool>(action);
}
void PilotCameraController::moveUpward(int action){
m_upward = static_cast<bool>(action);
}
void PilotCameraController::moveDownward(int action){
m_downward = static_cast<bool>(action);
}
} }
\ No newline at end of file
...@@ -23,10 +23,10 @@ namespace vkcv::camera { ...@@ -23,10 +23,10 @@ namespace vkcv::camera {
} }
// handle yaw rotation // handle yaw rotation
m_yaw = m_yaw + static_cast<float>(xOffset) * m_cameraSpeed; m_yaw = m_yaw + static_cast<float>(xOffset) * 90.0f * m_cameraSpeed;
// handle pitch rotation // handle pitch rotation
m_pitch = m_pitch + static_cast<float>(yOffset) * m_cameraSpeed; m_pitch = m_pitch + static_cast<float>(yOffset) * 90.0f * m_cameraSpeed;
} }
void TrackballCameraController::updateRadius(double offset, Camera &camera) { void TrackballCameraController::updateRadius(double offset, Camera &camera) {
...@@ -67,15 +67,10 @@ namespace vkcv::camera { ...@@ -67,15 +67,10 @@ namespace vkcv::camera {
} }
void TrackballCameraController::mouseMoveCallback(double xoffset, double yoffset, Camera &camera) { void TrackballCameraController::mouseMoveCallback(double xoffset, double yoffset, Camera &camera) {
if(!m_rotationActive){ xoffset *= static_cast<float>(m_rotationActive);
return; yoffset *= static_cast<float>(m_rotationActive);
}
float sensitivity = 0.025f;
xoffset *= sensitivity;
yoffset *= sensitivity;
panView(xoffset , yoffset, camera); panView(xoffset, yoffset, camera);
} }
void TrackballCameraController::mouseButtonCallback(int button, int action, int mods, Camera &camera) { void TrackballCameraController::mouseButtonCallback(int button, int action, int mods, Camera &camera) {
...@@ -91,7 +86,7 @@ namespace vkcv::camera { ...@@ -91,7 +86,7 @@ namespace vkcv::camera {
GLFWgamepadstate gamepadState; GLFWgamepadstate gamepadState;
glfwGetGamepadState(gamepadIndex, &gamepadState); glfwGetGamepadState(gamepadIndex, &gamepadState);
float sensitivity = 100.0f; float sensitivity = 1.0f;
double threshold = 0.1; double threshold = 0.1;
// handle rotations // handle rotations
......
...@@ -116,6 +116,10 @@ namespace vkcv::scene { ...@@ -116,6 +116,10 @@ namespace vkcv::scene {
size_t pushConstantsSizePerDrawcall, size_t pushConstantsSizePerDrawcall,
const RecordMeshDrawcallFunction &record, const RecordMeshDrawcallFunction &record,
const std::vector<ImageHandle> &renderTargets) { const std::vector<ImageHandle> &renderTargets) {
m_core->recordBeginDebugLabel(cmdStream, "vkcv::scene::Scene", {
0.0f, 1.0f, 0.0f, 1.0f
});
PushConstants pushConstants (pushConstantsSizePerDrawcall); PushConstants pushConstants (pushConstantsSizePerDrawcall);
std::vector<DrawcallInfo> drawcalls; std::vector<DrawcallInfo> drawcalls;
size_t count = 0; size_t count = 0;
...@@ -137,6 +141,8 @@ namespace vkcv::scene { ...@@ -137,6 +141,8 @@ namespace vkcv::scene {
drawcalls, drawcalls,
renderTargets renderTargets
); );
m_core->recordEndDebugLabel(cmdStream);
} }
Scene Scene::create(Core& core) { Scene Scene::create(Core& core) {
......
...@@ -31,7 +31,7 @@ include(config/GLSLANG.cmake) ...@@ -31,7 +31,7 @@ include(config/GLSLANG.cmake)
target_link_libraries(vkcv_shader_compiler ${vkcv_shader_compiler_libraries} vkcv) target_link_libraries(vkcv_shader_compiler ${vkcv_shader_compiler_libraries} vkcv)
# including headers of dependencies and the VkCV framework # including headers of dependencies and the VkCV framework
target_include_directories(vkcv_shader_compiler SYSTEM BEFORE PRIVATE ${vkcv_shader_compiler_includes} ${vkcv_include}) target_include_directories(vkcv_shader_compiler SYSTEM BEFORE PRIVATE ${vkcv_shader_compiler_includes} ${vkcv_include} ${vkcv_includes})
# add the own include directory for public headers # add the own include directory for public headers
target_include_directories(vkcv_shader_compiler BEFORE PUBLIC ${vkcv_shader_compiler_include}) target_include_directories(vkcv_shader_compiler BEFORE PUBLIC ${vkcv_shader_compiler_include})
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "vkcv/shader/GLSLCompiler.hpp" #include "vkcv/shader/GLSLCompiler.hpp"
#include <fstream> #include <fstream>
#include <strstream> #include <sstream>
#include <glslang/SPIRV/GlslangToSpv.h> #include <glslang/SPIRV/GlslangToSpv.h>
#include <glslang/StandAlone/DirStackFileIncluder.h> #include <glslang/StandAlone/DirStackFileIncluder.h>
...@@ -219,12 +219,10 @@ namespace vkcv::shader { ...@@ -219,12 +219,10 @@ namespace vkcv::shader {
std::string source (shaderSource); std::string source (shaderSource);
if (!m_defines.empty()) { if (!m_defines.empty()) {
std::strstream defines; std::ostringstream defines;
for (const auto& define : m_defines) { for (const auto& define : m_defines) {
defines << "#define " << define.first << " " << define.second << std::endl; defines << "#define " << define.first << " " << define.second << std::endl;
} }
defines << '\0';
size_t pos = source.find("#version") + 8; size_t pos = source.find("#version") + 8;
if (pos >= source.length()) { if (pos >= source.length()) {
...@@ -236,8 +234,10 @@ namespace vkcv::shader { ...@@ -236,8 +234,10 @@ namespace vkcv::shader {
pos = epos; pos = epos;
} }
const auto defines_str = defines.str();
pos = source.find('\n', pos) + 1; pos = source.find('\n', pos) + 1;
source = source.insert(pos, defines.str()); source = source.insert(pos, defines_str);
} }
const char *shaderStrings [1]; const char *shaderStrings [1];
......
...@@ -7,7 +7,13 @@ namespace vkcv::upscaling { ...@@ -7,7 +7,13 @@ namespace vkcv::upscaling {
void BilinearUpscaling::recordUpscaling(const CommandStreamHandle &cmdStream, const ImageHandle &input, void BilinearUpscaling::recordUpscaling(const CommandStreamHandle &cmdStream, const ImageHandle &input,
const ImageHandle &output) { const ImageHandle &output) {
m_core.recordBeginDebugLabel(cmdStream, "vkcv::upscaling::BilinearUpscaling", {
0.0f, 0.0f, 1.0f, 1.0f
});
m_core.recordBlitImage(cmdStream, input, output, SamplerFilterType::LINEAR); m_core.recordBlitImage(cmdStream, input, output, SamplerFilterType::LINEAR);
m_core.recordEndDebugLabel(cmdStream);
} }
} }
...@@ -177,7 +177,7 @@ namespace vkcv::upscaling { ...@@ -177,7 +177,7 @@ namespace vkcv::upscaling {
vkcv::shader::GLSLCompiler easuCompiler; vkcv::shader::GLSLCompiler easuCompiler;
vkcv::shader::GLSLCompiler rcasCompiler; vkcv::shader::GLSLCompiler rcasCompiler;
const auto& features = m_core.getContext().getPhysicalDevice().getFeatures2(); const auto& features = m_core.getContext().getFeatureManager().getFeatures();
const bool float16Support = ( const bool float16Support = (
checkFeatures<vk::PhysicalDeviceFloat16Int8FeaturesKHR>( checkFeatures<vk::PhysicalDeviceFloat16Int8FeaturesKHR>(
reinterpret_cast<const vk::BaseInStructure*>(&features), reinterpret_cast<const vk::BaseInStructure*>(&features),
...@@ -189,7 +189,7 @@ namespace vkcv::upscaling { ...@@ -189,7 +189,7 @@ namespace vkcv::upscaling {
vk::StructureType::ePhysicalDevice16BitStorageFeaturesKHR, vk::StructureType::ePhysicalDevice16BitStorageFeaturesKHR,
check16Storage check16Storage
) )
) || (true); // check doesn't work because chain is empty );
if (!float16Support) { if (!float16Support) {
easuCompiler.setDefine("SAMPLE_SLOW_FALLBACK", "1"); easuCompiler.setDefine("SAMPLE_SLOW_FALLBACK", "1");
...@@ -245,6 +245,10 @@ namespace vkcv::upscaling { ...@@ -245,6 +245,10 @@ namespace vkcv::upscaling {
void FSRUpscaling::recordUpscaling(const CommandStreamHandle& cmdStream, void FSRUpscaling::recordUpscaling(const CommandStreamHandle& cmdStream,
const ImageHandle& input, const ImageHandle& input,
const ImageHandle& output) { const ImageHandle& output) {
m_core.recordBeginDebugLabel(cmdStream, "vkcv::upscaling::FSRUpscaling", {
1.0f, 0.0f, 0.0f, 1.0f
});
const uint32_t inputWidth = m_core.getImageWidth(input); const uint32_t inputWidth = m_core.getImageWidth(input);
const uint32_t inputHeight = m_core.getImageHeight(input); const uint32_t inputHeight = m_core.getImageHeight(input);
...@@ -361,6 +365,8 @@ namespace vkcv::upscaling { ...@@ -361,6 +365,8 @@ namespace vkcv::upscaling {
PushConstants(0) PushConstants(0)
); );
} }
m_core.recordEndDebugLabel(cmdStream);
} }
bool FSRUpscaling::isHdrEnabled() const { bool FSRUpscaling::isHdrEnabled() const {
......
...@@ -6,3 +6,4 @@ add_subdirectory(first_scene) ...@@ -6,3 +6,4 @@ add_subdirectory(first_scene)
add_subdirectory(particle_simulation) add_subdirectory(particle_simulation)
add_subdirectory(voxelization) add_subdirectory(voxelization)
add_subdirectory(mesh_shader) add_subdirectory(mesh_shader)
add_subdirectory(indirect_dispatch)
...@@ -18,14 +18,13 @@ int main(int argc, const char** argv) { ...@@ -18,14 +18,13 @@ int main(int argc, const char** argv) {
windowHeight, windowHeight,
true true
); );
vkcv::Core core = vkcv::Core::create( vkcv::Core core = vkcv::Core::create(
window, window,
applicationName, applicationName,
VK_MAKE_VERSION(0, 0, 1), VK_MAKE_VERSION(0, 0, 1),
{ vk::QueueFlagBits::eGraphics ,vk::QueueFlagBits::eCompute , vk::QueueFlagBits::eTransfer }, { vk::QueueFlagBits::eGraphics ,vk::QueueFlagBits::eCompute , vk::QueueFlagBits::eTransfer },
{}, { VK_KHR_SWAPCHAIN_EXTENSION_NAME }
{ "VK_KHR_swapchain" }
); );
vkcv::asset::Scene mesh; vkcv::asset::Scene mesh;
...@@ -166,7 +165,6 @@ int main(int argc, const char** argv) { ...@@ -166,7 +165,6 @@ int main(int argc, const char** argv) {
vkcv::camera::CameraManager cameraManager(window); vkcv::camera::CameraManager cameraManager(window);
uint32_t camIndex0 = cameraManager.addCamera(vkcv::camera::ControllerType::PILOT); uint32_t camIndex0 = cameraManager.addCamera(vkcv::camera::ControllerType::PILOT);
uint32_t camIndex1 = cameraManager.addCamera(vkcv::camera::ControllerType::TRACKBALL);
cameraManager.getCamera(camIndex0).setPosition(glm::vec3(0, 0, -3)); cameraManager.getCamera(camIndex0).setPosition(glm::vec3(0, 0, -3));
......
...@@ -28,14 +28,13 @@ int main(int argc, const char** argv) { ...@@ -28,14 +28,13 @@ int main(int argc, const char** argv) {
cameraManager.getCamera(camIndex0).setNearFar(0.1f, 30.0f); cameraManager.getCamera(camIndex0).setNearFar(0.1f, 30.0f);
cameraManager.getCamera(camIndex1).setNearFar(0.1f, 30.0f); cameraManager.getCamera(camIndex1).setNearFar(0.1f, 30.0f);
vkcv::Core core = vkcv::Core::create( vkcv::Core core = vkcv::Core::create(
window, window,
applicationName, applicationName,
VK_MAKE_VERSION(0, 0, 1), VK_MAKE_VERSION(0, 0, 1),
{ vk::QueueFlagBits::eGraphics ,vk::QueueFlagBits::eCompute , vk::QueueFlagBits::eTransfer }, { vk::QueueFlagBits::eGraphics ,vk::QueueFlagBits::eCompute , vk::QueueFlagBits::eTransfer },
{}, { VK_KHR_SWAPCHAIN_EXTENSION_NAME }
{ "VK_KHR_swapchain" }
); );
vkcv::scene::Scene scene = vkcv::scene::Scene::load(core, std::filesystem::path( vkcv::scene::Scene scene = vkcv::scene::Scene::load(core, std::filesystem::path(
......
...@@ -16,22 +16,21 @@ int main(int argc, const char** argv) { ...@@ -16,22 +16,21 @@ int main(int argc, const char** argv) {
windowHeight, windowHeight,
false false
); );
vkcv::Core core = vkcv::Core::create( vkcv::Core core = vkcv::Core::create(
window, window,
applicationName, applicationName,
VK_MAKE_VERSION(0, 0, 1), VK_MAKE_VERSION(0, 0, 1),
{ vk::QueueFlagBits::eTransfer,vk::QueueFlagBits::eGraphics, vk::QueueFlagBits::eCompute }, { vk::QueueFlagBits::eTransfer,vk::QueueFlagBits::eGraphics, vk::QueueFlagBits::eCompute },
{}, { VK_KHR_SWAPCHAIN_EXTENSION_NAME }
{ "VK_KHR_swapchain" }
); );
const auto& context = core.getContext();
auto triangleIndexBuffer = core.createBuffer<uint16_t>(vkcv::BufferType::INDEX, 3, vkcv::BufferMemoryType::DEVICE_LOCAL); auto triangleIndexBuffer = core.createBuffer<uint16_t>(vkcv::BufferType::INDEX, 3, vkcv::BufferMemoryType::DEVICE_LOCAL);
uint16_t indices[3] = { 0, 1, 2 }; uint16_t indices[3] = { 0, 1, 2 };
triangleIndexBuffer.fill(&indices[0], sizeof(indices)); triangleIndexBuffer.fill(&indices[0], sizeof(indices));
core.setDebugLabel(triangleIndexBuffer.getHandle(), "Triangle Index Buffer");
// an example attachment for passes that output to the window // an example attachment for passes that output to the window
const vkcv::AttachmentDescription present_color_attachment( const vkcv::AttachmentDescription present_color_attachment(
vkcv::AttachmentOperation::STORE, vkcv::AttachmentOperation::STORE,
...@@ -46,6 +45,8 @@ int main(int argc, const char** argv) { ...@@ -46,6 +45,8 @@ int main(int argc, const char** argv) {
std::cout << "Error. Could not create renderpass. Exiting." << std::endl; std::cout << "Error. Could not create renderpass. Exiting." << std::endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
core.setDebugLabel(trianglePass, "Triangle Pass");
vkcv::ShaderProgram triangleShaderProgram; vkcv::ShaderProgram triangleShaderProgram;
vkcv::shader::GLSLCompiler compiler; vkcv::shader::GLSLCompiler compiler;
...@@ -78,12 +79,15 @@ int main(int argc, const char** argv) { ...@@ -78,12 +79,15 @@ int main(int argc, const char** argv) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
core.setDebugLabel(trianglePipeline, "Triangle Pipeline");
auto start = std::chrono::system_clock::now(); auto start = std::chrono::system_clock::now();
const vkcv::Mesh renderMesh({}, triangleIndexBuffer.getVulkanHandle(), 3); const vkcv::Mesh renderMesh({}, triangleIndexBuffer.getVulkanHandle(), 3);
vkcv::DrawcallInfo drawcall(renderMesh, {},1); vkcv::DrawcallInfo drawcall(renderMesh, {},1);
const vkcv::ImageHandle swapchainInput = vkcv::ImageHandle::createSwapchainImageHandle(); const vkcv::ImageHandle swapchainInput = vkcv::ImageHandle::createSwapchainImageHandle();
core.setDebugLabel(swapchainInput, "Swapchain Image");
vkcv::camera::CameraManager cameraManager(window); vkcv::camera::CameraManager cameraManager(window);
uint32_t camIndex0 = cameraManager.addCamera(vkcv::camera::ControllerType::PILOT); uint32_t camIndex0 = cameraManager.addCamera(vkcv::camera::ControllerType::PILOT);
...@@ -113,6 +117,7 @@ int main(int argc, const char** argv) { ...@@ -113,6 +117,7 @@ int main(int argc, const char** argv) {
pushConstants.appendDrawcall(mvp); pushConstants.appendDrawcall(mvp);
auto cmdStream = core.createCommandStream(vkcv::QueueType::Graphics); auto cmdStream = core.createCommandStream(vkcv::QueueType::Graphics);
core.setDebugLabel(cmdStream, "Render Commands");
core.recordDrawcallsToCmdStream( core.recordDrawcallsToCmdStream(
cmdStream, cmdStream,
......
indirect_dispatch
cmake_minimum_required(VERSION 3.16)
project(indirect_dispatch)
# 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(indirect_dispatch src/main.cpp)
target_sources(indirect_dispatch PRIVATE
src/App.hpp
src/App.cpp
src/AppConfig.hpp
src/MotionBlurConfig.hpp
src/AppSetup.hpp
src/AppSetup.cpp
src/MotionBlur.hpp
src/MotionBlur.cpp
src/MotionBlurSetup.hpp
src/MotionBlurSetup.cpp)
# this should fix the execution path to load local files from the project (for MSVC)
if(MSVC)
set_target_properties(indirect_dispatch PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set_target_properties(indirect_dispatch 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(indirect_dispatch PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()
# including headers of dependencies and the VkCV framework
target_include_directories(indirect_dispatch SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_testing_include} ${vkcv_camera_include} ${vkcv_shader_compiler_include} ${vkcv_gui_include})
# linking with libraries from all dependencies and the VkCV framework
target_link_libraries(indirect_dispatch vkcv ${vkcv_libraries} vkcv_asset_loader ${vkcv_asset_loader_libraries} vkcv_testing vkcv_camera vkcv_shader_compiler vkcv_gui)
\ No newline at end of file
File added
Source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
projects/indirect_dispatch/resources/models/grid.png

130 B

File added
Source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
#version 440
#extension GL_GOOGLE_include_directive : enable
layout(set=0, binding=0) uniform texture2D inTexture;
layout(set=0, binding=1) uniform sampler textureSampler;
layout(set=0, binding=2, rgba8) uniform image2D outImage;
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
void main(){
ivec2 outImageRes = imageSize(outImage);
ivec2 coord = ivec2(gl_GlobalInvocationID.xy);
if(any(greaterThanEqual(coord, outImageRes)))
return;
vec2 uv = vec2(coord) / outImageRes;
vec3 linearColor = texture(sampler2D(inTexture, textureSampler), uv).rgb;
vec3 gammaCorrected = pow(linearColor, vec3(1 / 2.2));
imageStore(outImage, coord, vec4(gammaCorrected, 0.f));
}
\ No newline at end of file
#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 albedoTexture;
layout(set=0, binding=1) uniform sampler textureSampler;
void main() {
vec3 albedo = texture(sampler2D(albedoTexture, textureSampler), passUV).rgb;
vec3 N = normalize(passNormal);
float light = max(N.y * 0.5 + 0.5, 0);
outColor = light * albedo;
}
\ No newline at end of file