Skip to content

Commit c0f5ce8

Browse files
Fix shader Specification and paths
1 parent 74aaabc commit c0f5ce8

7 files changed

Lines changed: 17 additions & 18 deletions

File tree

Obelisk/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ target_link_libraries(${TARGET_NAME} PUBLIC
5050
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
5151

5252
install(TARGETS ${TARGET_NAME}
53-
DESTINATION bin/Editor
53+
DESTINATION bin
5454
)
5555

56-
install(DIRECTORY ../Resources/Editor DESTINATION bin)
56+
install(DIRECTORY ../Resources/Editor/Settings DESTINATION bin)
5757

58-
install(DIRECTORY ../Resources/Shaders DESTINATION bin/Editor)
58+
install(DIRECTORY ../Resources/Shaders DESTINATION bin)
5959

6060

6161

Panzerfaust/Service/EngineService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public EngineService()
2424
#if _WIN32
2525
engineExtension = ".exe";
2626
#endif
27-
_enginePath = Path.Combine(Environment.CurrentDirectory, "Editor", $"{_launcherCLIAppName}{engineExtension}");
28-
_workingDirectory = Path.Combine(Environment.CurrentDirectory, "Editor");
27+
_enginePath = Path.Combine(Environment.CurrentDirectory, $"{_launcherCLIAppName}{engineExtension}");
28+
_workingDirectory = Environment.CurrentDirectory;
2929
}
3030

3131
public async Task StartAsync(string path)

ZEngine/ZEngine/Hardwares/VulkanDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ namespace ZEngine::Hardwares
14781478

14791479
Helpers::Handle<Rendering::Shaders::Shader> VulkanDevice::CompileShader(Rendering::Specifications::ShaderSpecification& spec)
14801480
{
1481-
const char* base_dir = "Editor/Shaders/Cache/";
1481+
const char* base_dir = "Shaders/Cache/";
14821482
const char* vertex_name_part = "_vertex.spv";
14831483
const char* fragment_name_part = "_fragment.spv";
14841484

ZEngine/ZEngine/Hardwares/VulkanDevice.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace ZEngine::Hardwares
7777
VkBuffer Handle = VK_NULL_HANDLE;
7878
VmaAllocation Allocation = nullptr;
7979

80-
operator bool() const
80+
operator bool() const
8181
{
8282
return (Handle != VK_NULL_HANDLE);
8383
}
@@ -91,7 +91,7 @@ namespace ZEngine::Hardwares
9191
VkSampler Sampler{VK_NULL_HANDLE};
9292
VmaAllocation Allocation{nullptr};
9393

94-
operator bool() const
94+
operator bool() const
9595
{
9696
return (Handle != VK_NULL_HANDLE);
9797
}

ZEngine/ZEngine/Rendering/Shaders/Shader.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ namespace ZEngine::Rendering::Shaders
9898
LayoutBindingSpecificationMap[set].init(m_device->Arena, 10);
9999
}
100100

101-
LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = UB_resource.name, .DescriptorTypeValue = DescriptorType::UNIFORM_BUFFER, .Flags = ShaderStageFlags::VERTEX});
101+
LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = UB_resource.name.c_str(), .DescriptorTypeValue = DescriptorType::UNIFORM_BUFFER, .Flags = ShaderStageFlags::VERTEX});
102102
}
103103

104104
for (const auto& SB_resource : vertex_resources.storage_buffers)
@@ -111,7 +111,7 @@ namespace ZEngine::Rendering::Shaders
111111
LayoutBindingSpecificationMap[set].init(m_device->Arena, 10);
112112
}
113113

114-
LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = SB_resource.name, .DescriptorTypeValue = DescriptorType::STORAGE_BUFFER, .Flags = ShaderStageFlags::VERTEX});
114+
LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = SB_resource.name.c_str(), .DescriptorTypeValue = DescriptorType::STORAGE_BUFFER, .Flags = ShaderStageFlags::VERTEX});
115115
}
116116

