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

Merge branch '106-indirect-dispatch' of...

Merge branch '106-indirect-dispatch' of gitlab.uni-koblenz.de:vulkan2021/vkcv-framework into 106-indirect-dispatch
parents f812cd7c a8a1ac35
No related branches found
No related tags found
1 merge request!89Resolve "Indirect Dispatch"
Pipeline #26868 passed
......@@ -2,7 +2,7 @@
#include "vkcv/shader/GLSLCompiler.hpp"
#include <fstream>
#include <strstream>
#include <sstream>
#include <glslang/SPIRV/GlslangToSpv.h>
#include <glslang/StandAlone/DirStackFileIncluder.h>
......@@ -219,12 +219,10 @@ namespace vkcv::shader {
std::string source (shaderSource);
if (!m_defines.empty()) {
std::strstream defines;
std::ostringstream defines;
for (const auto& define : m_defines) {
defines << "#define " << define.first << " " << define.second << std::endl;
}
defines << '\0';
size_t pos = source.find("#version") + 8;
if (pos >= source.length()) {
......@@ -236,8 +234,10 @@ namespace vkcv::shader {
pos = epos;
}
const auto defines_str = defines.str();
pos = source.find('\n', pos) + 1;
source = source.insert(pos, defines.str());
source = source.insert(pos, defines_str);
}
const char *shaderStrings [1];
......
......@@ -166,7 +166,6 @@ int main(int argc, const char** argv) {
vkcv::camera::CameraManager cameraManager(window);
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));
......
......@@ -26,8 +26,6 @@ int main(int argc, const char** argv) {
{ "VK_KHR_swapchain" }
);
const auto& context = core.getContext();
auto triangleIndexBuffer = core.createBuffer<uint16_t>(vkcv::BufferType::INDEX, 3, vkcv::BufferMemoryType::DEVICE_LOCAL);
uint16_t indices[3] = { 0, 1, 2 };
triangleIndexBuffer.fill(&indices[0], sizeof(indices));
......
......@@ -98,11 +98,6 @@ int main(int argc, const char** argv) {
vkcv::gui::GUI gui (core, window);
const auto& context = core.getContext();
const vk::Instance& instance = context.getInstance();
const vk::PhysicalDevice& physicalDevice = context.getPhysicalDevice();
const vk::Device& device = context.getDevice();
vkcv::asset::Scene mesh;
const char* path = argc > 1 ? argv[1] : "resources/Bunny/Bunny.glb";
vkcv::asset::loadScene(path, mesh);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment