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
|
|
@ -51,7 +51,7 @@ void* alignedAlloc(size_t size, size_t alignment)
|
|||
void *data = nullptr;
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
data = _aligned_malloc(size, alignment);
|
||||
#else
|
||||
#else
|
||||
int res = posix_memalign(&data, alignment, size);
|
||||
if (res != 0)
|
||||
data = nullptr;
|
||||
|
|
@ -63,7 +63,7 @@ void alignedFree(void* data)
|
|||
{
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
_aligned_free(data);
|
||||
#else
|
||||
#else
|
||||
free(data);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ public:
|
|||
alignedFree(uboDataDynamic.model);
|
||||
}
|
||||
|
||||
// Clean up used Vulkan resources
|
||||
// Clean up used Vulkan resources
|
||||
// Note : Inherited destructor cleans up resources stored in base class
|
||||
vkDestroyPipeline(device, pipeline, nullptr);
|
||||
|
||||
|
|
@ -224,8 +224,8 @@ public:
|
|||
{ { -1.0f, 1.0f, -1.0f },{ 0.0f, 0.0f, 0.0f } },
|
||||
};
|
||||
|
||||
std::vector<uint32_t> indices = {
|
||||
0,1,2, 2,3,0, 1,5,6, 6,2,1, 7,6,5, 5,4,7, 4,0,3, 3,7,4, 4,5,1, 1,0,4, 3,2,6, 6,7,3,
|
||||
std::vector<uint32_t> indices = {
|
||||
0,1,2, 2,3,0, 1,5,6, 6,2,1, 7,6,5, 5,4,7, 4,0,3, 3,7,4, 4,5,1, 1,0,4, 3,2,6, 6,7,3,
|
||||
};
|
||||
|
||||
indexCount = static_cast<uint32_t>(indices.size());
|
||||
|
|
@ -322,7 +322,7 @@ public:
|
|||
VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &descriptorSet));
|
||||
|
||||
std::vector<VkWriteDescriptorSet> writeDescriptorSets = {
|
||||
// Binding 0 : Projection/View matrix uniform buffer
|
||||
// Binding 0 : Projection/View matrix uniform buffer
|
||||
vks::initializers::writeDescriptorSet(descriptorSet, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 0, &uniformBuffers.view.descriptor),
|
||||
// Binding 1 : Instance matrix as dynamic uniform buffer
|
||||
vks::initializers::writeDescriptorSet(descriptorSet, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, 1, &uniformBuffers.dynamic.descriptor),
|
||||
|
|
@ -383,8 +383,8 @@ public:
|
|||
// Load shaders
|
||||
std::array<VkPipelineShaderStageCreateInfo, 2> shaderStages;
|
||||
|
||||
shaderStages[0] = loadShader(getAssetPath() + "shaders/dynamicuniformbuffer/base.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
|
||||
shaderStages[1] = loadShader(getAssetPath() + "shaders/dynamicuniformbuffer/base.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
|
||||
shaderStages[0] = loadShader(getShadersPath() + "dynamicuniformbuffer/base.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
|
||||
shaderStages[1] = loadShader(getShadersPath() + "dynamicuniformbuffer/base.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
|
||||
|
||||
VkGraphicsPipelineCreateInfo pipelineCreateInfo =
|
||||
vks::initializers::pipelineCreateInfo(
|
||||
|
|
@ -507,7 +507,7 @@ public:
|
|||
animationTimer = 0.0f;
|
||||
|
||||
memcpy(uniformBuffers.dynamic.mapped, uboDataDynamic.model, uniformBuffers.dynamic.size);
|
||||
// Flush to make changes visible to the host
|
||||
// Flush to make changes visible to the host
|
||||
VkMappedMemoryRange memoryRange = vks::initializers::mappedMemoryRange();
|
||||
memoryRange.memory = uniformBuffers.dynamic.memory;
|
||||
memoryRange.size = uniformBuffers.dynamic.size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue