Skip to content

Commit dcc2b85

Browse files
authored
Expanded gfx::Format to include additional formats (shader-slang#1982)
* Format list updated with additional formats supported by both D3D and Vulkan; D3DUtil::getMapFormat() and VkUtil::getVkFormat() updated to include additional formats; GFX_FORMAT() updated with all additional formats (BC compression unfinished) * Finished updating GFX_FORMAT with newly added formats and sizes; Pixel size is now tracked using the FormatPixelSize struct containing the values for bytes per block and pixels per block to accomodate BC formats; Updated gfxGetFormatSize and associated sub-calls to return FormatPixelSize instead of uint8_t; Most calls to gfxGetFormatSize() updated to reflect changes, a couple calls still unupdated * Changes to accommodate new formats finished, debugging slang-literal unit test * First format unit test working * One test added for BC1Unorm and RGBA8Unorm_SRGB, both passing * Refactored format testing code to merge BC1Unorm and RGBA8Unorm SRGB into a single file * All unit tests added for BC and Srgb formats * Most tests added and working; Added five additional formats (still need tests) and made the appropriate changes to support these; createTextureView() modified for D3D11, D3D12, and Vulkan to take into account the format specified in the texture view desc when the texture's format is typeless * Format enums renamed to more closely match their D3D counterparts; Added a universal float and uint buffer and buffer view for use across all Format tests * Remaining tests added; D3D12 tests pass, but Vulkan crashes in BC1_UNORM and D3D11 spits out a bunch of D3D11 Errors (but supposedly passes) * re-run premake * Added Sint versions of test shaders; Vulkan and D3D11 tests also pass * Size struct for format unit tests no longer use initializer lists * Fixed a Size struct missed in the previous pass * Fixed minor bugs causing tests to fail * Added documentation detailing all currently unsupported formats * Skip tests causing unsupported format warnings due to swiftshader * updated several test using old Format enum names * Revert change to compareComputeResult() that was added for debugging purposes * DEBUGGING: Added prints to identify which formats are failing on CI * Reverted attempted debugging changes; Fixed texture2d-gather.hlsl to use updated Format enums * Fixed incorrect array sizes in d3d11 _initSrvDesc() * Commented out further tests that produce unexpected results when tested for Vulkan with swiftshader * Revert "Merge branch 'expanded-format-support' of https://github.com/lucy96chen/slang into expanded-format-support" This reverts commit 20008f0, reversing changes made to 6081e95. * Added a fuzzy comparison function for use with floats * submodule update * Revert messed up changes caused by previous revert after automatically merging on github
1 parent fe6d5f1 commit dcc2b85

36 files changed

+2396
-244
lines changed

build/visual-studio/gfx-unit-test-tool/gfx-unit-test-tool.vcxproj

+2
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
<ClCompile Include="..\..\..\tools\gfx-unit-test\buffer-barrier-test.cpp" />
276276
<ClCompile Include="..\..\..\tools\gfx-unit-test\compute-smoke.cpp" />
277277
<ClCompile Include="..\..\..\tools\gfx-unit-test\existing-device-handle-test.cpp" />
278+
<ClCompile Include="..\..\..\tools\gfx-unit-test\format-unit-tests.cpp" />
278279
<ClCompile Include="..\..\..\tools\gfx-unit-test\get-buffer-resource-handle-test.cpp" />
279280
<ClCompile Include="..\..\..\tools\gfx-unit-test\get-cmd-buffer-handle-test.cpp" />
280281
<ClCompile Include="..\..\..\tools\gfx-unit-test\get-cmd-queue-handle-test.cpp" />
@@ -286,6 +287,7 @@
286287
<ItemGroup>
287288
<None Include="..\..\..\tools\gfx-unit-test\buffer-barrier-test.slang" />
288289
<None Include="..\..\..\tools\gfx-unit-test\compute-smoke.slang" />
290+
<None Include="..\..\..\tools\gfx-unit-test\format-test-shaders.slang" />
289291
<None Include="..\..\..\tools\gfx-unit-test\mutable-shader-object.slang" />
290292
</ItemGroup>
291293
<ItemGroup>

build/visual-studio/gfx-unit-test-tool/gfx-unit-test-tool.vcxproj.filters

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
<ClCompile Include="..\..\..\tools\gfx-unit-test\existing-device-handle-test.cpp">
2727
<Filter>Source Files</Filter>
2828
</ClCompile>
29+
<ClCompile Include="..\..\..\tools\gfx-unit-test\format-unit-tests.cpp">
30+
<Filter>Source Files</Filter>
31+
</ClCompile>
2932
<ClCompile Include="..\..\..\tools\gfx-unit-test\get-buffer-resource-handle-test.cpp">
3033
<Filter>Source Files</Filter>
3134
</ClCompile>
@@ -55,6 +58,9 @@
5558
<None Include="..\..\..\tools\gfx-unit-test\compute-smoke.slang">
5659
<Filter>Source Files</Filter>
5760
</None>
61+
<None Include="..\..\..\tools\gfx-unit-test\format-test-shaders.slang">
62+
<Filter>Source Files</Filter>
63+
</None>
5864
<None Include="..\..\..\tools\gfx-unit-test\mutable-shader-object.slang">
5965
<Filter>Source Files</Filter>
6066
</None>
+264
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
Unsupported Formats
2+
======================
3+
GFX currently does not support the following listed D3D and Vulkan formats. With the exception of D24_UNORM_S8_UINT, these formats have been omitted as their counterpart API does not have a corresponding format. D24_UNORM_S8_UINT has been omitted as it is only supported by Nvidia.
4+
5+
DXGI_FORMAT_R32G8X24_TYPELESS \
6+
DXGI_FORMAT_D32_FLOAT_S8X24_UINT \
7+
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS \
8+
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT \
9+
DXGI_FORMAT_R24G8_TYPELESS \
10+
DXGI_FORMAT_D24_UNORM_S8_UINT \
11+
DXGI_FORMAT_R24_UNORM_X8_TYPELESS \
12+
DXGI_FORMAT_X24_TYPELESS_G8_UINT \
13+
DXGI_FORMAT_A8_UNORM \
14+
DXGI_FORMAT_R1_UNORM \
15+
DXGI_FORMAT_R8G8_B8G8_UNORM \
16+
DXGI_FORMAT_G8R8_G8B8_UNORM \
17+
DXGI_FORMAT_BC1_TYPELESS \
18+
DXGI_FORMAT_BC2_TYPELESS \
19+
DXGI_FORMAT_BC3_TYPELESS \
20+
DXGI_FORMAT_BC4_TYPELESS \
21+
DXGI_FORMAT_BC5_TYPELESS \
22+
DXGI_FORMAT_B8G8R8X8_UNORM \
23+
DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM \
24+
DXGI_FORMAT_B8G8R8X8_TYPELESS \
25+
DXGI_FORMAT_B8G8R8X8_UNORM_SRGB \
26+
DXGI_FORMAT_BC6H_TYPELESS \
27+
DXGI_FORMAT_BC7_TYPELESS \
28+
DXGI_FORMAT_AYUV \
29+
DXGI_FORMAT_Y410 \
30+
DXGI_FORMAT_Y416 \
31+
DXGI_FORMAT_NV12 \
32+
DXGI_FORMAT_P010 \
33+
DXGI_FORMAT_P016 \
34+
DXGI_FORMAT_420_OPAQUE \
35+
DXGI_FORMAT_YUY2 \
36+
DXGI_FORMAT_Y210 \
37+
DXGI_FORMAT_Y216 \
38+
DXGI_FORMAT_NV11 \
39+
DXGI_FORMAT_AI44 \
40+
DXGI_FORMAT_IA44 \
41+
DXGI_FORMAT_P8 \
42+
DXGI_FORMAT_A8P8 \
43+
DXGI_FORMAT_P208 \
44+
DXGI_FORMAT_V208 \
45+
DXGI_FORMAT_V408 \
46+
DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE \
47+
DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE \
48+
49+
VK_FORMAT_R4G4_UNORM_PACK8 \
50+
VK_FORMAT_R4G4B4A4_UNORM_PACK16 \
51+
VK_FORMAT_B4G4R4A4_UNORM_PACK16 \
52+
VK_FORMAT_B5G6R5_UNORM_PACK16 \
53+
VK_FORMAT_R5G5B5A1_UNORM_PACK16 \
54+
VK_FORMAT_B5G5R5A1_UNORM_PACK16 \
55+
VK_FORMAT_R8_USCALED \
56+
VK_FORMAT_R8_SSCALED \
57+
VK_FORMAT_R8_SRGB \
58+
VK_FORMAT_R8G8_USCALED \
59+
VK_FORMAT_R8G8_SSCALED \
60+
VK_FORMAT_R8G8_SRGB \
61+
VK_FORMAT_R8G8B8_UNORM \
62+
VK_FORMAT_R8G8B8_SNORM \
63+
VK_FORMAT_R8G8B8_USCALED \
64+
VK_FORMAT_R8G8B8_SSCALED \
65+
VK_FORMAT_R8G8B8_UINT \
66+
VK_FORMAT_R8G8B8_SINT \
67+
VK_FORMAT_R8G8B8_SRGB \
68+
VK_FORMAT_B8G8R8_UNORM \
69+
VK_FORMAT_B8G8R8_SNORM \
70+
VK_FORMAT_B8G8R8_USCALED \
71+
VK_FORMAT_B8G8R8_SSCALED \
72+
VK_FORMAT_B8G8R8_UINT \
73+
VK_FORMAT_B8G8R8_SINT \
74+
VK_FORMAT_B8G8R8_SRGB \
75+
VK_FORMAT_R8G8B8A8_USCALED \
76+
VK_FORMAT_R8G8B8A8_SSCALED \
77+
VK_FORMAT_B8G8R8A8_SNORM \
78+
VK_FORMAT_B8G8R8A8_USCALED \
79+
VK_FORMAT_B8G8R8A8_SSCALED \
80+
VK_FORMAT_B8G8R8A8_UINT \
81+
VK_FORMAT_B8G8R8A8_SINT \
82+
VK_FORMAT_B8G8R8A8_SRGB \
83+
VK_FORMAT_A8B8G8R8_UNORM_PACK32 \
84+
VK_FORMAT_A8B8G8R8_SNORM_PACK32 \
85+
VK_FORMAT_A8B8G8R8_USCALED_PACK32 \
86+
VK_FORMAT_A8B8G8R8_SSCALED_PACK32 \
87+
VK_FORMAT_A8B8G8R8_UINT_PACK32 \
88+
VK_FORMAT_A8B8G8R8_SINT_PACK32 \
89+
VK_FORMAT_A8B8G8R8_SRGB_PACK32 \
90+
VK_FORMAT_A2R10G10B10_UNORM_PACK32 \
91+
VK_FORMAT_A2R10G10B10_SNORM_PACK32 \
92+
VK_FORMAT_A2R10G10B10_USCALED_PACK32 \
93+
VK_FORMAT_A2R10G10B10_SSCALED_PACK32 \
94+
VK_FORMAT_A2R10G10B10_UINT_PACK32 \
95+
VK_FORMAT_A2R10G10B10_SINT_PACK32 \
96+
VK_FORMAT_A2B10G10R10_SNORM_PACK32 \
97+
VK_FORMAT_A2B10G10R10_USCALED_PACK32 \
98+
VK_FORMAT_A2B10G10R10_SSCALED_PACK32 \
99+
VK_FORMAT_A2B10G10R10_SINT_PACK32 \
100+
VK_FORMAT_R16_USCALED \
101+
VK_FORMAT_R16_SSCALED \
102+
VK_FORMAT_R16G16_USCALED \
103+
VK_FORMAT_R16G16_SSCALED \
104+
VK_FORMAT_R16G16B16_UNORM \
105+
VK_FORMAT_R16G16B16_SNORM \
106+
VK_FORMAT_R16G16B16_USCALED \
107+
VK_FORMAT_R16G16B16_SSCALED \
108+
VK_FORMAT_R16G16B16_UINT \
109+
VK_FORMAT_R16G16B16_SINT \
110+
VK_FORMAT_R16G16B16_SFLOAT \
111+
VK_FORMAT_R16G16B16A16_USCALED \
112+
VK_FORMAT_R16G16B16A16_SSCALED \
113+
VK_FORMAT_R64_UINT \
114+
VK_FORMAT_R64_SINT \
115+
VK_FORMAT_R64_SFLOAT \
116+
VK_FORMAT_R64G64_UINT \
117+
VK_FORMAT_R64G64_SINT \
118+
VK_FORMAT_R64G64_SFLOAT \
119+
VK_FORMAT_R64G64B64_UINT \
120+
VK_FORMAT_R64G64B64_SINT \
121+
VK_FORMAT_R64G64B64_SFLOAT \
122+
VK_FORMAT_R64G64B64A64_UINT \
123+
VK_FORMAT_R64G64B64A64_SINT \
124+
VK_FORMAT_R64G64B64A64_SFLOAT \
125+
VK_FORMAT_X8_D24_UNORM_PACK32 \
126+
VK_FORMAT_S8_UINT \
127+
VK_FORMAT_D16_UNORM_S8_UINT \
128+
VK_FORMAT_D24_UNORM_S8_UINT \
129+
VK_FORMAT_D32_SFLOAT_S8_UINT \
130+
VK_FORMAT_BC1_RGB_UNORM_BLOCK \
131+
VK_FORMAT_BC1_RGB_SRGB_BLOCK \
132+
VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK \
133+
VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK \
134+
VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK \
135+
VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK \
136+
VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK \
137+
VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK \
138+
VK_FORMAT_EAC_R11_UNORM_BLOCK \
139+
VK_FORMAT_EAC_R11_SNORM_BLOCK \
140+
VK_FORMAT_EAC_R11G11_UNORM_BLOCK \
141+
VK_FORMAT_EAC_R11G11_SNORM_BLOCK \
142+
VK_FORMAT_ASTC_4x4_UNORM_BLOCK \
143+
VK_FORMAT_ASTC_4x4_SRGB_BLOCK \
144+
VK_FORMAT_ASTC_5x4_UNORM_BLOCK \
145+
VK_FORMAT_ASTC_5x4_SRGB_BLOCK \
146+
VK_FORMAT_ASTC_5x5_UNORM_BLOCK \
147+
VK_FORMAT_ASTC_5x5_SRGB_BLOCK \
148+
VK_FORMAT_ASTC_6x5_UNORM_BLOCK \
149+
VK_FORMAT_ASTC_6x5_SRGB_BLOCK \
150+
VK_FORMAT_ASTC_6x6_UNORM_BLOCK \
151+
VK_FORMAT_ASTC_6x6_SRGB_BLOCK \
152+
VK_FORMAT_ASTC_8x5_UNORM_BLOCK \
153+
VK_FORMAT_ASTC_8x5_SRGB_BLOCK \
154+
VK_FORMAT_ASTC_8x6_UNORM_BLOCK \
155+
VK_FORMAT_ASTC_8x6_SRGB_BLOCK \
156+
VK_FORMAT_ASTC_8x8_UNORM_BLOCK \
157+
VK_FORMAT_ASTC_8x8_SRGB_BLOCK \
158+
VK_FORMAT_ASTC_10x5_UNORM_BLOCK \
159+
VK_FORMAT_ASTC_10x5_SRGB_BLOCK \
160+
VK_FORMAT_ASTC_10x6_UNORM_BLOCK \
161+
VK_FORMAT_ASTC_10x6_SRGB_BLOCK \
162+
VK_FORMAT_ASTC_10x8_UNORM_BLOCK \
163+
VK_FORMAT_ASTC_10x8_SRGB_BLOCK \
164+
VK_FORMAT_ASTC_10x10_UNORM_BLOCK \
165+
VK_FORMAT_ASTC_10x10_SRGB_BLOCK \
166+
VK_FORMAT_ASTC_12x10_UNORM_BLOCK \
167+
VK_FORMAT_ASTC_12x10_SRGB_BLOCK \
168+
VK_FORMAT_ASTC_12x12_UNORM_BLOCK \
169+
VK_FORMAT_ASTC_12x12_SRGB_BLOCK \
170+
VK_FORMAT_G8B8G8R8_422_UNORM \
171+
VK_FORMAT_B8G8R8G8_422_UNORM \
172+
VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM \
173+
VK_FORMAT_G8_B8R8_2PLANE_420_UNORM \
174+
VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM \
175+
VK_FORMAT_G8_B8R8_2PLANE_422_UNORM \
176+
VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM \
177+
VK_FORMAT_R10X6_UNORM_PACK16 \
178+
VK_FORMAT_R10X6G10X6_UNORM_2PACK16 \
179+
VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 \
180+
VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 \
181+
VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 \
182+
VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 \
183+
VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 \
184+
VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 \
185+
VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 \
186+
VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 \
187+
VK_FORMAT_R12X4_UNORM_PACK16 \
188+
VK_FORMAT_R12X4G12X4_UNORM_2PACK16 \
189+
VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 \
190+
VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 \
191+
VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 \
192+
VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 \
193+
VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 \
194+
VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 \
195+
VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 \
196+
VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 \
197+
VK_FORMAT_G16B16G16R16_422_UNORM \
198+
VK_FORMAT_B16G16R16G16_422_UNORM \
199+
VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM \
200+
VK_FORMAT_G16_B16R16_2PLANE_420_UNORM \
201+
VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM \
202+
VK_FORMAT_G16_B16R16_2PLANE_422_UNORM \
203+
VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM \
204+
VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG \
205+
VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG \
206+
VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG \
207+
VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG \
208+
VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG \
209+
VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG \
210+
VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG \
211+
VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG \
212+
VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT \
213+
VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT \
214+
VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT \
215+
VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT \
216+
VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT \
217+
VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT \
218+
VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT \
219+
VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT \
220+
VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT \
221+
VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT \
222+
VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT \
223+
VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT \
224+
VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT \
225+
VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT \
226+
VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT \
227+
VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT \
228+
VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT \
229+
VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT \
230+
VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT \
231+
VK_FORMAT_G8B8G8R8_422_UNORM_KHR \
232+
VK_FORMAT_B8G8R8G8_422_UNORM_KHR \
233+
VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR \
234+
VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR \
235+
VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR \
236+
VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR \
237+
VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR \
238+
VK_FORMAT_R10X6_UNORM_PACK16_KHR \
239+
VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR \
240+
VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR \
241+
VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR \
242+
VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR \
243+
VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR \
244+
VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR \
245+
VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR \
246+
VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR \
247+
VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR \
248+
VK_FORMAT_R12X4_UNORM_PACK16_KHR \
249+
VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR \
250+
VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR \
251+
VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR \
252+
VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR \
253+
VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR \
254+
VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR \
255+
VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR \
256+
VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR \
257+
VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR \
258+
VK_FORMAT_G16B16G16R16_422_UNORM_KHR \
259+
VK_FORMAT_B16G16R16G16_422_UNORM_KHR \
260+
VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR \
261+
VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR \
262+
VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR \
263+
VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR \
264+
VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR

examples/example-base/example-base.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Slang::Result WindowedAppBase::initializeBase(
5050

5151
// Create swapchain and framebuffers.
5252
gfx::ISwapchain::Desc swapchainDesc = {};
53-
swapchainDesc.format = gfx::Format::RGBA_Unorm_UInt8;
53+
swapchainDesc.format = gfx::Format::R8G8B8A8_UNORM;
5454
swapchainDesc.width = width;
5555
swapchainDesc.height = height;
5656
swapchainDesc.imageCount = kSwapchainImageCount;
@@ -59,7 +59,7 @@ Slang::Result WindowedAppBase::initializeBase(
5959
gSwapchain = gDevice->createSwapchain(swapchainDesc, windowHandle);
6060

6161
IFramebufferLayout::AttachmentLayout renderTargetLayout = {gSwapchain->getDesc().format, 1};
62-
IFramebufferLayout::AttachmentLayout depthLayout = {gfx::Format::D_Float32, 1};
62+
IFramebufferLayout::AttachmentLayout depthLayout = {gfx::Format::D32_FLOAT, 1};
6363
IFramebufferLayout::Desc framebufferLayoutDesc;
6464
framebufferLayoutDesc.renderTargetCount = 1;
6565
framebufferLayoutDesc.renderTargets = &renderTargetLayout;
@@ -117,7 +117,7 @@ void WindowedAppBase::createSwapchainFramebuffers()
117117
depthBufferDesc.size.width = gSwapchain->getDesc().width;
118118
depthBufferDesc.size.height = gSwapchain->getDesc().height;
119119
depthBufferDesc.size.depth = 1;
120-
depthBufferDesc.format = gfx::Format::D_Float32;
120+
depthBufferDesc.format = gfx::Format::D32_FLOAT;
121121
depthBufferDesc.defaultState = ResourceState::DepthWrite;
122122
depthBufferDesc.allowedStates = ResourceStateSet(ResourceState::DepthWrite);
123123

@@ -136,7 +136,7 @@ void WindowedAppBase::createSwapchainFramebuffers()
136136

137137
gfx::IResourceView::Desc depthBufferViewDesc;
138138
memset(&depthBufferViewDesc, 0, sizeof(depthBufferViewDesc));
139-
depthBufferViewDesc.format = gfx::Format::D_Float32;
139+
depthBufferViewDesc.format = gfx::Format::D32_FLOAT;
140140
depthBufferViewDesc.renderTarget.shape = gfx::IResource::Type::Texture2D;
141141
depthBufferViewDesc.type = gfx::IResourceView::Type::DepthStencil;
142142
ComPtr<gfx::IResourceView> dsv =

examples/model-viewer/main.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -744,9 +744,9 @@ Result initialize()
744744
SLANG_RETURN_ON_FAIL(context.init(gDevice));
745745

746746
InputElementDesc inputElements[] = {
747-
{"POSITION", 0, Format::RGB_Float32, offsetof(Model::Vertex, position) },
748-
{"NORMAL", 0, Format::RGB_Float32, offsetof(Model::Vertex, normal) },
749-
{"UV", 0, Format::RG_Float32, offsetof(Model::Vertex, uv) },
747+
{"POSITION", 0, Format::R32G32B32_FLOAT, offsetof(Model::Vertex, position) },
748+
{"NORMAL", 0, Format::R32G32B32_FLOAT, offsetof(Model::Vertex, normal) },
749+
{"UV", 0, Format::R32G32_FLOAT, offsetof(Model::Vertex, uv) },
750750
};
751751
auto inputLayout = gDevice->createInputLayout(
752752
&inputElements[0],
@@ -870,7 +870,7 @@ void renderFrame(int frameIndex) override
870870
for(auto& model : gModels)
871871
{
872872
drawCommandEncoder->setVertexBuffer(0, model->vertexBuffer, sizeof(Model::Vertex));
873-
drawCommandEncoder->setIndexBuffer(model->indexBuffer, Format::R_UInt32);
873+
drawCommandEncoder->setIndexBuffer(model->indexBuffer, Format::R32_UINT);
874874
// For each model we provide a parameter
875875
// block that holds the per-model transformation
876876
// parameters, corresponding to the `PerModel` type

examples/ray-tracing-pipeline/main.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,10 @@ Slang::Result initialize()
352352
geomDesc.type = IAccelerationStructure::GeometryType::Triangles;
353353
geomDesc.content.triangles.indexCount = kIndexCount;
354354
geomDesc.content.triangles.indexData = gIndexBuffer->getDeviceAddress();
355-
geomDesc.content.triangles.indexFormat = Format::R_UInt32;
355+
geomDesc.content.triangles.indexFormat = Format::R32_UINT;
356356
geomDesc.content.triangles.vertexCount = kVertexCount;
357357
geomDesc.content.triangles.vertexData = gVertexBuffer->getDeviceAddress();
358-
geomDesc.content.triangles.vertexFormat = Format::RGB_Float32;
358+
geomDesc.content.triangles.vertexFormat = Format::R32G32B32_FLOAT;
359359
geomDesc.content.triangles.vertexStride = sizeof(Vertex);
360360
geomDesc.content.triangles.transform3x4 = gTransformBuffer->getDeviceAddress();
361361
accelerationStructureBuildInputs.geometryDescs = &geomDesc;
@@ -505,7 +505,7 @@ Slang::Result initialize()
505505
return SLANG_FAIL;
506506

507507
InputElementDesc inputElements[] = {
508-
{"POSITION", 0, Format::RG_Float32, offsetof(FullScreenTriangle::Vertex, position)},
508+
{"POSITION", 0, Format::R32G32_FLOAT, offsetof(FullScreenTriangle::Vertex, position)},
509509
};
510510
auto inputLayout = gDevice->createInputLayout(&inputElements[0], SLANG_COUNT_OF(inputElements));
511511
if (!inputLayout)
@@ -554,7 +554,7 @@ void createResultTexture()
554554
resultTextureDesc.size.height = windowHeight;
555555
resultTextureDesc.size.depth = 1;
556556
resultTextureDesc.defaultState = ResourceState::UnorderedAccess;
557-
resultTextureDesc.format = Format::RGBA_Float16;
557+
resultTextureDesc.format = Format::R16G16B16A16_FLOAT;
558558
gResultTexture = gDevice->createTextureResource(resultTextureDesc);
559559
IResourceView::Desc resultUAVDesc = {};
560560
resultUAVDesc.format = resultTextureDesc.format;

0 commit comments

Comments
 (0)