diff options
Diffstat (limited to 'tools/gfx')
| -rw-r--r-- | tools/gfx/debug-layer/debug-shader-object.cpp | 18 | ||||
| -rw-r--r-- | tools/gfx/mutable-shader-object.h | 8 | ||||
| -rw-r--r-- | tools/gfx/renderer-shared.cpp | 18 | ||||
| -rw-r--r-- | tools/gfx/renderer-shared.h | 4 | ||||
| -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 |
8 files changed, 50 insertions, 50 deletions
diff --git a/tools/gfx/debug-layer/debug-shader-object.cpp b/tools/gfx/debug-layer/debug-shader-object.cpp index d078ba583..eb67c46ab 100644 --- a/tools/gfx/debug-layer/debug-shader-object.cpp +++ b/tools/gfx/debug-layer/debug-shader-object.cpp @@ -26,7 +26,7 @@ void DebugShaderObject::checkCompleteness() { if (layout->getBindingRangeBindingCount(i) != 0) { - if (!m_initializedBindingRanges.Contains(i)) + if (!m_initializedBindingRanges.contains(i)) { auto var = layout->getBindingRangeLeafVariable(i); GFX_DIAGNOSE_ERROR_FORMAT( @@ -86,7 +86,7 @@ Result DebugShaderObject::getObject(ShaderOffset const& offset, IShaderObject** auto resultCode = baseObject->getObject(offset, innerObject.writeRef()); SLANG_RETURN_ON_FAIL(resultCode); RefPtr<DebugShaderObject> debugShaderObject; - if (m_objects.TryGetValue(ShaderOffsetKey{offset}, debugShaderObject)) + if (m_objects.tryGetValue(ShaderOffsetKey{offset}, debugShaderObject)) { if (debugShaderObject->baseObject == innerObject) { @@ -107,7 +107,7 @@ Result DebugShaderObject::setObject(ShaderOffset const& offset, IShaderObject* o SLANG_GFX_API_FUNC; auto objectImpl = getDebugObj(object); m_objects[ShaderOffsetKey{offset}] = objectImpl; - m_initializedBindingRanges.Add(offset.bindingRangeIndex); + m_initializedBindingRanges.add(offset.bindingRangeIndex); objectImpl->checkCompleteness(); return baseObject->setObject(offset, getInnerObj(object)); } @@ -117,7 +117,7 @@ Result DebugShaderObject::setResource(ShaderOffset const& offset, IResourceView* SLANG_GFX_API_FUNC; auto viewImpl = getDebugObj(resourceView); m_resources[ShaderOffsetKey{offset}] = viewImpl; - m_initializedBindingRanges.Add(offset.bindingRangeIndex); + m_initializedBindingRanges.add(offset.bindingRangeIndex); return baseObject->setResource(offset, getInnerObj(resourceView)); } @@ -126,7 +126,7 @@ Result DebugShaderObject::setSampler(ShaderOffset const& offset, ISamplerState* SLANG_GFX_API_FUNC; auto samplerImpl = getDebugObj(sampler); m_samplers[ShaderOffsetKey{offset}] = samplerImpl; - m_initializedBindingRanges.Add(offset.bindingRangeIndex); + m_initializedBindingRanges.add(offset.bindingRangeIndex); return baseObject->setSampler(offset, getInnerObj(sampler)); } @@ -140,7 +140,7 @@ Result DebugShaderObject::setCombinedTextureSampler( m_samplers[ShaderOffsetKey{offset}] = samplerImpl; auto viewImpl = getDebugObj(textureView); m_resources[ShaderOffsetKey{offset}] = viewImpl; - m_initializedBindingRanges.Add(offset.bindingRangeIndex); + m_initializedBindingRanges.add(offset.bindingRangeIndex); return baseObject->setCombinedTextureSampler( offset, getInnerObj(viewImpl), getInnerObj(sampler)); } @@ -198,9 +198,9 @@ Result DebugRootShaderObject::setSpecializationArgs( void DebugRootShaderObject::reset() { m_entryPoints.clear(); - m_objects.Clear(); - m_resources.Clear(); - m_samplers.Clear(); + m_objects.clear(); + m_resources.clear(); + m_samplers.clear(); baseObject.detach(); } diff --git a/tools/gfx/mutable-shader-object.h b/tools/gfx/mutable-shader-object.h index 9653986ad..1864be158 100644 --- a/tools/gfx/mutable-shader-object.h +++ b/tools/gfx/mutable-shader-object.h @@ -142,7 +142,7 @@ namespace gfx setObject(ShaderOffset const& offset, IShaderObject* object) override { Super::setObject(offset, object); - m_objectOffsets.Add(offset); + m_objectOffsets.add(offset); markDirty(); return SLANG_OK; } @@ -182,9 +182,9 @@ namespace gfx allocateShaderObject(static_cast<TransientResourceHeapBase*>(transientHeap)); SLANG_RETURN_ON_FAIL(object->setData(ShaderOffset(), this->m_data.getBuffer(), this->m_data.getCount())); for (auto res : m_resources) - SLANG_RETURN_ON_FAIL(object->setResource(res.Key, res.Value)); + SLANG_RETURN_ON_FAIL(object->setResource(res.key, res.value)); for (auto sampler : m_samplers) - SLANG_RETURN_ON_FAIL(object->setSampler(sampler.Key, sampler.Value)); + SLANG_RETURN_ON_FAIL(object->setSampler(sampler.key, sampler.value)); for (auto offset : m_objectOffsets) { if (offset.bindingRangeIndex < 0) @@ -304,7 +304,7 @@ namespace gfx *object = nullptr; Slang::RefPtr<ShaderObjectBase> subObject; - if (m_objects.TryGetValue(offset, subObject)) + if (m_objects.tryGetValue(offset, subObject)) { returnComPtr(object, subObject); } diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp index 445f22e5a..c32cc3d90 100644 --- a/tools/gfx/renderer-shared.cpp +++ b/tools/gfx/renderer-shared.cpp @@ -715,10 +715,10 @@ Result RendererBase::getShaderObjectLayout( slang::TypeLayoutReflection* typeLayout, ShaderObjectLayoutBase** outLayout) { RefPtr<ShaderObjectLayoutBase> shaderObjectLayout; - if (!m_shaderObjectLayoutCache.TryGetValue(typeLayout, shaderObjectLayout)) + if (!m_shaderObjectLayoutCache.tryGetValue(typeLayout, shaderObjectLayout)) { SLANG_RETURN_ON_FAIL(createShaderObjectLayout(typeLayout, shaderObjectLayout.writeRef())); - m_shaderObjectLayoutCache.Add(typeLayout, shaderObjectLayout); + m_shaderObjectLayoutCache.add(typeLayout, shaderObjectLayout); } *outLayout = shaderObjectLayout.detach(); return SLANG_OK; @@ -803,13 +803,13 @@ ShaderComponentID ShaderCache::getComponentId(UnownedStringSlice name) ShaderComponentID ShaderCache::getComponentId(ComponentKey key) { ShaderComponentID componentId = 0; - if (componentIds.TryGetValue(key, componentId)) + if (componentIds.tryGetValue(key, componentId)) return componentId; OwningComponentKey owningTypeKey; owningTypeKey.hash = key.hash; owningTypeKey.typeName = key.typeName; owningTypeKey.specializationArgs.addRange(key.specializationArgs); - ShaderComponentID resultId = static_cast<ShaderComponentID>(componentIds.Count()); + ShaderComponentID resultId = static_cast<ShaderComponentID>(componentIds.getCount()); componentIds[owningTypeKey] = resultId; return resultId; } @@ -1187,20 +1187,20 @@ Result ShaderObjectBase::copyFrom(IShaderObject* object, ITransientResourceHeap* for (auto& kv : srcObj->m_objects) { ComPtr<IShaderObject> subObject; - SLANG_RETURN_ON_FAIL(kv.Value->getCurrentVersion(transientHeap, subObject.writeRef())); - setObject(kv.Key, subObject); + SLANG_RETURN_ON_FAIL(kv.value->getCurrentVersion(transientHeap, subObject.writeRef())); + setObject(kv.key, subObject); } for (auto& kv : srcObj->m_resources) { - setResource(kv.Key, kv.Value.Ptr()); + setResource(kv.key, kv.value.Ptr()); } for (auto& kv : srcObj->m_samplers) { - setSampler(kv.Key, kv.Value.Ptr()); + setSampler(kv.key, kv.value.Ptr()); } for (auto& kv : srcObj->m_specializationArgs) { - setSpecializationArgs(kv.Key, kv.Value.begin(), (uint32_t)kv.Value.getCount()); + setSpecializationArgs(kv.key, kv.value.begin(), (uint32_t)kv.value.getCount()); } return SLANG_OK; } diff --git a/tools/gfx/renderer-shared.h b/tools/gfx/renderer-shared.h index c7137f0fa..38aa775be 100644 --- a/tools/gfx/renderer-shared.h +++ b/tools/gfx/renderer-shared.h @@ -1121,7 +1121,7 @@ public: Slang::RefPtr<PipelineStateBase> getSpecializedPipelineState(PipelineKey programKey) { Slang::RefPtr<PipelineStateBase> result; - if (specializedPipelines.TryGetValue(programKey, result)) + if (specializedPipelines.tryGetValue(programKey, result)) return result; return nullptr; } @@ -1199,7 +1199,7 @@ public: TransientResourceHeapBase* transientHeap, IResourceCommandEncoder* encoder) { - if (auto ptr = m_deviceBuffers.TryGetValue(pipeline)) + if (auto ptr = m_deviceBuffers.tryGetValue(pipeline)) { return ptr->Ptr(); } 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; |
