mirror of
https://github.com/Kbz-8/42_vox.git
synced 2026-01-11 06:33:36 +00:00
fixing engine issue
This commit is contained in:
@@ -48,9 +48,7 @@ namespace Scop
|
||||
private:
|
||||
inline static std::size_t s_buffer_count = 0;
|
||||
|
||||
#ifdef SCOP_HAS_DEBUG_UTILS_FUNCTIONS
|
||||
std::string m_name;
|
||||
#endif
|
||||
std::string m_name;
|
||||
|
||||
VkBufferUsageFlags m_usage = 0;
|
||||
VkMemoryPropertyFlags m_flags = 0;
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace Scop
|
||||
bool BindPipeline(VkCommandBuffer) noexcept override { return false; };
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
std::vector<NonOwningPtr<Texture>> m_attachments;
|
||||
std::vector<VkFramebuffer> m_framebuffers;
|
||||
std::vector<VkClearValue> m_clears;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Scop
|
||||
class Shader
|
||||
{
|
||||
public:
|
||||
Shader(const std::vector<std::uint32_t>& bytecode, ShaderType type, ShaderLayout layout);
|
||||
Shader(const std::vector<std::uint32_t>& bytecode, ShaderType type, ShaderLayout layout, std::string shader_name = {});
|
||||
|
||||
[[nodiscard]] inline const ShaderLayout& GetShaderLayout() const { return m_layout; }
|
||||
[[nodiscard]] inline const std::vector<std::uint32_t>& GetByteCode() const noexcept { return m_bytecode; }
|
||||
@@ -64,6 +64,7 @@ namespace Scop
|
||||
void GeneratePipelineLayout(ShaderLayout layout);
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
ShaderLayout m_layout;
|
||||
ShaderPipelineLayoutPart m_pipeline_layout_part;
|
||||
std::vector<std::uint32_t> m_bytecode;
|
||||
|
||||
@@ -18,9 +18,6 @@ namespace Scop
|
||||
p_renderer = descriptor.renderer;
|
||||
p_depth = descriptor.depth;
|
||||
|
||||
m_name = descriptor.name;
|
||||
std::cout << m_name << std::endl;
|
||||
|
||||
std::vector<VkPushConstantRange> push_constants;
|
||||
std::vector<VkDescriptorSetLayout> set_layouts;
|
||||
push_constants.insert(push_constants.end(), p_vertex_shader->GetPipelineLayout().push_constants.begin(), p_vertex_shader->GetPipelineLayout().push_constants.end());
|
||||
@@ -140,7 +137,6 @@ namespace Scop
|
||||
{
|
||||
if(m_pipeline == VK_NULL_HANDLE)
|
||||
return;
|
||||
std::cout << m_name << std::endl;
|
||||
RenderCore::Get().WaitDeviceIdle();
|
||||
|
||||
for(auto& fb : m_framebuffers)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Scop
|
||||
{
|
||||
Shader::Shader(const std::vector<std::uint32_t>& bytecode, ShaderType type, ShaderLayout layout) : m_bytecode(bytecode), m_layout(std::move(layout))
|
||||
Shader::Shader(const std::vector<std::uint32_t>& bytecode, ShaderType type, ShaderLayout layout, std::string name) : m_name(std::move(name)), m_bytecode(bytecode), m_layout(std::move(layout))
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
@@ -15,7 +15,16 @@ namespace Scop
|
||||
default : FatalError("wtf"); break;
|
||||
}
|
||||
m_module = kvfCreateShaderModule(RenderCore::Get().GetDevice(), m_bytecode.data(), m_bytecode.size());
|
||||
Message("Vulkan: shader module created");
|
||||
Message("Vulkan: shader module % created", m_name);
|
||||
|
||||
#ifdef SCOP_HAS_DEBUG_UTILS_FUNCTIONS
|
||||
VkDebugUtilsObjectNameInfoEXT name_info{};
|
||||
name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
|
||||
name_info.objectType = VK_OBJECT_TYPE_SHADER_MODULE;
|
||||
name_info.objectHandle = reinterpret_cast<std::uint64_t>(m_module);
|
||||
name_info.pObjectName = m_name.c_str();
|
||||
RenderCore::Get().vkSetDebugUtilsObjectNameEXT(RenderCore::Get().GetDevice(), &name_info);
|
||||
#endif
|
||||
|
||||
GeneratePipelineLayout(m_layout);
|
||||
}
|
||||
@@ -59,7 +68,7 @@ namespace Scop
|
||||
return;
|
||||
kvfDestroyShaderModule(RenderCore::Get().GetDevice(), m_module);
|
||||
m_module = VK_NULL_HANDLE;
|
||||
Message("Vulkan: shader module destroyed");
|
||||
Message("Vulkan: shader module % destroyed", m_name);
|
||||
for(auto& layout : m_set_layouts)
|
||||
{
|
||||
kvfDestroyDescriptorSetLayout(RenderCore::Get().GetDevice(), layout);
|
||||
@@ -84,7 +93,7 @@ namespace Scop
|
||||
data.push_back(part);
|
||||
stream.close();
|
||||
|
||||
std::shared_ptr<Shader> shader = std::make_shared<Shader>(data, type, layout);
|
||||
std::shared_ptr<Shader> shader = std::make_shared<Shader>(data, type, layout, filepath.stem().string());
|
||||
Message("Vulkan: shader loaded %", filepath);
|
||||
return shader;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user