Compare commits

..
4 Commits
Author SHA1 Message Date
Dynamitos 925537dcb3 Macos changes 2026-03-16 16:54:30 +01:00
Dynamitos 4fd44b075f reintroducing vulkan 2026-03-16 16:54:14 +01:00
Dynamitos e2296cada2 Metal changes 2026-03-16 16:53:30 +01:00
Dynamitos 54106e6fef removing vulkan references from mac builds 2026-03-16 16:52:43 +01:00
20 changed files with 173 additions and 66 deletions
+5 -15
View File
@@ -18,22 +18,12 @@
"name": "Editor (Mac)", "name": "Editor (Mac)",
"type": "lldb", "type": "lldb",
"request": "launch", "request": "launch",
"program": "${workspaceRoot}/build/Editor", "program": "${workspaceRoot}/build/external/Seele/Editor",
"args": [], "args": [],
"stopAtEntry": false, "cwd": "${workspaceRoot}/build/external/Seele",
"cwd": "${workspaceRoot}/build", "initCommands": [
"environment": [ "command script import ${workspaceFolder}/external/Seele/gdb/Seele_lldb.py"
{ ]
"name": "VK_LAYER_PATH",
"value": "/opt/homebrew/opt/vulkan-validationlayers/share/vulkan/explicit_layer.d"
}
],
"logging": {
"moduleLoad": false
},
"externalConsole": false,
"MIMode": "lldb",
"targetArchitecture": "arm64"
}, },
{ {
"name": "Editor (Linux)", "name": "Editor (Linux)",
+6 -20
View File
@@ -22,14 +22,6 @@ set(CMAKE_TOOLCHAIN_FILE ${EXTERNAL_ROOT}/vcpkg/scripts/buildsystems/vcpkg.cmake
set(CRCPP_ROOT ${EXTERNAL_ROOT}/CRCpp) set(CRCPP_ROOT ${EXTERNAL_ROOT}/CRCpp)
set(METAL_ROOT ${EXTERNAL_ROOT}/metal-cpp) set(METAL_ROOT ${EXTERNAL_ROOT}/metal-cpp)
if(WIN32)
set(VCPKG_BASE_FOLDER ${CMAKE_BINARY_DIR}/vcpkg_installed/x64-windows/)
elseif(APPLE)
set(VCPKG_BASE_FOLDER ${CMAKE_BINARY_DIR}/vcpkg_installed/arm64-osx/)
else()
set(VCPKG_BASE_FOLDER ${CMAKE_BINARY_DIR}/vcpkg_installed/x64-linux/)
endif()
set(Boost_NO_WARN_NEW_VERSIONS 1) set(Boost_NO_WARN_NEW_VERSIONS 1)
project (Seele) project (Seele)
@@ -48,6 +40,7 @@ find_package(Ktx CONFIG REQUIRED)
find_package(nlohmann_json CONFIG REQUIRED) find_package(nlohmann_json CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED) find_package(fmt CONFIG REQUIRED)
find_package(lunasvg CONFIG REQUIRED) find_package(lunasvg CONFIG REQUIRED)
find_package(slang CONFIG REQUIRED)
find_package(metis CONFIG REQUIRED) find_package(metis CONFIG REQUIRED)
find_package(meshoptimizer CONFIG REQUIRED) find_package(meshoptimizer CONFIG REQUIRED)
find_package(VulkanMemoryAllocator CONFIG REQUIRED) find_package(VulkanMemoryAllocator CONFIG REQUIRED)
@@ -63,8 +56,11 @@ endif()
add_library(Engine SHARED "") add_library(Engine SHARED "")
target_include_directories(Engine PRIVATE src/Engine) target_include_directories(Engine PRIVATE src/Engine)
target_include_directories(Engine PRIVATE ${VCPKG_BASE_FOLDER}/include/)
target_link_libraries(Engine PUBLIC Vulkan::Vulkan) target_link_libraries(Engine PUBLIC Vulkan::Vulkan)
target_link_libraries(Engine PUBLIC GPUOpen::VulkanMemoryAllocator)
if(NOT APPLE)
target_link_libraries(Engine PUBLIC slang::slang-glslang)
endif()
target_link_libraries(Engine PUBLIC EnTT::EnTT) target_link_libraries(Engine PUBLIC EnTT::EnTT)
target_link_libraries(Engine PUBLIC glfw) target_link_libraries(Engine PUBLIC glfw)
target_link_libraries(Engine PUBLIC glm::glm) target_link_libraries(Engine PUBLIC glm::glm)
@@ -77,17 +73,9 @@ target_link_libraries(Engine PUBLIC nlohmann_json::nlohmann_json)
target_link_libraries(Engine PUBLIC crcpp) target_link_libraries(Engine PUBLIC crcpp)
target_link_libraries(Engine PUBLIC fmt::fmt) target_link_libraries(Engine PUBLIC fmt::fmt)
target_link_libraries(Engine PUBLIC lunasvg::lunasvg) target_link_libraries(Engine PUBLIC lunasvg::lunasvg)
target_link_libraries(Engine PUBLIC GPUOpen::VulkanMemoryAllocator)
target_link_libraries(Engine PUBLIC metis) target_link_libraries(Engine PUBLIC metis)
target_link_libraries(Engine PUBLIC meshoptimizer::meshoptimizer) target_link_libraries(Engine PUBLIC meshoptimizer::meshoptimizer)
if(WIN32) target_link_libraries(Engine PUBLIC slang::slang)
target_link_libraries(Engine PUBLIC ${VCPKG_BASE_FOLDER}/lib/slang.lib)
elseif(APPLE)
target_link_libraries(Engine PUBLIC ${VCPKG_BASE_FOLDER}/debug/lib/libslang.dylib)
else()
target_link_libraries(Engine PUBLIC ${VCPKG_BASE_FOLDER}/lib/libslang.so)
target_link_libraries(Engine PUBLIC ${VCPKG_BASE_FOLDER}/lib/libslang-glslang.so)
endif()
if(APPLE) if(APPLE)
target_link_libraries(Engine PUBLIC metal) target_link_libraries(Engine PUBLIC metal)
@@ -142,8 +130,6 @@ add_subdirectory(src/)
if(WIN32) if(WIN32)
add_custom_target(dll_copy ALL add_custom_target(dll_copy ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_RUNTIME_DLLS:Engine> $<TARGET_FILE_DIR:Editor> COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_RUNTIME_DLLS:Engine> $<TARGET_FILE_DIR:Editor>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${VCPKG_BASE_FOLDER}/bin/slang.dll $<TARGET_FILE_DIR:Editor>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${VCPKG_BASE_FOLDER}/bin/slang-glslang.dll $<TARGET_FILE_DIR:Editor>
COMMAND_EXPAND_LISTS COMMAND_EXPAND_LISTS
DEPENDS Editor) DEPENDS Editor)
elseif(APPLE) elseif(APPLE)
+25 -4
View File
@@ -40,6 +40,17 @@
"CMAKE_INSTALL_PREFIX": "C:/Program Files/Seele" "CMAKE_INSTALL_PREFIX": "C:/Program Files/Seele"
} }
}, },
{
"name": "debug-mac",
"displayName": "Debug Mac (no ASan)",
"description": "Debug Mac build without sanitizers",
"binaryDir": "${sourceDir}/build",
"generator": "Xcode",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "C:/Program Files/Seele"
}
},
{ {
"name": "debug-asan", "name": "debug-asan",
"displayName": "Debug (ASan)", "displayName": "Debug (ASan)",
@@ -59,22 +70,32 @@
{ {
"name": "release", "name": "release",
"displayName": "Release (no ASan)", "displayName": "Release (no ASan)",
"configurePreset": "release" "configurePreset": "release",
"jobs": 0
}, },
{ {
"name": "release-asan", "name": "release-asan",
"displayName": "Release (ASan)", "displayName": "Release (ASan)",
"configurePreset": "release-asan" "configurePreset": "release-asan",
"jobs": 0
}, },
{ {
"name": "debug", "name": "debug",
"displayName": "Debug (no ASan)", "displayName": "Debug (no ASan)",
"configurePreset": "debug" "configurePreset": "debug",
"jobs": 0
},
{
"name": "debug-mac",
"displayName": "Debug Mac (no ASan)",
"configurePreset": "debug-mac",
"jobs": 0
}, },
{ {
"name": "debug-asan", "name": "debug-asan",
"displayName": "Debug (ASan)", "displayName": "Debug (ASan)",
"configurePreset": "debug-asan" "configurePreset": "debug-asan",
"jobs": 0
} }
] ]
} }
+1 -1
+62
View File
@@ -0,0 +1,62 @@
import lldb
def Array_SummaryProvider(valobj, internal_dict):
size = valobj.GetChildMemberWithName('arraySize').GetValueAsUnsigned(0)
return f"Array(size={size})"
class ArraySyntheticProvider:
def __init__(self, valobj, internal_dict):
self.valobj = valobj
self.update()
def num_children(self):
return self.size
def get_child_index(self, name):
try:
return int(name.lstrip('[').rstrip(']'))
except:
return -1
def get_child_at_index(self, index):
if index < 0 or index >= self.size:
return None
offset = index * self.data.GetType().GetPointeeType().GetByteSize()
return self.data.CreateChildAtOffset(f'[{index}]', offset, self.data.GetType().GetPointeeType())
def update(self):
self.data = self.valobj.GetChildMemberWithName('_data')
self.size = self.valobj.GetChildMemberWithName('arraySize').GetValueAsUnsigned(0)
def has_children(self):
return True
def Vector_SummaryProvider(valobj, internal_dict):
# Get the template parameters to determine vector length
type_name = valobj.GetTypeName()
# Extract components
x = valobj.GetChildMemberWithName('x').GetValue()
y = valobj.GetChildMemberWithName('y').GetValue()
# Check if z and w exist
z_child = valobj.GetChildMemberWithName('z')
w_child = valobj.GetChildMemberWithName('w')
comps = [x, y]
if z_child.IsValid():
comps.append(z_child.GetValue())
if w_child.IsValid():
comps.append(w_child.GetValue())
return "(" + ", ".join(comps) + ")"
def __lldb_init_module(debugger, internal_dict):
# Register Array formatter
debugger.HandleCommand('type summary add -F Seele_lldb.Array_SummaryProvider -x "^Seele::Array<.*>$"')
debugger.HandleCommand('type synthetic add -l Seele_lldb.ArraySyntheticProvider -x "^Seele::Array<.*>$"')
# Register Vector formatter
debugger.HandleCommand('type summary add -F Seele_lldb.Vector_SummaryProvider -x "^glm::(detail::)?t?vec[234]?<.*>$"')
print("Seele LLDB formatters loaded")
+38
View File
@@ -0,0 +1,38 @@
import Common;
import MaterialParameter;
import VertexData;
import StaticMeshVertexData;
import Scene;
[numthreads(1, 1, 1)]
[shader("amplification")]
void taskMain(uint threadID: SV_GroupThreadID, uint groupID: SV_GroupID) { DispatchMesh(1, 1, 1, groupID); }
[numthreads(1, 1, 1)]
[shader("mesh")]
void meshMain(in payload uint taskGroupId, out vertices FragmentParameter vertices[MAX_VERTICES],
out indices uint3 indices[MAX_PRIMITIVES]) {
InstanceData inst = pScene.instances[pOffsets.instanceOffset + taskGroupId];
MeshData mesh = pScene.meshData[pOffsets.instanceOffset + taskGroupId];
MeshletDescription m = pScene.meshletInfos[mesh.meshletRange.offset];
SetMeshOutputCounts(m.vertexIndices.size, m.primitiveIndices.size);
for (uint p = 0; p < m.primitiveIndices.size; p++) {
uint baseIndex = m.primitiveIndices.offset + (p * 3);
uint local_idx0 = pScene.primitiveIndices[baseIndex + 0];
uint local_idx1 = pScene.primitiveIndices[baseIndex + 1];
uint local_idx2 = pScene.primitiveIndices[baseIndex + 2];
indices[p] = uint3(local_idx0, local_idx1, local_idx2);
}
for (uint v = 0; v < m.vertexIndices.size; v++) {
uint vertexIndex = pScene.vertexIndices[m.vertexIndices.offset + v];
VertexAttributes attr = pVertexData.getAttributes(m.indicesOffset + vertexIndex);
vertices[v] = attr.getParameter(inst.transformMatrix, inst.inverseTransformMatrix);
}
}
[shader("pixel")]
void pixelMain(in FragmentParameter input, out float4 outColor : SV_Target) {
outColor = float4(1.0, 0.0, 0.0, 1.0);
}
+2 -4
View File
@@ -2,7 +2,6 @@
#include "Asset/AssetRegistry.h" #include "Asset/AssetRegistry.h"
#include "Asset/TextureAsset.h" #include "Asset/TextureAsset.h"
#include "Graphics/Graphics.h" #include "Graphics/Graphics.h"
#include "Graphics/Vulkan/Enums.h"
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-compare"
@@ -15,7 +14,7 @@
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#include "ktx.h" #include "ktx.h"
#include <ThreadPool.h> #include <ThreadPool.h>
#include <fstream> #include <iostream>
using namespace Seele; using namespace Seele;
@@ -60,9 +59,8 @@ void TextureLoader::import(TextureImportArgs args, PTextureAsset textureAsset) {
int totalWidth = 0, totalHeight = 0, n = 0; int totalWidth = 0, totalHeight = 0, n = 0;
unsigned char* data = stbi_load(args.filePath.string().c_str(), &totalWidth, &totalHeight, &n, 4); unsigned char* data = stbi_load(args.filePath.string().c_str(), &totalWidth, &totalHeight, &n, 4);
ktxTexture2* kTexture = nullptr; ktxTexture2* kTexture = nullptr;
VkFormat format = VK_FORMAT_R8G8B8A8_SRGB;
ktxTextureCreateInfo createInfo = { ktxTextureCreateInfo createInfo = {
.vkFormat = (uint32)format, .vkFormat = 43, // rgba8srgb
.baseDepth = 1, .baseDepth = 1,
.numLevels = 1, .numLevels = 1,
.numLayers = 1, .numLayers = 1,
+13 -7
View File
@@ -4,11 +4,12 @@
#include "Asset/FontLoader.h" #include "Asset/FontLoader.h"
#include "Asset/MaterialLoader.h" #include "Asset/MaterialLoader.h"
#include "Asset/MeshLoader.h" #include "Asset/MeshLoader.h"
#include "Graphics/Vulkan/Graphics.h"
#include "Asset/TextureLoader.h" #include "Asset/TextureLoader.h"
#include "Graphics/Initializer.h" #include "Graphics/Initializer.h"
#include "Material/Material.h" #include "Material/Material.h"
#include "Graphics/StaticMeshVertexData.h"
#include "Graphics/Vulkan/Graphics.h" #include "Graphics/Vulkan/Graphics.h"
#include "Graphics/StaticMeshVertexData.h"
#include "Window/PlayView.h" #include "Window/PlayView.h"
#include "Window/WindowManager.h" #include "Window/WindowManager.h"
#include <fmt/core.h> #include <fmt/core.h>
@@ -21,8 +22,8 @@ static Gfx::OGraphics graphics;
int main() { int main() {
std::string gameName = "MeshShadingDemo"; std::string gameName = "MeshShadingDemo";
std::filesystem::path outputPath = fmt::format("/home/dynamitos/{0}Game/", gameName); std::filesystem::path outputPath = fmt::format("/Users/dynamitos/{0}Game/", gameName);
std::filesystem::path sourcePath = fmt::format("/home/dynamitos/{0}/", gameName); std::filesystem::path sourcePath = fmt::format("/Users/dynamitos/{0}/", gameName);
#ifdef WIN32 #ifdef WIN32
std::string libraryEnding = "dll"; std::string libraryEnding = "dll";
#elif __APPLE__ #elif __APPLE__
@@ -30,7 +31,7 @@ int main() {
#else #else
std::string libraryEnding = "so"; std::string libraryEnding = "so";
#endif #endif
std::filesystem::path binaryPath = sourcePath / "bin" / fmt::format("{}.{}", gameName, libraryEnding); std::filesystem::path binaryPath = sourcePath / "build/Debug" / fmt::format("{}.{}", gameName, libraryEnding);
std::filesystem::path cmakePath = outputPath / "cmake"; std::filesystem::path cmakePath = outputPath / "cmake";
if (true) { if (true) {
graphics = new Vulkan::Graphics(); graphics = new Vulkan::Graphics();
@@ -45,9 +46,9 @@ int main() {
AssetImporter::importFont(FontImportArgs{ AssetImporter::importFont(FontImportArgs{
.filePath = "./fonts/arial.ttf", .filePath = "./fonts/arial.ttf",
}); });
AssetImporter::importEnvironmentMap(EnvironmentImportArgs{ // AssetImporter::importEnvironmentMap(EnvironmentImportArgs{
.filePath = sourcePath / "import" / "textures" / "newport_loft.hdr", // .filePath = sourcePath / "import" / "textures" / "newport_loft.hdr",
}); // });
// AssetImporter::importTexture(TextureImportArgs{ // AssetImporter::importTexture(TextureImportArgs{
// .filePath = sourcePath / "import" / "textures" / "grass_block_side.png", // .filePath = sourcePath / "import" / "textures" / "grass_block_side.png",
// .importPath = "", // .importPath = "",
@@ -56,6 +57,11 @@ int main() {
// .filePath = sourcePath / "import" / "models" / "main1_sponza" / "sponza.gltf", // .filePath = sourcePath / "import" / "models" / "main1_sponza" / "sponza.gltf",
// .importPath = "sponza", // .importPath = "sponza",
//}); //});
// AssetImporter::importMesh(MeshImportArgs{
// .filePath = sourcePath / "import" / "models" / "rttest.gltf",
// .importPath = "rttest",
// });
AssetImporter::importMesh(MeshImportArgs{ AssetImporter::importMesh(MeshImportArgs{
.filePath = sourcePath / "import" / "models" / "cube.fbx", .filePath = sourcePath / "import" / "models" / "cube.fbx",
.importPath = "", .importPath = "",
-1
View File
@@ -1,7 +1,6 @@
#include "TextureAsset.h" #include "TextureAsset.h"
#include "Graphics/Graphics.h" #include "Graphics/Graphics.h"
#include "Graphics/Texture.h" #include "Graphics/Texture.h"
#include "Graphics/Vulkan/Enums.h"
#include "Window/WindowManager.h" #include "Window/WindowManager.h"
#include "ktx.h" #include "ktx.h"
+1
View File
@@ -1,5 +1,6 @@
#pragma once #pragma once
#include <assert.h> #include <assert.h>
#include <memory>
#include <memory_resource> #include <memory_resource>
#include <memory> #include <memory>
+1
View File
@@ -1,4 +1,5 @@
#pragma once #pragma once
#include <string>
#include <memory_resource> #include <memory_resource>
#include <map> #include <map>
#include <string> #include <string>
+4 -6
View File
@@ -34,7 +34,7 @@ void DescriptorLayout::create() {
MTL::ArgumentDescriptor** objects = new MTL::ArgumentDescriptor*[descriptorBindings.size()]; MTL::ArgumentDescriptor** objects = new MTL::ArgumentDescriptor*[descriptorBindings.size()];
uint32 mappingCounter = 0; uint32 mappingCounter = 0;
for (uint32 i = 0; i < descriptorBindings.size(); ++i) { for (uint32 i = 0; i < descriptorBindings.size(); ++i) {
if (descriptorBindings[i].descriptorType != Gfx::SE_DESCRIPTOR_TYPE_UNIFORM_BUFFER) { if (descriptorBindings[i].descriptorType != Gfx::SE_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK) {
plainDescriptor = false; plainDescriptor = false;
} }
objects[i] = MTL::ArgumentDescriptor::alloc()->init(); objects[i] = MTL::ArgumentDescriptor::alloc()->init();
@@ -116,13 +116,11 @@ void DescriptorSetHandle::updateBuffer(const std::string& name, uint32 index, Gf
void DescriptorSetHandle::updateBuffer(const std::string& name, uint32 index, Gfx::PUniformBuffer uniformBuffer) { void DescriptorSetHandle::updateBuffer(const std::string& name, uint32 index, Gfx::PUniformBuffer uniformBuffer) {
uint32 flattenedIndex = owner->getLayout()->variableMapping[name].index + index; uint32 flattenedIndex = owner->getLayout()->variableMapping[name].index + index;
PIndexBuffer buffer = uniformBuffer.cast<IndexBuffer>(); PUniformBuffer buffer = uniformBuffer.cast<UniformBuffer>();
bufferWrites.add(BufferWriteInfo{ uniformWrites.add(UniformWriteInfo{
.index = flattenedIndex, .index = flattenedIndex,
.buffer = buffer->getAlloc(), .content = buffer->getContents(),
.access = owner->getLayout()->variableMapping[name].access,
}); });
boundResources.add(buffer->getAlloc());
} }
void DescriptorSetHandle::updateSampler(const std::string& name, uint32 index, Gfx::PSampler samplerState) { void DescriptorSetHandle::updateSampler(const std::string& name, uint32 index, Gfx::PSampler samplerState) {
+1 -2
View File
@@ -5,7 +5,6 @@
#include "Enums.h" #include "Enums.h"
#include "Graphics.h" #include "Graphics.h"
#include "Graphics/Query.h" #include "Graphics/Query.h"
#include <vulkan/vulkan_core.h>
using namespace Seele; using namespace Seele;
using namespace Seele::Metal; using namespace Seele::Metal;
@@ -71,4 +70,4 @@ Gfx::Timestamp TimestampQuery::getResult() {
.name = "Test", .name = "Test",
.time = 0, .time = 0,
}; };
} }
@@ -11,6 +11,7 @@ CachedDepthPass::CachedDepthPass(Gfx::PGraphics graphics, PScene scene) : Render
.stageFlags = Gfx::SE_SHADER_STAGE_TASK_BIT_EXT | Gfx::SE_SHADER_STAGE_VERTEX_BIT, .stageFlags = Gfx::SE_SHADER_STAGE_TASK_BIT_EXT | Gfx::SE_SHADER_STAGE_VERTEX_BIT,
.offset = 0, .offset = 0,
.size = sizeof(VertexData::DrawCallOffsets), .size = sizeof(VertexData::DrawCallOffsets),
.name = "pOffsets"
}); });
if (graphics->supportMeshShading()) { if (graphics->supportMeshShading()) {
graphics->getShaderCompiler()->registerRenderPass("CachedDepthPass", Gfx::PassConfig{ graphics->getShaderCompiler()->registerRenderPass("CachedDepthPass", Gfx::PassConfig{
@@ -25,6 +25,7 @@ DepthCullingPass::DepthCullingPass(Gfx::PGraphics graphics, PScene scene) : Rend
.stageFlags = Gfx::SE_SHADER_STAGE_TASK_BIT_EXT | Gfx::SE_SHADER_STAGE_VERTEX_BIT, .stageFlags = Gfx::SE_SHADER_STAGE_TASK_BIT_EXT | Gfx::SE_SHADER_STAGE_VERTEX_BIT,
.offset = 0, .offset = 0,
.size = sizeof(VertexData::DrawCallOffsets), .size = sizeof(VertexData::DrawCallOffsets),
.name = "pOffsets"
}); });
depthComputeLayout = graphics->createPipelineLayout("DepthComputeLayout"); depthComputeLayout = graphics->createPipelineLayout("DepthComputeLayout");
@@ -34,6 +35,7 @@ DepthCullingPass::DepthCullingPass(Gfx::PGraphics graphics, PScene scene) : Rend
.stageFlags = Gfx::SE_SHADER_STAGE_COMPUTE_BIT, .stageFlags = Gfx::SE_SHADER_STAGE_COMPUTE_BIT,
.offset = 0, .offset = 0,
.size = sizeof(MipParam), .size = sizeof(MipParam),
.name = "pMipParam"
}); });
if (graphics->supportMeshShading()) { if (graphics->supportMeshShading()) {
@@ -53,6 +53,7 @@ RayTracingPass::RayTracingPass(Gfx::PGraphics graphics, PScene scene) : RenderPa
.stageFlags = Gfx::SE_SHADER_STAGE_RAYGEN_BIT_KHR, .stageFlags = Gfx::SE_SHADER_STAGE_RAYGEN_BIT_KHR,
.offset = 0, .offset = 0,
.size = sizeof(SampleParams), .size = sizeof(SampleParams),
.name = "pSamps",
}); });
graphics->getShaderCompiler()->registerRenderPass("RayTracing", Gfx::PassConfig{ graphics->getShaderCompiler()->registerRenderPass("RayTracing", Gfx::PassConfig{
.baseLayout = pipelineLayout, .baseLayout = pipelineLayout,
@@ -16,6 +16,7 @@ ShadowPass::ShadowPass(Gfx::PGraphics graphics, PScene scene) : RenderPass(graph
.stageFlags = Gfx::SE_SHADER_STAGE_TASK_BIT_EXT | Gfx::SE_SHADER_STAGE_VERTEX_BIT, .stageFlags = Gfx::SE_SHADER_STAGE_TASK_BIT_EXT | Gfx::SE_SHADER_STAGE_VERTEX_BIT,
.offset = 0, .offset = 0,
.size = sizeof(VertexData::DrawCallOffsets), .size = sizeof(VertexData::DrawCallOffsets),
.name = "pOffsets",
}); });
if (graphics->supportMeshShading()) { if (graphics->supportMeshShading()) {
graphics->getShaderCompiler()->registerRenderPass("ShadowPass", Gfx::PassConfig{ graphics->getShaderCompiler()->registerRenderPass("ShadowPass", Gfx::PassConfig{
@@ -253,7 +254,6 @@ void ShadowPass::render() {
} }
graphics->executeCommands(std::move(commands)); graphics->executeCommands(std::move(commands));
graphics->endRenderPass(); graphics->endRenderPass();
graphics->waitDeviceIdle();
} }
graphics->endDebugRegion(); graphics->endDebugRegion();
} }
+1 -1
View File
@@ -134,7 +134,7 @@ void ShaderCompiler::createShaders(ShaderPermutation permutation, Gfx::OPipeline
} }
// createInfo.typeParameter.add({Pair<const char*, const char*>("IVertexData", permutation.vertexDataName)}); // createInfo.typeParameter.add({Pair<const char*, const char*>("IVertexData", permutation.vertexDataName)});
createInfo.modules.add(permutation.vertexDataName); createInfo.modules.add(permutation.vertexDataName);
// createInfo.dumpIntermediate = true; createInfo.dumpIntermediate = true;
if (permutation.useMeshShading) { if (permutation.useMeshShading) {
if (permutation.hasTaskShader) { if (permutation.hasTaskShader) {
+1 -1
View File
@@ -619,7 +619,7 @@ void VertexData::loadMeshlets(MeshId id, const Array<Vector>& loadedPositions, c
// todo: use meshopt for bb generation // todo: use meshopt for bb generation
m.bounding = AABB(); m.bounding = AABB();
for (size_t j = 0; j < m.vertexIndices.size; ++j) { for (size_t j = 0; j < m.vertexIndices.size; ++j) {
m.bounding.adjust(loadedPositions[vertexIndices[meshoptMeshlets[i].vertex_offset + j + m.indicesOffset]]); m.bounding.adjust(loadedPositions[vertexIndices[meshoptMeshlets[i].vertex_offset + j + vertexOffset]]);
} }
} }
registeredMeshes[id].meshData = MeshData{ registeredMeshes[id].meshData = MeshData{
+7 -3
View File
@@ -1,8 +1,13 @@
{ {
"dependencies": [ "dependencies": [
"vulkan", {
"name": "vulkan"
},
"vulkan-loader",
{
"name": "vulkan-memory-allocator"
},
"assimp", "assimp",
"entt",
"stb", "stb",
"entt", "entt",
"freetype", "freetype",
@@ -12,7 +17,6 @@
"nlohmann-json", "nlohmann-json",
"fmt", "fmt",
"gtest", "gtest",
"vulkan-memory-allocator",
"lunasvg", "lunasvg",
"harfbuzz", "harfbuzz",
"shader-slang", "shader-slang",