DirectStorage 1.2 Available Now

Cassie Hoef

Damyan Pepper

Cooper Partin

Today we’re releasing the 1.2 version of the DirectStorage SDK, where we’ve added new features and made some fixes based on your feedback. The full list of changes can be found on the NuGet page and you can update to the latest version using NuGet update.   

Visit the DirectStorage landing page for more information about how to get started. If you have any questions or feedback, please reach out to us on the #directstorage channel on the D3D12 Discord Server 

 

Force Buffered IO 

DirectStorage currently opens files in unbuffered mode. This allows us to avoid unnecessary copies, getting the data onto the GPU as quickly as possible.  However, we heard from some developers that they’d like to be able to use the same code both on high-speed SSDs as well as legacy hard drives. The legacy hard drives require buffered IO in order to mask the long seek times. For this reason, we added the ability to configure DirectStorage to open files in buffered mode. 

This can be enabled by setting the “ForceFileBuffering” field in DSTORAGE_CONFIGURATION1 to TRUE. Note that buffered IO is incompatible with BypassIO, and therefore DisableBypassIO must be set to TRUE when using this option. 

It is the title’s responsibility to know when to use this setting. This feature should only be enabled for slower HDD drives that will benefit from the OS file buffering features. 

 

New GetCompressionSupport API 

DirectStorage currently chooses the decompression path for built-in compression formats based on the supported capabilities of the GPU. There are scenarios where a CPU based fallback path is chosen. We heard from developers that it would be beneficial to understand which decompression path is being used so that default texture resolution settings may be set based on this. To enable this, we added a new API for querying what path the runtime has chosen. 

IDStorageQueue2::GetCompressionSupport() returns a value indicating whether a GPU optimized implementation, GPU fallback for CPU fallback is used for decompression, as well as what types of queues DirectStorage will use for decompression. 

 

Bug Fixes 
  • Resolved https://github.com/microsoft/DirectStorage/issues/22 by adding a “Reserved1” field to DSTORAGE_REQUEST_OPTIONS.  This makes the in-memory layout of the structure more explicit but doesn’t actually change the layout from previous versions. 
  • Fixed DSTORAGE_REQUEST_DESTINATION_TEXTURE_REGION for 3D textures, as reported to us on the DirectX Discord channel. 
  • Fixed scheduling issue that manifested when transferring uncompressed data from memory to buffers 
Performance improvements 
  • Moved the copy after GPU decompression onto the compute queue for GPUs on which this is faster.