| 220 | } |
| 221 | |
| 222 | donut::app::DeviceCreationParameters SampleBaseApp::GetDefaultDeviceParams() const |
| 223 | { |
| 224 | donut::app::DeviceCreationParameters deviceParams; |
| 225 | deviceParams.backBufferWidth = 0; // initialized from CmdLine |
| 226 | deviceParams.backBufferHeight = 0; // initialized from CmdLine |
| 227 | deviceParams.swapChainSampleCount = 1; |
| 228 | deviceParams.swapChainBufferCount = c_SwapchainCount; |
| 229 | deviceParams.startFullscreen = false; |
| 230 | deviceParams.startBorderless = false; |
| 231 | deviceParams.vsyncEnabled = true; |
| 232 | deviceParams.enableRayTracingExtensions = true; |
| 233 | #if DONUT_WITH_DX12 |
| 234 | #if defined(RTXPT_D3D_AGILITY_SDK_VERSION) |
| 235 | deviceParams.featureLevel = D3D_FEATURE_LEVEL_12_2; |
| 236 | // TODO: Redefining this isn't needed. Take the ones from AgilitySDK |
| 237 | static const UUID D3D12ExperimentalShaderModels = { 0x76f5573e, 0xf13a, 0x40f5, {0xb2, 0x97, 0x81, 0xce, 0x9e, 0x18, 0x93, 0x3f} }; |
| 238 | static const UUID D3D12StateObjectsExperiment = { 0x398a7fd6, 0xa15a, 0x42c1, {0x96, 0x05, 0x4b, 0xd9, 0x99, 0x9a, 0x61, 0xaf} }; |
| 239 | static const UUID D3D12RaytracingExperiment = { 0xb56e238b, 0xe886, 0x46d8, {0x9b, 0xe1, 0x34, 0x10, 0x30, 0x31, 0x45, 0x09} }; |
| 240 | UUID Features[] = { D3D12ExperimentalShaderModels }; //, D3D12StateObjectsExperiment }; //, D3D12RaytracingExperiment }; |
| 241 | HRESULT ok = D3D12EnableExperimentalFeatures(_countof(Features), Features, nullptr, nullptr); |
| 242 | #else |
| 243 | deviceParams.featureLevel = D3D_FEATURE_LEVEL_12_1; |
| 244 | #endif |
| 245 | #endif |
| 246 | #if defined(_DEBUG) |
| 247 | deviceParams.enableDebugRuntime = true; |
| 248 | deviceParams.enableWarningsAsErrors = true; |
| 249 | deviceParams.enableNvrhiValidationLayer = true; |
| 250 | deviceParams.enableGPUValidation = false; // <- this severely impact performance but is good to enable from time to time |
| 251 | #endif |
| 252 | deviceParams.supportExplicitDisplayScaling = true; |
| 253 | |
| 254 | #if DONUT_WITH_STREAMLINE |
| 255 | deviceParams.checkStreamlineSignature = true; // <- Set to false if you're using a local build of streamline |
| 256 | deviceParams.streamlineAppId = 231313132; |
| 257 | #if defined(_DEBUG) |
| 258 | deviceParams.enableStreamlineLog = true; |
| 259 | #endif |
| 260 | #endif |
| 261 | |
| 262 | #if DONUT_WITH_VULKAN |
| 263 | deviceParams.requiredVulkanDeviceExtensions.push_back("VK_KHR_buffer_device_address"); |
| 264 | deviceParams.requiredVulkanDeviceExtensions.push_back("VK_KHR_format_feature_flags2"); |
| 265 | |
| 266 | // Attachment 0 not written by fragment shader; undefined values will be written to attachment (OMM baker) |
| 267 | deviceParams.ignoredVulkanValidationMessageLocations.push_back(0x0000000023e43bb7); |
| 268 | |
| 269 | // vertex shader writes to output location 0.0 which is not consumed by fragment shader (OMM baker) |
| 270 | deviceParams.ignoredVulkanValidationMessageLocations.push_back(0x000000000609a13b); |
| 271 | |
| 272 | // vkCmdDispatch(): Buffer format mismatch for t_NeighborOffsets (RG8_SNORM vs shader expecting RG32_FLOAT) |
| 273 | // DX12 handles this automatically; it works correctly, just Vulkan is stricter about format matching |
| 274 | deviceParams.ignoredVulkanValidationMessageLocations.push_back(0x00000000c5a3822a); |
| 275 | |
| 276 | // vkCmdPipelineBarrier2(): pDependencyInfo.pBufferMemoryBarriers[0].dstAccessMask bit VK_ACCESS_SHADER_READ_BIT |
| 277 | // is not supported by stage mask (Unhandled VkPipelineStageFlagBits) |
| 278 | // Vulkan validation layer not supporting OMM? |
| 279 | deviceParams.ignoredVulkanValidationMessageLocations.push_back(0x00000000591f70f2); |
nothing calls this directly
no outgoing calls
no test coverage detected