Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pablode committed Jul 28, 2024
1 parent a256634 commit 91f942a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cmake/BuildConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ list(APPEND CMAKE_CONFIGURATION_TYPES "Develop")


# TODO: define GTL_COMPILE_OPTIONS that is then manually set for each target
# TODO: define GTL_LINK_OPTIONS -> target_link_options (CMake 3.13)
# TODO: define GTL_LINK_OPTIONS -> target_link_options (CMake 3.13). e.g. warnings as errors?
if(MSVC)
set(GTL_COMPILE_OPTIONS "/Wall")
set(GTL_COMPILE_OPTIONS "")#"/Wall")
# Disable "not enough arguments for function-like macro invocation" warning caused
# by the transitive inclusion of boost headers and non-conformant MSVC preprocessor
# behaviour. See USD's msvcdefaults.cmake file for a detailed comment.
set(GTL_COMPILE_OPTIONS "${GTL_COMPILE_OPTIONS} /wd4003")
set(GTL_COMPILE_OPTIONS "${GTL_COMPILE_OPTIONS}" "/wd4003")
else()
set(GTL_COMPILE_OPTIONS "-Wall" "-Wextra" "-Wformat-security")
endif()
Expand Down
15 changes: 9 additions & 6 deletions src/cgpu/impl/Cgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ namespace gtl

/* API method implementation. */

#ifndef NDEBUG
static bool cgpuFindLayer(const char* name, size_t layerCount, VkLayerProperties* layers)
{
for (size_t i = 0; i < layerCount; i++)
Expand All @@ -387,6 +388,7 @@ namespace gtl
}
return false;
}
#endif

static bool cgpuFindExtension(const char* name, size_t extensionCount, VkExtensionProperties* extensions)
{
Expand All @@ -410,7 +412,7 @@ namespace gtl
.pObjectName = name
};

VkResult result = vkSetDebugUtilsObjectNameEXT(device, &info);
[[maybe_unused]] VkResult result = vkSetDebugUtilsObjectNameEXT(device, &info);

assert(result == VK_SUCCESS);
}
Expand Down Expand Up @@ -692,7 +694,7 @@ namespace gtl
GbSmallVector<VkQueueFamilyProperties, 32> queueFamilies(queueFamilyCount);
vkGetPhysicalDeviceQueueFamilyProperties(idevice->physicalDevice, &queueFamilyCount, queueFamilies.data());

int32_t queueFamilyIndex = -1;
uint32_t queueFamilyIndex = UINT32_MAX;
for (uint32_t i = 0; i < queueFamilyCount; ++i)
{
const VkQueueFamilyProperties* queue_family = &queueFamilies[i];
Expand All @@ -702,7 +704,7 @@ namespace gtl
queueFamilyIndex = i;
}
}
if (queueFamilyIndex == -1)
if (queueFamilyIndex == UINT32_MAX)
{
iinstance->ideviceStore.free(handle);
CGPU_RETURN_ERROR("no suitable queue family");
Expand Down Expand Up @@ -948,7 +950,7 @@ namespace gtl
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
.pNext = nullptr,
.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
.queueFamilyIndex = (uint32_t) queueFamilyIndex,
.queueFamilyIndex = queueFamilyIndex,
};

result = idevice->table.vkCreateCommandPool(
Expand Down Expand Up @@ -1952,7 +1954,7 @@ namespace gtl

for (uint32_t i = 0; i < groups.size(); i++)
{
VkRayTracingShaderGroupCreateInfoKHR createInfo = {
VkRayTracingShaderGroupCreateInfoKHR sgCreateInfo = {
.sType = VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR,
.pNext = nullptr,
.type = VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR,
Expand All @@ -1962,7 +1964,8 @@ namespace gtl
.intersectionShader = VK_SHADER_UNUSED_KHR,
.pShaderGroupCaptureReplayHandle = nullptr,
};
groups[i] = createInfo;

groups[i] = sgCreateInfo;
}

bool anyNullClosestHitShader = false;
Expand Down
2 changes: 1 addition & 1 deletion src/mc/impl/Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ namespace gtl
{
GbSmallVector<mi::neuraylib::Target_function_description, MC_DF_FLAG_COUNT> fDescs;

for (int i = 0; i < MC_DF_FLAG_COUNT; i++)
for (size_t i = 0; i < MC_DF_FLAG_COUNT; i++)
{
if (dfFlags & (1 << i))
{
Expand Down

0 comments on commit 91f942a

Please sign in to comment.