Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "-Wall -Werror -Wformat-security -Wno-deprecated-volatile -fPIC")
set(CMAKE_CXX_FLAGS "-Wall -Wformat-security -Wno-deprecated-volatile -fPIC")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g3 -ggdb3 -Og")
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -O0")
Expand All @@ -97,7 +97,12 @@ endif()

set(PROJECT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(PROJECT_OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_INSTALL_RPATH $ORIGIN)
if(APPLE)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MacOS does not like the $ORIGIN

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the /usr/local/lib is so that it finds the vulkan dylib

set(CMAKE_INSTALL_RPATH "@executable_path;/usr/local/lib")
elseif(UNIX)
set(CMAKE_INSTALL_RPATH "$ORIGIN")
endif()

set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)

# Put RUNTIME and LIBRARY outputs into a folder where we can run them without installing
Expand Down
2 changes: 2 additions & 0 deletions src/codegen/gen_common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ std::string TypeToString() {

auto typeStart = charStart;
auto embeddingSignature = EmbedTypeIntoSignature<T>();

auto structStart = embeddingSignature.find("struct ", charStart);
if (structStart == charStart) typeStart += "struct "s.size();

Expand All @@ -84,6 +85,7 @@ std::string TypeToString() {

auto typeStart = charStart;
auto embeddingSignature = EmbedTypeIntoSignature<T>();

auto enumStart = embeddingSignature.find("enum ", charStart);
if (enumStart == charStart) typeStart += "enum "s.size();
auto classStart = embeddingSignature.find("class ", charStart);
Expand Down
1 change: 1 addition & 0 deletions src/core/console/ConsoleTracy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "console/Console.hh"

#include <unistd.h>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it does not find execl and fork

#ifdef _WIN32
#include <windows.h>
#else
Expand Down
1 change: 1 addition & 0 deletions src/core/ecs/StructMetadata.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ namespace ecs {

template<typename T>
static inline TypeInfo Lookup() {
// Logf("Lookup: %s", typeid(T).name());
using StrippedT = std::remove_pointer_t<std::decay_t<T>>;
return TypeInfo{
.typeIndex = GetFieldTypeIndex(typeid(std::conditional_t<std::is_function_v<StrippedT>, T, StrippedT>)),
Expand Down
4 changes: 2 additions & 2 deletions src/core/ecs/components/Events.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ namespace ecs {
* A transactionId can be provided to synchronize event visibility with transactions.
* If no transactionId is provided, this event will be immediately visible to all transactions.
*/
size_t Add(const Event &event, size_t transactionId = 0) const;
size_t Add(const AsyncEvent &event) const;
uint64_t Add(const Event &event, uint64_t transactionId = 0) const;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The impl changed but the interface didn't. No difference on linux but it is a compilation error for me.

uint64_t Add(const AsyncEvent &event) const;
static bool Poll(Lock<Read<EventInput>> lock, const EventQueueRef &queue, Event &eventOut);

robin_hood::unordered_map<EventName, std::vector<EventQueueWeakRef>, sp::StringHash, sp::StringEqual> events;
Expand Down
23 changes: 11 additions & 12 deletions src/graphics/graphics/vulkan/core/DeviceContext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ namespace sp::vulkan {
}

// currently we have code that assumes the transfer queue family is different from the other queues
Assert(queueFamilyIndex[QUEUE_TYPE_TRANSFER] != queueFamilyIndex[QUEUE_TYPE_GRAPHICS],
"transfer queue family overlaps graphics queue");
// Assert(queueFamilyIndex[QUEUE_TYPE_TRANSFER] != queueFamilyIndex[QUEUE_TYPE_GRAPHICS],
// "transfer queue family overlaps graphics queue");

std::vector<vk::DeviceQueueCreateInfo> queueInfos;
for (uint32_t i = 0; i < queueFamilies.size(); i++) {
Expand All @@ -252,13 +252,12 @@ namespace sp::vulkan {
queueInfos.push_back(queueInfo);
}

vector<const char *> enabledDeviceExtensions = {
VK_KHR_MULTIVIEW_EXTENSION_NAME,
VK_EXT_MEMORY_BUDGET_EXTENSION_NAME,
vector<const char *> enabledDeviceExtensions = {VK_KHR_MULTIVIEW_EXTENSION_NAME,
// VK_EXT_MEMORY_BUDGET_EXTENSION_NAME,
VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME,
VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME,
VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME,
};
"VK_KHR_portability_subset"};
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The const exists but for some reason compilation fails because it... does not exist? idk


if (enableSwapchain) {
enabledDeviceExtensions.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
Expand Down Expand Up @@ -286,14 +285,14 @@ namespace sp::vulkan {
physicalDevice.getFeatures2KHR(&deviceFeatures2);

const auto &availableDeviceFeatures = deviceFeatures2.features;
Assert(availableDeviceFeatures.fillModeNonSolid, "device must support fillModeNonSolid");
// Assert(availableDeviceFeatures.fillModeNonSolid, "device must support fillModeNonSolid");
Assert(availableDeviceFeatures.samplerAnisotropy, "device must support samplerAnisotropy");
Assert(availableDeviceFeatures.multiDrawIndirect, "device must support multiDrawIndirect");
Assert(availableDeviceFeatures.multiViewport, "device must support multiViewport");
Assert(availableDeviceFeatures.drawIndirectFirstInstance, "device must support drawIndirectFirstInstance");
Assert(availableDeviceFeatures.shaderInt16, "device must support shaderInt16");
Assert(availableDeviceFeatures.fragmentStoresAndAtomics, "device must support fragmentStoresAndAtomics");
Assert(availableDeviceFeatures.wideLines, "device must support wideLines");
// Assert(availableDeviceFeatures.wideLines, "device must support wideLines");
Assert(availableVulkan11Features.multiview, "device must support multiview");
Assert(availableVulkan11Features.shaderDrawParameters, "device must support shaderDrawParameters");
Assert(availableVulkan11Features.storageBuffer16BitAccess, "device must support storageBuffer16BitAccess");
Expand All @@ -302,7 +301,7 @@ namespace sp::vulkan {
Assert(availableVulkan12Features.shaderOutputViewportIndex,
"device must support shaderOutputViewportIndex");
Assert(availableVulkan12Features.shaderOutputLayer, "device must support shaderOutputLayer");
Assert(availableVulkan12Features.drawIndirectCount, "device must support drawIndirectCount");
// Assert(availableVulkan12Features.drawIndirectCount, "device must support drawIndirectCount");
Assert(availableVulkan12Features.runtimeDescriptorArray, "device must support runtimeDescriptorArray");
Assert(availableVulkan12Features.descriptorBindingPartiallyBound,
"device must support descriptorBindingPartiallyBound");
Expand All @@ -316,7 +315,7 @@ namespace sp::vulkan {
vk::PhysicalDeviceVulkan12Features enabledVulkan12Features;
enabledVulkan12Features.shaderOutputViewportIndex = true;
enabledVulkan12Features.shaderOutputLayer = true;
enabledVulkan12Features.drawIndirectCount = true;
enabledVulkan12Features.drawIndirectCount = false;
enabledVulkan12Features.runtimeDescriptorArray = true;
enabledVulkan12Features.descriptorBindingPartiallyBound = true;
enabledVulkan12Features.descriptorBindingVariableDescriptorCount = true;
Expand All @@ -334,14 +333,14 @@ namespace sp::vulkan {
enabledDeviceFeatures2.pNext = &enabledVulkan11Features;
auto &enabledDeviceFeatures = enabledDeviceFeatures2.features;
enabledDeviceFeatures.dualSrcBlend = true;
enabledDeviceFeatures.fillModeNonSolid = true;
enabledDeviceFeatures.fillModeNonSolid = false;
enabledDeviceFeatures.samplerAnisotropy = true;
enabledDeviceFeatures.multiDrawIndirect = true;
enabledDeviceFeatures.drawIndirectFirstInstance = true;
enabledDeviceFeatures.multiViewport = true;
enabledDeviceFeatures.shaderInt16 = true;
enabledDeviceFeatures.fragmentStoresAndAtomics = true;
enabledDeviceFeatures.wideLines = true;
enabledDeviceFeatures.wideLines = false;

vk::DeviceCreateInfo deviceInfo;
deviceInfo.queueCreateInfoCount = queueInfos.size();
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/graphics/vulkan/core/Shader.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace sp::vulkan {
const uint32_t MAX_BOUND_DESCRIPTOR_SETS = 4;
const uint32_t MAX_BINDINGS_PER_DESCRIPTOR_SET = 32;
const uint32_t MAX_DESCRIPTOR_SETS_PER_POOL = 16;
const uint32_t MAX_BINDINGS_PER_BINDLESS_DESCRIPTOR_SET = 65535;
const uint32_t MAX_BINDINGS_PER_BINDLESS_DESCRIPTOR_SET = 640;

class Model;

Expand Down