Browse Source

Update shader bytecode adresses

master
AliMehrabani 2 weeks ago
parent
commit
663ba33d28
  1. 10
      VulkanTutorial1.0/ComputeAndGraphics.cpp

10
VulkanTutorial1.0/ComputeAndGraphics.cpp

@ -637,7 +637,7 @@ void ComputeAndGraphics::createDescriptorSetLayout() {
VkDescriptorSetLayoutBinding samplerLayoutBinding = createLayoutBindingInfo(1, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT); VkDescriptorSetLayoutBinding samplerLayoutBinding = createLayoutBindingInfo(1, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT);
std::array<VkDescriptorSetLayoutBinding, 2> bindings = {uboLayoutBinding, samplerLayoutBinding}; std::vector<VkDescriptorSetLayoutBinding> bindings = {uboLayoutBinding, samplerLayoutBinding};
VkDescriptorSetLayoutCreateInfo layoutInfo{}; VkDescriptorSetLayoutCreateInfo layoutInfo{};
layoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; layoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
layoutInfo.bindingCount = static_cast<uint32_t>(bindings.size()); layoutInfo.bindingCount = static_cast<uint32_t>(bindings.size());
@ -655,7 +655,7 @@ void ComputeAndGraphics::createComputeDescriptorSetLayout() {
VkDescriptorSetLayoutBinding computeLayoutBinding2 = createLayoutBindingInfo(3, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_SHADER_STAGE_COMPUTE_BIT); VkDescriptorSetLayoutBinding computeLayoutBinding2 = createLayoutBindingInfo(3, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_SHADER_STAGE_COMPUTE_BIT);
std::array<VkDescriptorSetLayoutBinding, 3> bindings = {uboLayoutBinding, computeLayoutBinding1, computeLayoutBinding2}; std::vector<VkDescriptorSetLayoutBinding> bindings = {uboLayoutBinding, computeLayoutBinding1, computeLayoutBinding2};
VkDescriptorSetLayoutCreateInfo layoutInfo{}; VkDescriptorSetLayoutCreateInfo layoutInfo{};
layoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; layoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
layoutInfo.bindingCount = static_cast<uint32_t>(bindings.size()); layoutInfo.bindingCount = static_cast<uint32_t>(bindings.size());
@ -680,8 +680,8 @@ VkDescriptorSetLayoutBinding ComputeAndGraphics::createLayoutBindingInfo(uint32_
void ComputeAndGraphics::createGraphicsPipeline() void ComputeAndGraphics::createGraphicsPipeline()
{ {
auto vertShaderCode = readFile("shaders/vertComp.spv"); auto vertShaderCode = readFile("shaders/VulkanTutorial1.0/ComputeAndGraphics/vertComp.spv");
auto fragShaderCode = readFile("shaders/fragComp.spv"); auto fragShaderCode = readFile("shaders/VulkanTutorial1.0/ComputeAndGraphics/fragComp.spv");
VkShaderModule vertShaderModule = createShaderModule(vertShaderCode); VkShaderModule vertShaderModule = createShaderModule(vertShaderCode);
VkShaderModule fragShaderModule = createShaderModule(fragShaderCode); VkShaderModule fragShaderModule = createShaderModule(fragShaderCode);
VkPipelineShaderStageCreateInfo vertShaderStageInfo = createPipelineShaderInfo(VK_SHADER_STAGE_VERTEX_BIT, vertShaderModule); VkPipelineShaderStageCreateInfo vertShaderStageInfo = createPipelineShaderInfo(VK_SHADER_STAGE_VERTEX_BIT, vertShaderModule);
@ -890,7 +890,7 @@ VkPipelineColorBlendStateCreateInfo ComputeAndGraphics::colorPipelineBlendStateI
void ComputeAndGraphics::createComputePipeline() void ComputeAndGraphics::createComputePipeline()
{ {
auto computeShaderCode = readFile("shaders/compComp.spv"); auto computeShaderCode = readFile("shaders/VulkanTutorial1.0/ComputeAndGraphics/compComp.spv");
VkShaderModule computeShaderModule = createShaderModule(computeShaderCode); VkShaderModule computeShaderModule = createShaderModule(computeShaderCode);
VkPipelineShaderStageCreateInfo computeShaderStageInfo = createPipelineShaderInfo(VK_SHADER_STAGE_COMPUTE_BIT, computeShaderModule); VkPipelineShaderStageCreateInfo computeShaderStageInfo = createPipelineShaderInfo(VK_SHADER_STAGE_COMPUTE_BIT, computeShaderModule);

Loading…
Cancel
Save