Commit 8c449e52 authored by Artur Wasmut's avatar Artur Wasmut
Browse files

rework VertexLayout; properly separate it from the asset loading.

parent f6111135
Pipeline #25673 failed with stages
in 0 seconds
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
#include <vector> #include <vector>
#include <cstdint> #include <cstdint>
#include "vkcv/Handles.hpp" #include "Handles.hpp"
#include "ShaderProgram.hpp" #include "ShaderProgram.hpp"
#include <vkcv/VertexLayout.hpp> #include "VertexLayout.hpp"
namespace vkcv { namespace vkcv {
...@@ -21,24 +21,25 @@ namespace vkcv { ...@@ -21,24 +21,25 @@ namespace vkcv {
* @param shaderProgram shaders of the pipeline * @param shaderProgram shaders of the pipeline
* @param height height of the application window * @param height height of the application window
* @param width width of the application window * @param width width of the application window
* @param passHandle handle for Render Pass * @param passHandle handle for render pass
* @param vertexLayout layout of vertex buffer, comprised of its bindings and the bindings' attachments
*/ */
PipelineConfig( PipelineConfig(
const ShaderProgram& shaderProgram, const ShaderProgram& shaderProgram,
uint32_t width, uint32_t width,
uint32_t height, uint32_t height,
const PassHandle &passHandle, const PassHandle &passHandle,
const std::vector<VertexAttribute> &vertexAttributes, const VertexLayout &vertexLayouts,
const std::vector<vk::DescriptorSetLayout> &descriptorLayouts, const std::vector<vk::DescriptorSetLayout> &descriptorLayouts,
bool useDynamicViewport); bool useDynamicViewport);
ShaderProgram m_ShaderProgram; ShaderProgram m_ShaderProgram;
uint32_t m_Height; uint32_t m_Height;
uint32_t m_Width; uint32_t m_Width;
PassHandle m_PassHandle; PassHandle m_PassHandle;
std::vector<VertexAttribute> m_VertexAttributes; VertexLayout m_VertexLayout;
std::vector<vk::DescriptorSetLayout> m_DescriptorLayouts; std::vector<vk::DescriptorSetLayout> m_DescriptorLayouts;
bool m_UseDynamicViewport; bool m_UseDynamicViewport;
}; };
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
#include <filesystem> #include <filesystem>
#include <vulkan/vulkan.hpp> #include <vulkan/vulkan.hpp>
#include <spirv_cross.hpp> #include <spirv_cross.hpp>
#include "vkcv/VertexLayout.hpp" #include "VertexLayout.hpp"
#include "vkcv/ShaderStage.hpp" #include "ShaderStage.hpp"
#include "vkcv/DescriptorConfig.hpp" #include "DescriptorConfig.hpp"
namespace vkcv { namespace vkcv {
...@@ -48,17 +48,23 @@ namespace vkcv { ...@@ -48,17 +48,23 @@ namespace vkcv {
bool existsShader(ShaderStage shaderStage) const; bool existsShader(ShaderStage shaderStage) const;
void reflectShader(ShaderStage shaderStage); const std::vector<VertexAttachment> &getVertexAttachments() const;
const VertexLayout &getVertexLayout() const;
size_t getPushConstantSize() const; size_t getPushConstantSize() const;
const std::vector<std::vector<DescriptorBinding>> getReflectedDescriptors() const; const std::vector<std::vector<DescriptorBinding>> &getReflectedDescriptors() const;
private: private:
/**
* Called after successfully adding a shader to the program.
* Fills vertex input attachments and descriptor sets (if present).
* @param shaderStage the stage to reflect data from
*/
void reflectShader(ShaderStage shaderStage);
std::unordered_map<ShaderStage, Shader> m_Shaders; std::unordered_map<ShaderStage, Shader> m_Shaders;
VertexLayout m_VertexLayout; // contains all vertex input attachments used in the vertex buffer
std::vector<VertexAttachment> m_VertexAttachments;
std::vector<std::vector<DescriptorBinding>> m_DescriptorSets; std::vector<std::vector<DescriptorBinding>> m_DescriptorSets;
size_t m_pushConstantSize = 0; size_t m_pushConstantSize = 0;
}; };
......
#pragma once #pragma once
#include <unordered_map>
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include <string> #include <string>
namespace vkcv{ namespace vkcv{
enum class VertexAttachmentFormat{
/* With these enums, 0 is reserved to signal uninitialized or invalid data. */
enum class PrimitiveType : uint32_t {
UNDEFINED = 0,
POSITION = 1,
NORMAL = 2,
TEXCOORD_0 = 3
};
/* This struct describes one vertex attribute of a vertex buffer. */
typedef struct {
PrimitiveType type; // POSITION, NORMAL, ...
uint32_t offset; // offset in bytes
uint32_t length; // length of ... in bytes
uint32_t stride; // stride in bytes
uint16_t componentType; // eg. 5126 for float
uint8_t componentCount; // eg. 3 for vec3
} VertexAttribute;
enum class VertexFormat{
FLOAT, FLOAT,
FLOAT2, FLOAT2,
FLOAT3, FLOAT3,
...@@ -35,23 +16,50 @@ namespace vkcv{ ...@@ -35,23 +16,50 @@ namespace vkcv{
INT4 INT4
}; };
uint32_t getFormatSize(VertexFormat format); uint32_t getFormatSize(VertexAttachmentFormat format);
struct VertexInputAttachment{ struct VertexAttachment{
VertexInputAttachment() = delete; /**
VertexInputAttachment(uint32_t location, uint32_t binding, std::string name, VertexFormat format, uint32_t offset) noexcept; * Describes an individual vertex input attribute/attachment.
* @param inputLocation its location in the vertex shader.
* @param name the name referred to in the shader.
* @param format the format (and therefore, the size) this attachment is in.
* @param offset the attachment's byte offset within a vertex.
*/
VertexAttachment(uint32_t inputLocation, const std::string &name, VertexAttachmentFormat format, uint32_t offset) noexcept;
VertexAttachment() = delete;
uint32_t location; uint32_t inputLocation;
uint32_t binding; std::string name;
std::string name; VertexAttachmentFormat format;
VertexFormat format; uint32_t offset;
uint32_t offset; };
struct VertexBinding{
/**
* Describes all vertex input attachments _one_ buffer contains to create a vertex buffer binding.
* NOTE: multiple vertex layouts may contain various (mutually exclusive) vertex input attachments
* to form one complete vertex buffer binding!
* @param bindingLocation its entry in the buffers that make up the whole vertex buffer.
* @param attachments the vertex input attachments this specific buffer layout contains.
*/
VertexBinding(uint32_t bindingLocation, const std::vector<VertexAttachment> &attachments) noexcept;
VertexBinding() = delete;
uint32_t bindingLocation;
uint32_t stride;
std::vector<VertexAttachment> vertexAttachments;
}; };
struct VertexLayout{ struct VertexLayout{
/**
* Describes the complete layout of one vertex, e.g. all of the vertex input attachments used,
* and all of the buffer bindings that refer to the attachments (for when multiple buffers are used).
* @param bindings bindings the complete vertex buffer is comprised of.
*/
VertexLayout() noexcept; VertexLayout() noexcept;
VertexLayout(const std::vector<VertexInputAttachment> &inputs) noexcept; VertexLayout(const std::vector<VertexBinding> &bindings) noexcept;
std::unordered_map<uint32_t, VertexInputAttachment> attachmentMap;
uint32_t stride; std::vector<VertexBinding> vertexBindings;
}; };
} }
\ No newline at end of file
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <cstdint> #include <cstdint>
#include <vkcv/VertexLayout.hpp>
/* These macros define limits of the following structs. Implementations can /* These macros define limits of the following structs. Implementations can
* test against these limits when performing sanity checks. The main constraint * test against these limits when performing sanity checks. The main constraint
...@@ -53,6 +52,23 @@ enum PrimitiveMode { ...@@ -53,6 +52,23 @@ enum PrimitiveMode {
/* The indices in the index buffer can be of different bit width. */ /* The indices in the index buffer can be of different bit width. */
enum IndexType { UINT32=0, UINT16=1, UINT8=2 }; enum IndexType { UINT32=0, UINT16=1, UINT8=2 };
/* With these enums, 0 is reserved to signal uninitialized or invalid data. */
enum class PrimitiveType : uint32_t {
UNDEFINED = 0,
POSITION = 1,
NORMAL = 2,
TEXCOORD_0 = 3
};
/* This struct describes one vertex attribute of a vertex buffer. */
typedef struct {
PrimitiveType type; // POSITION, NORMAL, ...
uint32_t offset; // offset in bytes
uint32_t length; // length of ... in bytes
uint32_t stride; // stride in bytes
uint16_t componentType; // eg. 5126 for float
uint8_t componentCount; // eg. 3 for vec3
} VertexAttribute;
typedef struct { typedef struct {
// TODO not yet needed for the first (unlit) triangle // TODO not yet needed for the first (unlit) triangle
} Material; } Material;
...@@ -71,7 +87,7 @@ typedef struct { ...@@ -71,7 +87,7 @@ typedef struct {
} indexBuffer; } indexBuffer;
struct { struct {
std::vector<uint8_t> data; // binary data of the vertex buffer std::vector<uint8_t> data; // binary data of the vertex buffer
std::vector<VertexAttribute> attributes; std::vector<VertexAttribute> attributes; // description of one
} vertexBuffer; } vertexBuffer;
struct { float x, y, z; } min; // bounding box lower left struct { float x, y, z; } min; // bounding box lower left
struct { float x, y, z; } max; // bounding box upper right struct { float x, y, z; } max; // bounding box upper right
......
...@@ -65,7 +65,7 @@ int main(int argc, const char** argv) { ...@@ -65,7 +65,7 @@ int main(int argc, const char** argv) {
auto& attributes = mesh.vertexGroups[0].vertexBuffer.attributes; auto& attributes = mesh.vertexGroups[0].vertexBuffer.attributes;
std::sort(attributes.begin(), attributes.end(), [](const vkcv::VertexAttribute& x, const vkcv::VertexAttribute& y) { std::sort(attributes.begin(), attributes.end(), [](const vkcv::asset::VertexAttribute& x, const vkcv::asset::VertexAttribute& y) {
return static_cast<uint32_t>(x.type) < static_cast<uint32_t>(y.type); return static_cast<uint32_t>(x.type) < static_cast<uint32_t>(y.type);
}); });
...@@ -89,34 +89,45 @@ int main(int argc, const char** argv) { ...@@ -89,34 +89,45 @@ int main(int argc, const char** argv) {
vk::Format::eD32Sfloat vk::Format::eD32Sfloat
); );
vkcv::PassConfig trianglePassDefinition({ present_color_attachment, depth_attachment }); vkcv::PassConfig firstMeshPassDefinition({ present_color_attachment, depth_attachment });
vkcv::PassHandle trianglePass = core.createPass(trianglePassDefinition); vkcv::PassHandle firstMeshPass = core.createPass(firstMeshPassDefinition);
if (!trianglePass) { if (!firstMeshPass) {
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;
} }
vkcv::ShaderProgram triangleShaderProgram{}; vkcv::ShaderProgram firstMeshProgram{};
triangleShaderProgram.addShader(vkcv::ShaderStage::VERTEX, std::filesystem::path("resources/shaders/vert.spv")); firstMeshProgram.addShader(vkcv::ShaderStage::VERTEX, std::filesystem::path("resources/shaders/vert.spv"));
triangleShaderProgram.addShader(vkcv::ShaderStage::FRAGMENT, std::filesystem::path("resources/shaders/frag.spv")); firstMeshProgram.addShader(vkcv::ShaderStage::FRAGMENT, std::filesystem::path("resources/shaders/frag.spv"));
triangleShaderProgram.reflectShader(vkcv::ShaderStage::VERTEX);
triangleShaderProgram.reflectShader(vkcv::ShaderStage::FRAGMENT);
std::vector<vkcv::DescriptorBinding> descriptorBindings = { triangleShaderProgram.getReflectedDescriptors()[0] }; /**
* TODO:
* Since the framework's vertex layout specification is now separate
* from that defined in the asset loader module, there needs to be a smarter way to translate the asset loader's
* specific layout into "our" uniform vertex layout spec.
*
* This is just a quick hack.
*/
const std::vector<vkcv::VertexAttachment> vertexAttachments = firstMeshProgram.getVertexAttachments();
const vkcv::VertexBinding vertexBinding(0, vertexAttachments);
const vkcv::VertexLayout firstMeshLayout({vertexBinding});
std::vector<vkcv::DescriptorBinding> descriptorBindings = { firstMeshProgram.getReflectedDescriptors()[0] };
vkcv::DescriptorSetHandle descriptorSet = core.createDescriptorSet(descriptorBindings); vkcv::DescriptorSetHandle descriptorSet = core.createDescriptorSet(descriptorBindings);
const vkcv::PipelineConfig trianglePipelineDefinition( const vkcv::PipelineConfig firstMeshPipelineConfig(
triangleShaderProgram, firstMeshProgram,
windowWidth, windowWidth,
windowHeight, windowHeight,
trianglePass, firstMeshPass,
attributes, {firstMeshLayout},
{ core.getDescriptorSet(descriptorSet).layout }, { core.getDescriptorSet(descriptorSet).layout },
true); true);
vkcv::PipelineHandle trianglePipeline = core.createGraphicsPipeline(trianglePipelineDefinition); vkcv::PipelineHandle firstMeshPipeline = core.createGraphicsPipeline(firstMeshPipelineConfig);
if (!trianglePipeline) { if (!firstMeshPipeline) {
std::cout << "Error. Could not create graphics pipeline. Exiting." << std::endl; std::cout << "Error. Could not create graphics pipeline. Exiting." << std::endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
...@@ -169,8 +180,6 @@ int main(int argc, const char** argv) { ...@@ -169,8 +180,6 @@ int main(int argc, const char** argv) {
vkcv::ShaderProgram shadowShader; vkcv::ShaderProgram shadowShader;
shadowShader.addShader(vkcv::ShaderStage::VERTEX, "resources/shaders/shadow_vert.spv"); shadowShader.addShader(vkcv::ShaderStage::VERTEX, "resources/shaders/shadow_vert.spv");
shadowShader.addShader(vkcv::ShaderStage::FRAGMENT, "resources/shaders/shadow_frag.spv"); shadowShader.addShader(vkcv::ShaderStage::FRAGMENT, "resources/shaders/shadow_frag.spv");
shadowShader.reflectShader(vkcv::ShaderStage::VERTEX);
shadowShader.reflectShader(vkcv::ShaderStage::FRAGMENT);
const vk::Format shadowMapFormat = vk::Format::eD16Unorm; const vk::Format shadowMapFormat = vk::Format::eD16Unorm;
const std::vector<vkcv::AttachmentDescription> shadowAttachments = { const std::vector<vkcv::AttachmentDescription> shadowAttachments = {
...@@ -185,8 +194,8 @@ int main(int argc, const char** argv) { ...@@ -185,8 +194,8 @@ int main(int argc, const char** argv) {
shadowShader, shadowShader,
shadowMapResolution, shadowMapResolution,
shadowMapResolution, shadowMapResolution,
shadowPass, shadowPass,
attributes, {firstMeshLayout},
{}, {},
false); false);
const vkcv::PipelineHandle shadowPipe = core.createGraphicsPipeline(shadowPipeConfig); const vkcv::PipelineHandle shadowPipe = core.createGraphicsPipeline(shadowPipeConfig);
...@@ -281,8 +290,8 @@ int main(int argc, const char** argv) { ...@@ -281,8 +290,8 @@ int main(int argc, const char** argv) {
core.recordDrawcallsToCmdStream( core.recordDrawcallsToCmdStream(
cmdStream, cmdStream,
trianglePass, firstMeshPass,
trianglePipeline, firstMeshPipeline,
pushConstantData, pushConstantData,
drawcalls, drawcalls,
renderTargets); renderTargets);
......
...@@ -74,41 +74,46 @@ int main(int argc, const char** argv) { ...@@ -74,41 +74,46 @@ int main(int argc, const char** argv) {
vk::Format::eD32Sfloat vk::Format::eD32Sfloat
); );
vkcv::PassConfig trianglePassDefinition({ present_color_attachment, depth_attachment }); vkcv::PassConfig firstMeshPassDefinition({ present_color_attachment, depth_attachment });
vkcv::PassHandle trianglePass = core.createPass(trianglePassDefinition); vkcv::PassHandle firstMeshPass = core.createPass(firstMeshPassDefinition);
if (!trianglePass) { if (!firstMeshPass) {
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;
} }
vkcv::ShaderProgram triangleShaderProgram{}; vkcv::ShaderProgram firstMeshProgram{};
triangleShaderProgram.addShader(vkcv::ShaderStage::VERTEX, std::filesystem::path("resources/shaders/vert.spv")); firstMeshProgram.addShader(vkcv::ShaderStage::VERTEX, std::filesystem::path("resources/shaders/vert.spv"));
triangleShaderProgram.addShader(vkcv::ShaderStage::FRAGMENT, std::filesystem::path("resources/shaders/frag.spv")); firstMeshProgram.addShader(vkcv::ShaderStage::FRAGMENT, std::filesystem::path("resources/shaders/frag.spv"));
triangleShaderProgram.reflectShader(vkcv::ShaderStage::VERTEX);
triangleShaderProgram.reflectShader(vkcv::ShaderStage::FRAGMENT); /**
* TODO:
auto& attributes = mesh.vertexGroups[0].vertexBuffer.attributes; * Since the framework's vertex layout specification is now separate
* from that defined in the asset loader module, there needs to be a smarter way to translate the asset loader's
std::sort(attributes.begin(), attributes.end(), [](const vkcv::VertexAttribute& x, const vkcv::VertexAttribute& y) { * specific layout into "our" uniform vertex layout spec.
return static_cast<uint32_t>(x.type) < static_cast<uint32_t>(y.type); *
}); */
const std::vector<vkcv::VertexAttachment> vertexAttachments = firstMeshProgram.getVertexAttachments();
const vkcv::VertexBinding vertexBinding(0, vertexAttachments);
const vkcv::VertexLayout firstMeshLayout({vertexBinding});
uint32_t setID = 0; uint32_t setID = 0;
std::vector<vkcv::DescriptorBinding> descriptorBindings = { triangleShaderProgram.getReflectedDescriptors()[setID] }; std::vector<vkcv::DescriptorBinding> descriptorBindings = { firstMeshProgram.getReflectedDescriptors()[setID] };
vkcv::DescriptorSetHandle descriptorSet = core.createDescriptorSet(descriptorBindings); vkcv::DescriptorSetHandle descriptorSet = core.createDescriptorSet(descriptorBindings);
const vkcv::PipelineConfig trianglePipelineDefinition( const vkcv::PipelineConfig firstMeshPipelineConfig(
triangleShaderProgram, firstMeshProgram,
UINT32_MAX, UINT32_MAX,
UINT32_MAX, UINT32_MAX,
trianglePass, firstMeshPass,
mesh.vertexGroups[0].vertexBuffer.attributes, {firstMeshLayout},
{ core.getDescriptorSet(descriptorSet).layout }, { core.getDescriptorSet(descriptorSet).layout },
true); true);
vkcv::PipelineHandle trianglePipeline = core.createGraphicsPipeline(trianglePipelineDefinition); vkcv::PipelineHandle firstMeshPipeline = core.createGraphicsPipeline(firstMeshPipelineConfig);
if (!trianglePipeline) { if (!firstMeshPipeline) {
std::cout << "Error. Could not create graphics pipeline. Exiting." << std::endl; std::cout << "Error. Could not create graphics pipeline. Exiting." << std::endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
...@@ -123,11 +128,22 @@ int main(int argc, const char** argv) { ...@@ -123,11 +128,22 @@ int main(int argc, const char** argv) {
vkcv::SamplerAddressMode::REPEAT vkcv::SamplerAddressMode::REPEAT
); );
auto& attributes = mesh.vertexGroups[0].vertexBuffer.attributes;
std::sort(attributes.begin(), attributes.end(), [](const vkcv::asset::VertexAttribute& x, const vkcv::asset::VertexAttribute& y) {
return static_cast<uint32_t>(x.type) < static_cast<uint32_t>(y.type);
});
/*
const std::vector<vkcv::VertexBufferBinding> vertexBufferBindings = { const std::vector<vkcv::VertexBufferBinding> vertexBufferBindings = {
vkcv::VertexBufferBinding( mesh.vertexGroups[0].vertexBuffer.attributes[0].offset, vertexBuffer.getVulkanHandle() ), vkcv::VertexBufferBinding( static_cast<vk::DeviceSize>(mesh.vertexGroups[0].vertexBuffer.attributes[0].offset), vertexBuffer.getVulkanHandle() ),
vkcv::VertexBufferBinding( mesh.vertexGroups[0].vertexBuffer.attributes[1].offset, vertexBuffer.getVulkanHandle() ), vkcv::VertexBufferBinding( static_cast<vk::DeviceSize>(mesh.vertexGroups[0].vertexBuffer.attributes[1].offset), vertexBuffer.getVulkanHandle() ),
vkcv::VertexBufferBinding( mesh.vertexGroups[0].vertexBuffer.attributes[2].offset, vertexBuffer.getVulkanHandle() ) vkcv::VertexBufferBinding( static_cast<vk::DeviceSize>(mesh.vertexGroups[0].vertexBuffer.attributes[2].offset), vertexBuffer.getVulkanHandle() )
}; };
*/
const std::vector<vkcv::VertexBufferBinding> vertexBufferBindings = {
vkcv::VertexBufferBinding( 0, vertexBuffer.getVulkanHandle() ),
};
vkcv::DescriptorWrites setWrites; vkcv::DescriptorWrites setWrites;
setWrites.sampledImageWrites = { vkcv::SampledImageDescriptorWrite(0, texture.getHandle()) }; setWrites.sampledImageWrites = { vkcv::SampledImageDescriptorWrite(0, texture.getHandle()) };
...@@ -175,8 +191,8 @@ int main(int argc, const char** argv) { ...@@ -175,8 +191,8 @@ int main(int argc, const char** argv) {
core.recordDrawcallsToCmdStream( core.recordDrawcallsToCmdStream(
cmdStream, cmdStream,
trianglePass, firstMeshPass,
trianglePipeline, firstMeshPipeline,
pushConstantData, pushConstantData,
{ drawcall }, { drawcall },
renderTargets); renderTargets);
......
...@@ -96,8 +96,6 @@ int main(int argc, const char** argv) { ...@@ -96,8 +96,6 @@ int main(int argc, const char** argv) {
vkcv::ShaderProgram triangleShaderProgram{}; vkcv::ShaderProgram triangleShaderProgram{};
triangleShaderProgram.addShader(vkcv::ShaderStage::VERTEX, std::filesystem::path("shaders/vert.spv")); triangleShaderProgram.addShader(vkcv::ShaderStage::VERTEX, std::filesystem::path("shaders/vert.spv"));
triangleShaderProgram.addShader(vkcv::ShaderStage::FRAGMENT, std::filesystem::path("shaders/frag.spv")); triangleShaderProgram.addShader(vkcv::ShaderStage::FRAGMENT, std::filesystem::path("shaders/frag.spv"));
triangleShaderProgram.reflectShader(vkcv::ShaderStage::VERTEX);
triangleShaderProgram.reflectShader(vkcv::ShaderStage::FRAGMENT);
const vkcv::PipelineConfig trianglePipelineDefinition( const vkcv::PipelineConfig trianglePipelineDefinition(
triangleShaderProgram, triangleShaderProgram,
...@@ -119,7 +117,6 @@ int main(int argc, const char** argv) { ...@@ -119,7 +117,6 @@ int main(int argc, const char** argv) {
// Compute Pipeline // Compute Pipeline
vkcv::ShaderProgram computeShaderProgram{}; vkcv::ShaderProgram computeShaderProgram{};
computeShaderProgram.addShader(vkcv::ShaderStage::COMPUTE, std::filesystem::path("shaders/comp.spv")); computeShaderProgram.addShader(vkcv::ShaderStage::COMPUTE, std::filesystem::path("shaders/comp.spv"));
computeShaderProgram.reflectShader(vkcv::ShaderStage::COMPUTE);
// take care, assuming shader has exactly one descriptor set // take care, assuming shader has exactly one descriptor set
vkcv::DescriptorSetHandle computeDescriptorSet = core.createDescriptorSet(computeShaderProgram.getReflectedDescriptors()[0]); vkcv::DescriptorSetHandle computeDescriptorSet = core.createDescriptorSet(computeShaderProgram.getReflectedDescriptors()[0]);
......
...@@ -13,7 +13,7 @@ namespace vkcv { ...@@ -13,7 +13,7 @@ namespace vkcv {
uint32_t width, uint32_t width,
uint32_t height, uint32_t height,
const PassHandle &passHandle, const PassHandle &passHandle,
const std::vector<VertexAttribute> &vertexAttributes, const VertexLayout &vertexLayout,
const std::vector<vk::DescriptorSetLayout> &descriptorLayouts, const std::vector<vk::DescriptorSetLayout> &descriptorLayouts,
bool useDynamicViewport) bool useDynamicViewport)
: :
...@@ -21,7 +21,7 @@ namespace vkcv { ...@@ -21,7 +21,7 @@ namespace vkcv {
m_Height(height), m_Height(height),
m_Width(width), m_Width(width),
m_PassHandle(passHandle), m_PassHandle(passHandle),
m_VertexAttributes(vertexAttributes), m_VertexLayout(vertexLayout),
m_DescriptorLayouts(descriptorLayouts), m_DescriptorLayouts(descriptorLayouts),
m_UseDynamicViewport(useDynamicViewport) m_UseDynamicViewport(useDynamicViewport)
{} {}
......
...@@ -19,23 +19,23 @@ namespace vkcv ...@@ -19,23 +19,23 @@ namespace vkcv
} }