This repository has been archived by the owner on Dec 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File format (.xet) change. DdsToXet can upgrade old Xet files to the …
…new format. Assets in the DDS directory are exported at build time into media directory. Upgrade to DirectStorage v1.0.2. Many misc. improvements.
- Loading branch information
1 parent
858a5e6
commit 189a5cf
Showing
56 changed files
with
916 additions
and
739 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
//********************************************************* | ||
// | ||
// Copyright 2020 Intel Corporation | ||
// | ||
// Permission is hereby granted, free of charge, to any | ||
// person obtaining a copy of this software and associated | ||
// documentation files(the "Software"), to deal in the Software | ||
// without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, | ||
// and/or sell copies of the Software, and to permit persons to | ||
// whom the Software is furnished to do so, subject to the | ||
// following conditions : | ||
// The above copyright notice and this permission notice shall | ||
// be included in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
// NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
// DEALINGS IN THE SOFTWARE. | ||
// | ||
//********************************************************* | ||
|
||
#pragma once | ||
|
||
#include "DDS.h" | ||
|
||
/*----------------------------------------------------------------------------- | ||
File Layout: | ||
- Header | ||
- Array of Per-tile info: file offset, # bytes, index into metadata array | ||
- Array of Per-metadata blob info: file offset, size of metadata blob | ||
- Metadata blobs, each blob is aligned | ||
- Texture Data, each tile is aligned | ||
- packed mips, treat as not aligned | ||
-----------------------------------------------------------------------------*/ | ||
struct XetFileHeaderV2 | ||
{ | ||
static UINT GetMagic() { return 0x20544558; } | ||
static UINT GetAlignment() { return 4096; } | ||
static UINT GetTileSize() { return 65536; } | ||
static UINT GetVersion() { return 2; } | ||
|
||
UINT m_magic{ GetMagic() }; | ||
UINT m_version{ GetVersion() }; | ||
DirectX::DDS_HEADER m_ddsHeader; | ||
DirectX::DDS_HEADER_DXT10 m_extensionHeader; | ||
|
||
UINT m_numMetadataBlobs; | ||
|
||
struct MipInfo | ||
{ | ||
UINT m_numStandardMips; | ||
UINT m_numPackedMips; | ||
UINT m_numTilesForPackedMips; | ||
UINT m_numTilesForStandardMips; // the number of TileData[] entries after the header | ||
}; | ||
MipInfo m_mipInfo; | ||
|
||
// use subresource tile dimensions to generate linear tile index | ||
struct StandardMipInfo | ||
{ | ||
UINT m_widthTiles; | ||
UINT m_heightTiles; | ||
UINT m_depthTiles; | ||
|
||
// convenience value, can be computed from sum of previous subresource dimensions | ||
UINT m_subresourceTileIndex; | ||
}; | ||
|
||
// if required, compute dimensions by shifting mip 0 dimensions by mip level | ||
struct PackedMipInfo | ||
{ | ||
UINT m_rowPitch; | ||
UINT m_slicePitch; | ||
UINT m_fileOffset; | ||
}; | ||
|
||
struct SubresourceInfo | ||
{ | ||
union | ||
{ | ||
StandardMipInfo m_standardMipInfo; | ||
PackedMipInfo m_packedMipInfo; | ||
}; | ||
}; | ||
|
||
// indices < m_numStandardMips are standard mips, >= are packed mips | ||
SubresourceInfo m_subresourceInfo[16]; | ||
|
||
// array TileData[m_numTilesForStandardMips] for each tile | ||
struct TileData | ||
{ | ||
UINT m_offset; // file offset to tile data | ||
UINT m_numBytes; // # bytes for the tile | ||
UINT m_metadataIndex; // index of metadata to use | ||
}; | ||
|
||
// array of MetaData[m_numMetadataBlobs] (may be size 0) | ||
struct MetaData | ||
{ | ||
UINT m_offset; // file offset to metadata blob | ||
UINT m_numBytes; // size of the metadata blob | ||
}; | ||
|
||
// metadata here (aligned) | ||
// tile data here (aligned) | ||
|
||
// packed mip data from m_packedMipInfo.m_fileOffset until EOF | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.