core: Use new vkd3d header filenames.
[vkmodelviewer.git] / Core / DDSTextureLoader.h
blob0aa221a0f2954ce1baf0e27c54d8bff9cdfd13a2
1 //
2 // Copyright (c) Microsoft. All rights reserved.
3 // This code is licensed under the MIT License (MIT).
4 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
5 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
6 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
7 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
8 //
9 //--------------------------------------------------------------------------------------
11 // Functions for loading a DDS texture and creating a Direct3D runtime resource for it
13 // Note these functions are useful as a light-weight runtime loader for DDS files. For
14 // a full-featured DDS file reader, writer, and texture processing pipeline see
15 // the 'Texconv' sample and the 'DirectXTex' library.
17 // http://go.microsoft.com/fwlink/?LinkId=248926
18 // http://go.microsoft.com/fwlink/?LinkId=248929
19 //--------------------------------------------------------------------------------------
21 #pragma once
23 #include <vkd3d_d3d12.h>
25 #pragma warning(push)
26 #pragma warning(disable : 4005)
27 #include <stdint.h>
28 #pragma warning(pop)
30 enum DDS_ALPHA_MODE
32 DDS_ALPHA_MODE_UNKNOWN = 0,
33 DDS_ALPHA_MODE_STRAIGHT = 1,
34 DDS_ALPHA_MODE_PREMULTIPLIED = 2,
35 DDS_ALPHA_MODE_OPAQUE = 3,
36 DDS_ALPHA_MODE_CUSTOM = 4,
39 HRESULT __cdecl CreateDDSTextureFromMemory( _In_ ID3D12Device* d3dDevice,
40 _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
41 _In_ size_t ddsDataSize,
42 _In_ size_t maxsize,
43 _In_ bool forceSRGB,
44 _Outptr_opt_ ID3D12Resource** texture,
45 _In_ D3D12_CPU_DESCRIPTOR_HANDLE textureView,
46 _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr
49 size_t BitsPerPixel(_In_ DXGI_FORMAT fmt);