diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-04-25 10:43:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-25 10:43:29 -0400 |
| commit | 7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0 (patch) | |
| tree | 9c71955dbc956b0058b19818ca127c8132cda512 /tools/gfx/vulkan | |
| parent | 284cee1f246c072f190c87c8fb60c1d2181e458f (diff) | |
Dictionary using lowerCamel (#2835)
* #include an absolute path didn't work - because paths were taken to always be relative.
* WIP lowerCamel Dictionary.
* WIP more lowerCamel fixes for Dictionary.
* Add/Remove/Clear
* GetValue/Contains
* Fix tabs in dictionary.
Count -> getCount
* Fix fields with caps.
* Key -> key
Value -> value
Use m_ for members where appropriate.
Use lowerCamel in linked list.
* Some small fixes/improvements to Dictionary.
* Kick CI.
Diffstat (limited to 'tools/gfx/vulkan')
| -rw-r--r-- | tools/gfx/vulkan/vk-device.cpp | 34 | ||||
| -rw-r--r-- | tools/gfx/vulkan/vk-pipeline-state.cpp | 8 | ||||
| -rw-r--r-- | tools/gfx/vulkan/vk-shader-object-layout.cpp | 4 | ||||
| -rw-r--r-- | tools/gfx/vulkan/vk-shader-table.cpp | 6 |
4 files changed, 26 insertions, 26 deletions
diff --git a/tools/gfx/vulkan/vk-device.cpp b/tools/gfx/vulkan/vk-device.cpp index 92594f652..b9dbb264f 100644 --- a/tools/gfx/vulkan/vk-device.cpp +++ b/tools/gfx/vulkan/vk-device.cpp @@ -608,55 +608,55 @@ Result DeviceImpl::initVulkanInstanceAndDevice( HashSet<String> extensionNames; for (const auto& e : extensions) { - extensionNames.Add(e.extensionName); + extensionNames.add(e.extensionName); } - if (extensionNames.Contains("VK_KHR_external_memory")) + if (extensionNames.contains("VK_KHR_external_memory")) { deviceExtensions.add(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME); #if SLANG_WINDOWS_FAMILY - if (extensionNames.Contains("VK_KHR_external_memory_win32")) + if (extensionNames.contains("VK_KHR_external_memory_win32")) { deviceExtensions.add(VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); } #endif m_features.add("external-memory"); } - if (extensionNames.Contains(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME)) + if (extensionNames.contains(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME)) { deviceExtensions.add(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME); m_features.add("conservative-rasterization-3"); m_features.add("conservative-rasterization-2"); m_features.add("conservative-rasterization-1"); } - if (extensionNames.Contains(VK_EXT_DEBUG_REPORT_EXTENSION_NAME)) + if (extensionNames.contains(VK_EXT_DEBUG_REPORT_EXTENSION_NAME)) { deviceExtensions.add(VK_EXT_DEBUG_REPORT_EXTENSION_NAME); - if (extensionNames.Contains(VK_EXT_DEBUG_MARKER_EXTENSION_NAME)) + if (extensionNames.contains(VK_EXT_DEBUG_MARKER_EXTENSION_NAME)) { deviceExtensions.add(VK_EXT_DEBUG_MARKER_EXTENSION_NAME); } } - if (extensionNames.Contains(VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME)) + if (extensionNames.contains(VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME)) { deviceExtensions.add(VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME); } - if (extensionNames.Contains(VK_NVX_BINARY_IMPORT_EXTENSION_NAME)) + if (extensionNames.contains(VK_NVX_BINARY_IMPORT_EXTENSION_NAME)) { deviceExtensions.add(VK_NVX_BINARY_IMPORT_EXTENSION_NAME); m_features.add("nvx-binary-import"); } - if (extensionNames.Contains(VK_NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME)) + if (extensionNames.contains(VK_NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME)) { deviceExtensions.add(VK_NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME); m_features.add("nvx-image-view-handle"); } - if (extensionNames.Contains(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME)) + if (extensionNames.contains(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME)) { deviceExtensions.add(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); m_features.add("push-descriptor"); } - if (extensionNames.Contains(VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME)) + if (extensionNames.contains(VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME)) { deviceExtensions.add(VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME); m_features.add("barycentrics"); @@ -1759,15 +1759,15 @@ Result DeviceImpl::getFormatSupportedResourceStates(Format format, ResourceState m_api.vkGetPhysicalDeviceSurfaceFormatsKHR(m_api.m_physicalDevice, VK_NULL_HANDLE, &surfaceFormatCount, surfaceFormats.getBuffer()); for (auto surfaceFormat : surfaceFormats) { - presentableFormats.Add(surfaceFormat.format); + presentableFormats.add(surfaceFormat.format); } #else // Until we have a solution to query presentable formats without needing a surface, // hard code presentable formats that is supported by most drivers. - presentableFormats.Add(VK_FORMAT_R8G8B8A8_UNORM); - presentableFormats.Add(VK_FORMAT_B8G8R8A8_UNORM); - presentableFormats.Add(VK_FORMAT_R8G8B8A8_SRGB); - presentableFormats.Add(VK_FORMAT_B8G8R8A8_SRGB); + presentableFormats.add(VK_FORMAT_R8G8B8A8_UNORM); + presentableFormats.add(VK_FORMAT_B8G8R8A8_UNORM); + presentableFormats.add(VK_FORMAT_R8G8B8A8_SRGB); + presentableFormats.add(VK_FORMAT_B8G8R8A8_SRGB); #endif ResourceStateSet allowedStates; @@ -1813,7 +1813,7 @@ Result DeviceImpl::getFormatSupportedResourceStates(Format format, ResourceState allowedStates.add(ResourceState::DepthWrite); } // Present - if (presentableFormats.Contains(vkFormat)) + if (presentableFormats.contains(vkFormat)) allowedStates.add(ResourceState::Present); // IndirectArgument allowedStates.add(ResourceState::IndirectArgument); diff --git a/tools/gfx/vulkan/vk-pipeline-state.cpp b/tools/gfx/vulkan/vk-pipeline-state.cpp index 06bd13197..4be9877af 100644 --- a/tools/gfx/vulkan/vk-pipeline-state.cpp +++ b/tools/gfx/vulkan/vk-pipeline-state.cpp @@ -329,7 +329,7 @@ uint32_t RayTracingPipelineStateImpl::findEntryPointIndexByName( if (!name) return VK_SHADER_UNUSED_KHR; - auto indexPtr = entryPointNameToIndex.TryGetValue(String(name)); + auto indexPtr = entryPointNameToIndex.tryGetValue(String(name)); if (indexPtr) return (uint32_t)*indexPtr; // TODO: Error reporting? @@ -360,7 +360,7 @@ Result RayTracingPipelineStateImpl::createVKRayTracingPipelineState() { auto stageCreateInfo = programImpl->m_stageCreateInfos[i]; auto entryPointName = programImpl->m_entryPointNames[i]; - entryPointNameToIndex.Add(entryPointName, i); + entryPointNameToIndex.add(entryPointName, i); if (stageCreateInfo.stage & (VK_SHADER_STAGE_ANY_HIT_BIT_KHR | VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR | VK_SHADER_STAGE_INTERSECTION_BIT_KHR)) @@ -380,7 +380,7 @@ Result RayTracingPipelineStateImpl::createVKRayTracingPipelineState() auto shaderGroupName = entryPointName; auto shaderGroupIndex = shaderGroupInfos.getCount(); shaderGroupInfos.add(shaderGroupInfo); - shaderGroupNameToIndex.Add(shaderGroupName, shaderGroupIndex); + shaderGroupNameToIndex.add(shaderGroupName, shaderGroupIndex); } for (int32_t i = 0; i < desc.rayTracing.hitGroupDescs.getCount(); ++i) @@ -404,7 +404,7 @@ Result RayTracingPipelineStateImpl::createVKRayTracingPipelineState() auto shaderGroupIndex = shaderGroupInfos.getCount(); shaderGroupInfos.add(shaderGroupInfo); - shaderGroupNameToIndex.Add(String(groupDesc.hitGroupName), shaderGroupIndex); + shaderGroupNameToIndex.add(String(groupDesc.hitGroupName), shaderGroupIndex); } raytracingPipelineInfo.groupCount = (uint32_t)shaderGroupInfos.getCount(); diff --git a/tools/gfx/vulkan/vk-shader-object-layout.cpp b/tools/gfx/vulkan/vk-shader-object-layout.cpp index e1d06c791..03dc1f11a 100644 --- a/tools/gfx/vulkan/vk-shader-object-layout.cpp +++ b/tools/gfx/vulkan/vk-shader-object-layout.cpp @@ -12,7 +12,7 @@ namespace vk Index ShaderObjectLayoutImpl::Builder::findOrAddDescriptorSet(Index space) { Index index; - if (m_mapSpaceToDescriptorSetIndex.TryGetValue(space, index)) + if (m_mapSpaceToDescriptorSetIndex.tryGetValue(space, index)) return index; DescriptorSetInfo info = {}; @@ -21,7 +21,7 @@ Index ShaderObjectLayoutImpl::Builder::findOrAddDescriptorSet(Index space) index = m_descriptorSetBuildInfos.getCount(); m_descriptorSetBuildInfos.add(info); - m_mapSpaceToDescriptorSetIndex.Add(space, index); + m_mapSpaceToDescriptorSetIndex.add(space, index); return index; } diff --git a/tools/gfx/vulkan/vk-shader-table.cpp b/tools/gfx/vulkan/vk-shader-table.cpp index a47750ddb..f40331432 100644 --- a/tools/gfx/vulkan/vk-shader-table.cpp +++ b/tools/gfx/vulkan/vk-shader-table.cpp @@ -77,7 +77,7 @@ RefPtr<BufferResource> ShaderTableImpl::createDeviceBuffer( auto dstHandlePtr = subTablePtr + i * rtProps.shaderGroupBaseAlignment; auto shaderGroupName = m_shaderGroupNames[shaderTableEntryCounter++]; auto shaderGroupIndexPtr = - pipelineImpl->shaderGroupNameToIndex.TryGetValue(shaderGroupName); + pipelineImpl->shaderGroupNameToIndex.tryGetValue(shaderGroupName); if (!shaderGroupIndexPtr) continue; @@ -93,7 +93,7 @@ RefPtr<BufferResource> ShaderTableImpl::createDeviceBuffer( auto dstHandlePtr = subTablePtr + i * handleSize; auto shaderGroupName = m_shaderGroupNames[shaderTableEntryCounter++]; auto shaderGroupIndexPtr = - pipelineImpl->shaderGroupNameToIndex.TryGetValue(shaderGroupName); + pipelineImpl->shaderGroupNameToIndex.tryGetValue(shaderGroupName); if (!shaderGroupIndexPtr) continue; @@ -108,7 +108,7 @@ RefPtr<BufferResource> ShaderTableImpl::createDeviceBuffer( auto dstHandlePtr = subTablePtr + i * handleSize; auto shaderGroupName = m_shaderGroupNames[shaderTableEntryCounter++]; auto shaderGroupIndexPtr = - pipelineImpl->shaderGroupNameToIndex.TryGetValue(shaderGroupName); + pipelineImpl->shaderGroupNameToIndex.tryGetValue(shaderGroupName); if (!shaderGroupIndexPtr) continue; |
