Move shaders into glsl and hlsl directories
Move `data/shaders` to `data/shaders/glsl` Move `data/hlsl` to `data/shaders/hlsl` Fix up shader paths in the cpp files to point to the new glsl location. `data/shaders/hlsl/compile.py` still overwrites the glsl .spv files (for now). Issue: #723
This commit is contained in:
parent
cac1d2e850
commit
ca884587a4
1043 changed files with 1207 additions and 1201 deletions
|
|
@ -159,9 +159,9 @@ public:
|
|||
|
||||
tex->imageLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
vks::tools::setImageLayout(
|
||||
layoutCmd, tex->image,
|
||||
VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
VK_IMAGE_LAYOUT_UNDEFINED,
|
||||
layoutCmd, tex->image,
|
||||
VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
VK_IMAGE_LAYOUT_UNDEFINED,
|
||||
tex->imageLayout);
|
||||
|
||||
vulkanDevice->flushCommandBuffer(layoutCmd, queue, true);
|
||||
|
|
@ -359,7 +359,7 @@ public:
|
|||
void setupDescriptorPool()
|
||||
{
|
||||
std::vector<VkDescriptorPoolSize> poolSizes = {
|
||||
// Graphics pipelines uniform buffers
|
||||
// Graphics pipelines uniform buffers
|
||||
vks::initializers::descriptorPoolSize(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 2),
|
||||
// Graphics pipelines image samplers for displaying compute output image
|
||||
vks::initializers::descriptorPoolSize(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 2),
|
||||
|
|
@ -372,7 +372,7 @@ public:
|
|||
|
||||
void setupDescriptorSetLayout()
|
||||
{
|
||||
std::vector<VkDescriptorSetLayoutBinding> setLayoutBindings = {
|
||||
std::vector<VkDescriptorSetLayoutBinding> setLayoutBindings = {
|
||||
// Binding 0: Vertex shader uniform buffer
|
||||
vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT, 0),
|
||||
// Binding 1: Fragment shader input image
|
||||
|
|
@ -381,7 +381,7 @@ public:
|
|||
|
||||
VkDescriptorSetLayoutCreateInfo descriptorLayout = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBindings);
|
||||
VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &graphics.descriptorSetLayout));
|
||||
|
||||
|
||||
VkPipelineLayoutCreateInfo pPipelineLayoutCreateInfo = vks::initializers::pipelineLayoutCreateInfo(&graphics.descriptorSetLayout, 1);
|
||||
VK_CHECK_RESULT(vkCreatePipelineLayout(device, &pPipelineLayoutCreateInfo, nullptr, &graphics.pipelineLayout));
|
||||
}
|
||||
|
|
@ -401,7 +401,7 @@ public:
|
|||
|
||||
// Final image (after compute shader processing)
|
||||
VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &graphics.descriptorSetPostCompute));
|
||||
std::vector<VkWriteDescriptorSet> writeDescriptorSets = {
|
||||
std::vector<VkWriteDescriptorSet> writeDescriptorSets = {
|
||||
vks::initializers::writeDescriptorSet(graphics.descriptorSetPostCompute, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 0, &uniformBufferVS.descriptor),
|
||||
vks::initializers::writeDescriptorSet(graphics.descriptorSetPostCompute, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, &textureComputeTarget.descriptor)
|
||||
};
|
||||
|
|
@ -462,8 +462,8 @@ public:
|
|||
// Load shaders
|
||||
std::array<VkPipelineShaderStageCreateInfo,2> shaderStages;
|
||||
|
||||
shaderStages[0] = loadShader(getAssetPath() + "shaders/computeshader/texture.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
|
||||
shaderStages[1] = loadShader(getAssetPath() + "shaders/computeshader/texture.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
|
||||
shaderStages[0] = loadShader(getShadersPath() + "computeshader/texture.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
|
||||
shaderStages[1] = loadShader(getShadersPath() + "computeshader/texture.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
|
||||
|
||||
VkGraphicsPipelineCreateInfo pipelineCreateInfo =
|
||||
vks::initializers::pipelineCreateInfo(
|
||||
|
|
@ -554,7 +554,7 @@ public:
|
|||
vks::initializers::descriptorSetAllocateInfo(descriptorPool, &compute.descriptorSetLayout, 1);
|
||||
|
||||
VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &compute.descriptorSet));
|
||||
std::vector<VkWriteDescriptorSet> computeWriteDescriptorSets = {
|
||||
std::vector<VkWriteDescriptorSet> computeWriteDescriptorSets = {
|
||||
vks::initializers::writeDescriptorSet(compute.descriptorSet, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 0, &textureColorMap.descriptor),
|
||||
vks::initializers::writeDescriptorSet(compute.descriptorSet, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1, &textureComputeTarget.descriptor)
|
||||
};
|
||||
|
|
@ -567,7 +567,7 @@ public:
|
|||
// One pipeline for each effect
|
||||
shaderNames = { "emboss", "edgedetect", "sharpen" };
|
||||
for (auto& shaderName : shaderNames) {
|
||||
std::string fileName = getAssetPath() + "shaders/computeshader/" + shaderName + ".comp.spv";
|
||||
std::string fileName = getShadersPath() + "computeshader/" + shaderName + ".comp.spv";
|
||||
computePipelineCreateInfo.stage = loadShader(fileName, VK_SHADER_STAGE_COMPUTE_BIT);
|
||||
VkPipeline pipeline;
|
||||
VK_CHECK_RESULT(vkCreateComputePipelines(device, pipelineCache, 1, &computePipelineCreateInfo, nullptr, &pipeline));
|
||||
|
|
@ -656,7 +656,7 @@ public:
|
|||
setupDescriptorPool();
|
||||
setupDescriptorSet();
|
||||
prepareCompute();
|
||||
buildCommandBuffers();
|
||||
buildCommandBuffers();
|
||||
prepared = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue