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

@ -90,7 +90,7 @@ public:
~VulkanExample()
{
// Clean up used Vulkan resources
// Clean up used Vulkan resources
// Note : Inherited destructor cleans up resources stored in base class
vkDestroyPipeline(device, pipelines.MSAA, nullptr);
vkDestroyPipeline(device, pipelines.MSAASampleShading, nullptr);
@ -113,7 +113,7 @@ public:
uniformBuffer.destroy();
}
// Enable physical device features required for this example
// Enable physical device features required for this example
virtual void getEnabledFeatures()
{
// Enable sample rate shading filtering if supported
@ -122,7 +122,7 @@ public:
}
}
// Creates a multi sample render target (image and view) that is used to resolve
// Creates a multi sample render target (image and view) that is used to resolve
// into the visible frame buffer target in the render pass
void setupMultisampleTarget()
{
@ -204,7 +204,7 @@ public:
{
memAlloc.memoryTypeIndex = vulkanDevice->getMemoryType(memReqs.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
}
VK_CHECK_RESULT(vkAllocateMemory(device, &memAlloc, nullptr, &multisampleTarget.depth.memory));
vkBindImageMemory(device, multisampleTarget.depth.image, multisampleTarget.depth.memory, 0);
@ -223,8 +223,8 @@ public:
VK_CHECK_RESULT(vkCreateImageView(device, &viewInfo, nullptr, &multisampleTarget.depth.view));
}
// Setup a render pass for using a multi sampled attachment
// and a resolve attachment that the msaa image is resolved
// Setup a render pass for using a multi sampled attachment
// and a resolve attachment that the msaa image is resolved
// to at the end of the render pass
void setupRenderPass()
{
@ -323,8 +323,8 @@ public:
VK_CHECK_RESULT(vkCreateRenderPass(device, &renderPassInfo, nullptr, &renderPass));
}
// Frame buffer attachments must match with render pass setup,
// so we need to adjust frame buffer creation to cover our
// Frame buffer attachments must match with render pass setup,
// so we need to adjust frame buffer creation to cover our
// multisample target
void setupFrameBuffer()
{
@ -470,7 +470,7 @@ public:
1);
VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &descriptorSet));
std::vector<VkWriteDescriptorSet> writeDescriptorSets =
{
// Binding 0 : Vertex shader uniform buffer
@ -479,7 +479,7 @@ public:
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
0,
&uniformBuffer.descriptor),
// Binding 1 : Color map
// Binding 1 : Color map
vks::initializers::writeDescriptorSet(
descriptorSet,
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
@ -555,7 +555,7 @@ public:
vks::initializers::vertexInputBindingDescription(VERTEX_BUFFER_BIND_ID, vertexLayout.stride(), VK_VERTEX_INPUT_RATE_VERTEX),
};
std::vector<VkVertexInputAttributeDescription> vertexInputAttributes = {
vks::initializers::vertexInputAttributeDescription(VERTEX_BUFFER_BIND_ID, 0, VK_FORMAT_R32G32B32_SFLOAT, 0), // Location 0: Position
vks::initializers::vertexInputAttributeDescription(VERTEX_BUFFER_BIND_ID, 0, VK_FORMAT_R32G32B32_SFLOAT, 0), // Location 0: Position
vks::initializers::vertexInputAttributeDescription(VERTEX_BUFFER_BIND_ID, 1, VK_FORMAT_R32G32B32_SFLOAT, sizeof(float) * 3), // Location 1: Normal
vks::initializers::vertexInputAttributeDescription(VERTEX_BUFFER_BIND_ID, 2, VK_FORMAT_R32G32_SFLOAT, sizeof(float) * 6), // Location 2: Texture coordinates
vks::initializers::vertexInputAttributeDescription(VERTEX_BUFFER_BIND_ID, 3, VK_FORMAT_R32G32B32_SFLOAT, sizeof(float) * 8), // Location 3: Color
@ -570,11 +570,11 @@ public:
pipelineCI.pVertexInputState = &vertexInputState;
// MSAA rendering pipeline
shaderStages[0] = loadShader(getAssetPath() + "shaders/multisampling/mesh.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getAssetPath() + "shaders/multisampling/mesh.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
shaderStages[0] = loadShader(getShadersPath() + "multisampling/mesh.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getShadersPath() + "multisampling/mesh.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
// Setup multi sampling
multisampleState.rasterizationSamples = sampleCount; // Number of samples to use for rasterization
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.MSAA));