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:
Ben Clayton 2020-05-29 16:08:53 +01:00
parent cac1d2e850
commit ca884587a4
1043 changed files with 1207 additions and 1201 deletions

View file

@ -166,7 +166,7 @@ public:
uniformBuffers.object.destroy();
uniformBuffers.skybox.destroy();
uniformBuffers.params.destroy();
textures.environmentCube.destroy();
textures.irradianceCube.destroy();
textures.prefilteredCube.destroy();
@ -232,7 +232,7 @@ public:
Material mat = materials[materialIndex];
#define SINGLE_ROW 1
#define SINGLE_ROW 1
#ifdef SINGLE_ROW
uint32_t objcount = 10;
for (uint32_t x = 0; x < objcount; x++) {
@ -400,13 +400,13 @@ public:
pipelineCreateInfo.pVertexInputState = &vertexInputState;
// Skybox pipeline (background cube)
shaderStages[0] = loadShader(getAssetPath() + "shaders/pbribl/skybox.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getAssetPath() + "shaders/pbribl/skybox.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
shaderStages[0] = loadShader(getShadersPath() + "pbribl/skybox.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getShadersPath() + "pbribl/skybox.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.skybox));
// PBR pipeline
shaderStages[0] = loadShader(getAssetPath() + "shaders/pbribl/pbribl.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getAssetPath() + "shaders/pbribl/pbribl.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
shaderStages[0] = loadShader(getShadersPath() + "pbribl/pbribl.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getShadersPath() + "pbribl/pbribl.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
// Enable depth test and write
depthStencilState.depthWriteEnable = VK_TRUE;
depthStencilState.depthTestEnable = VK_TRUE;
@ -523,7 +523,7 @@ public:
framebufferCI.width = dim;
framebufferCI.height = dim;
framebufferCI.layers = 1;
VkFramebuffer framebuffer;
VK_CHECK_RESULT(vkCreateFramebuffer(device, &framebufferCI, nullptr, &framebuffer));
@ -575,8 +575,8 @@ public:
pipelineCI.pVertexInputState = &emptyInputState;
// Look-up-table (from BRDF) pipeline
shaderStages[0] = loadShader(getAssetPath() + "shaders/pbribl/genbrdflut.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getAssetPath() + "shaders/pbribl/genbrdflut.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
shaderStages[0] = loadShader(getShadersPath() + "pbribl/genbrdflut.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getShadersPath() + "pbribl/genbrdflut.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
VkPipeline pipeline;
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipeline));
@ -604,7 +604,7 @@ public:
vulkanDevice->flushCommandBuffer(cmdBuf, queue);
vkQueueWaitIdle(queue);
// todo: cleanup
vkDestroyPipeline(device, pipeline, nullptr);
vkDestroyPipelineLayout(device, pipelinelayout, nullptr);
@ -861,8 +861,8 @@ public:
pipelineCI.pVertexInputState = &vertexInputState;
pipelineCI.renderPass = renderpass;
shaderStages[0] = loadShader(getAssetPath() + "shaders/pbribl/filtercube.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getAssetPath() + "shaders/pbribl/irradiancecube.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
shaderStages[0] = loadShader(getShadersPath() + "pbribl/filtercube.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getShadersPath() + "pbribl/irradiancecube.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
VkPipeline pipeline;
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipeline));
@ -977,7 +977,7 @@ public:
1,
&copyRegion);
// Transform framebuffer color attachment back
// Transform framebuffer color attachment back
vks::tools::setImageLayout(
cmdBuf,
offscreen.image,
@ -1255,8 +1255,8 @@ public:
pipelineCI.pVertexInputState = &vertexInputState;
pipelineCI.renderPass = renderpass;
shaderStages[0] = loadShader(getAssetPath() + "shaders/pbribl/filtercube.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getAssetPath() + "shaders/pbribl/prefilterenvmap.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
shaderStages[0] = loadShader(getShadersPath() + "pbribl/filtercube.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getShadersPath() + "pbribl/prefilterenvmap.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
VkPipeline pipeline;
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipeline));
@ -1293,7 +1293,7 @@ public:
VkViewport viewport = vks::initializers::viewport((float)dim, (float)dim, 0.0f, 1.0f);
VkRect2D scissor = vks::initializers::rect2D(dim, dim, 0, 0);
vkCmdSetViewport(cmdBuf, 0, 1, &viewport);
vkCmdSetScissor(cmdBuf, 0, 1, &scissor);
@ -1338,10 +1338,10 @@ public:
vkCmdEndRenderPass(cmdBuf);
vks::tools::setImageLayout(
cmdBuf,
offscreen.image,
VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
cmdBuf,
offscreen.image,
VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
// Copy region for transfer from framebuffer to cube face
@ -1372,7 +1372,7 @@ public:
1,
&copyRegion);
// Transform framebuffer color attachment back
// Transform framebuffer color attachment back
vks::tools::setImageLayout(
cmdBuf,
offscreen.image,