117117
for (const auto& pushConstant_resource : vertex_resources.push_constant_buffers)
@@ -127,7 +127,7 @@ namespace ZEngine::Rendering::Shaders
127127
uint32_t memberSize = spirv_compiler->get_declared_struct_member_size(type, i);
128128
struct_total_size += memberSize;
129129
}
130-
PushConstantSpecifications.push(PushConstantSpecification{.Name = pushConstant_resource.name, .Size = struct_total_size, .Offset = struct_offset, .Flags = ShaderStageFlags::VERTEX});
130+
PushConstantSpecifications.push(PushConstantSpecification{.Name = pushConstant_resource.name.c_str(), .Size = struct_total_size, .Offset = struct_offset, .Flags = ShaderStageFlags::VERTEX});
131131
/*
132132
* We update the offset for next iteration
133133
*/
@@ -167,7 +167,7 @@ namespace ZEngine::Rendering::Shaders
167167
LayoutBindingSpecificationMap[set].init(m_device->Arena, 10);
168168
}
169169

170-
LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = UB_resource.name, .DescriptorTypeValue = DescriptorType::UNIFORM_BUFFER, .Flags = ShaderStageFlags::FRAGMENT});
170+
LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = UB_resource.name.c_str(), .DescriptorTypeValue = DescriptorType::UNIFORM_BUFFER, .Flags = ShaderStageFlags::FRAGMENT});
171171
}
172172

173173
for (const auto& SB_resource : fragment_resources.storage_buffers)
@@ -180,7 +180,7 @@ namespace ZEngine::Rendering::Shaders
180180
LayoutBindingSpecificationMap[set].init(m_device->Arena, 10);
181181
}
182182

183-
LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = SB_resource.name, .DescriptorTypeValue = DescriptorType::STORAGE_BUFFER, .Flags = ShaderStageFlags::FRAGMENT});
183+
LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = SB_resource.name.c_str(), .DescriptorTypeValue = DescriptorType::STORAGE_BUFFER, .Flags = ShaderStageFlags::FRAGMENT});
184184
}
185185

186186
for (const auto& pushConstant_resource : fragment_resources.push_constant_buffers)
@@ -196,7 +196,7 @@ namespace ZEngine::Rendering::Shaders
196196
uint32_t memberSize = spirv_compiler->get_declared_struct_member_size(type, i);
197197
struct_total_size += memberSize;
198198
}
199-
PushConstantSpecifications.push(PushConstantSpecification{.Name = pushConstant_resource.name, .Size = struct_total_size, .Offset = struct_offset, .Flags = ShaderStageFlags::FRAGMENT});
199+
PushConstantSpecifications.push(PushConstantSpecification{.Name = pushConstant_resource.name.c_str(), .Size = struct_total_size, .Offset = struct_offset, .Flags = ShaderStageFlags::FRAGMENT});
200200
/*
201201
* We update the offset for next iteration
202202
*/
@@ -225,7 +225,7 @@ namespace ZEngine::Rendering::Shaders
225225
LayoutBindingSpecificationMap[set].init(m_device->Arena, 10);
226226
}
227227

228-
LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Count = count, .Name = SI_resource.name, .DescriptorTypeValue = DescriptorType::COMBINED_IMAGE_SAMPLER, .Flags = ShaderStageFlags::FRAGMENT});
228+
LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Count = count, .Name = SI_resource.name.c_str(), .DescriptorTypeValue = DescriptorType::COMBINED_IMAGE_SAMPLER, .Flags = ShaderStageFlags::FRAGMENT});
229229
}
230230
}
231231
}

ZEngine/ZEngine/Rendering/Specifications/ShaderSpecification.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ namespace ZEngine::Rendering::Specifications
3838
uint32_t Set{0xFFFFFFFF};
3939
uint32_t Binding{0xFFFFFFFF};
4040
uint32_t Count{1};
41-
std::string Name;
41+
const char* Name;
4242
DescriptorType DescriptorTypeValue;
4343
ShaderStageFlags Flags;
4444
};
4545

4646
struct PushConstantSpecification
4747
{
48-
std::string Name;
48+
const char* Name;
4949
uint32_t Size;
5050
uint32_t Offset;
5151
ShaderStageFlags Flags;

ZEngine/ZEngine/Windows/GameWindow.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#pragma once
2-
#define GLFW_INCLUDE_VULKAN
32
#include <Core/Memory/Allocator.h>
43
#include <CoreWindow.h>
54
#include <GLFW/glfw3.h>

0 commit comments

Comments
 (0)