这是indexloc提供的服务,不要输入任何密码
Skip to content

WGSL: allow bgra8unorm as texel format #3640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 4, 2023

Conversation

Jiawei-Shao
Copy link
Contributor

@Jiawei-Shao Jiawei-Shao commented Nov 28, 2022

No description provided.

This patch intends to add `bgra8unorm` as a valid texel format when
the extension `bgra8unorm_storage` is enabled. `bgra8unorm_storage`
corresponds to the WebGPU extension `bgra8unorm-storage`.

Note that because in SPIRV there is no `bgra8` image format, the texel
format `bgra8unorm` should be translated into `rgba8` in SPIRV, and
in Vulkan backend an image with format rgba8unorm and component
swizzling (`r` to `b` and `b` to `r`) will be bound to the descriptor
set.
@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2022

Previews, as seen when this build job started (23f55ba):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

@Jiawei-Shao Jiawei-Shao added the wgsl WebGPU Shading Language Issues label Nov 28, 2022
@Kangz
Copy link
Contributor

Kangz commented Nov 28, 2022

Note that because in SPIRV there is no bgra8 image format, the texel format bgra8unorm should be translated into rgba8 in SPIRV, and in Vulkan backend an image view with format rgba8unorm and component mapping (r to b and b to r) will be
bound to the descriptor set.

VkImageView component mapping is not allowed for storage usage. However something similar should be possible to do with format reinterpretation (of a bgra8unorm image to rgba8unorm) and shader instrumentation to do the component mapping there as well.

LGTM otherwise but we need to discuss it in the group (and check experimentally that the double component mapping works.)

@kainino0x
Copy link
Contributor

It's useful to know whether this feature is implementable on Vulkan, but it isn't designed to necessarily be implementable on Vulkan or D3D12. On those I believe we anticipate a lesser penalty for using rgba8unorm for canvases.

This limitation is not universal on underlying APIs: bgra8unorm storage is supported always on Metal, never on D3D12, and sometimes on Vulkan (if my investigation is correct).

...

This wouldn't be testable on a lot of machines, which means anyone who doesn't explicitly check for support (and test on Mac) is putting Mac at a perf/power disadvantage. However, this is pretty much the same trade-off as getPreferredFormat on desktop vs mobile.

-- #2748 (comment)

IIRC my "sometimes on Vulkan" statement was informed by gpuinfo reports. Here's the tail of a gpuinfo-vulkan-query output with the added requirement below. A ton of devices are lost, but a lot of AMD, Intel, and NVIDIA devices claim support. But if the spec doesn't allow it, maybe these are spurious results?

    add_rq('bgra8unorm storage', lambda info:
        format_supported_with_optimal_tiling_features(info.fmts, vk.Format.B8G8R8A8_UNORM, vk.FormatFeature.STORAGE_IMAGE) or
        format_supported_with_linear_tiling_features(info.fmts, vk.Format.B8G8R8A8_UNORM, vk.FormatFeature.STORAGE_IMAGE))
gpuinfo-vulkan-query output
Requirement "bgra8unorm storage" loses 83 (and partially loses 49) further deviceNames:
  In ALL reports (83 deviceNames):
    x Adreno (TM) 504: 7 (8629 9137 10642 11160 11664 12378 15689)
    x Adreno (TM) 505: 28 (4259 4457 4489 4824 6129 7394 7550 8516 8922 9025 9063 9355 9501 9798 10174 10776 11057 11789 12203 12269 12277 12342 13211 14230 14771 14913 16201 16983)
    x Adreno (TM) 506: 55 (3851 4541 4680 4724 4916 4956 5006 5250 5990 6044 6058 6151 6814 7023 7137 7612 8841 9054 9060 9935 10294 10314 10414 10431 10513 10542 10810 10941 10997 11017 11346 11423 11493 11526 11656 12201 12360 12454 12578 12618 12636 12785 12953 13423 13426 13508 13618 14282 15407 15552 15746 16302 16685 16691 17097)
    x Adreno (TM) 508: 9 (4452 6680 8652 10383 10442 10589 12379 13414 14872)
    x Adreno (TM) 509: 16 (4924 6120 8358 9062 9064 11486 11487 11488 11673 11820 12108 12678 13230 14911 15616 15895)
    x Adreno (TM) 510: 1 (6786)
    x Adreno (TM) 512: 47 (3724 4394 4400 4683 4768 5679 6063 6787 7385 8566 8697 10195 10204 10546 10608 10638 10656 10700 10775 11177 11237 11326 11399 11452 11475 11605 11663 11933 12813 13364 13421 13578 13616 13837 14233 14625 14716 14916 15742 16129 16187 16454 16516 16791 16933 16960 17204)
    x Adreno (TM) 530: 53 (3183 3597 3603 3765 3907 4359 4363 4773 4999 5019 5103 5210 5314 5399 5402 6072 6100 6215 6285 6560 6841 6885 7313 7542 7601 8268 8483 8544 9061 9332 10486 10681 10827 10838 10958 11034 11724 11874 12263 13278 13802 13934 13964 14311 14312 14364 14491 15081 15956 16195 16871 16931 16986)
    x Adreno (TM) 540: 79 (3422 3450 3532 3571 4071 4145 4433 4503 5102 5150 5215 5259 5383 5632 5811 5866 6046 6068 6083 6163 6208 6405 6796 7584 8603 8977 9008 9251 9354 9705 10284 10347 10597 10728 10752 10784 10786 10819 10844 10908 11101 11225 11338 11350 11485 11498 11665 11669 12292 12489 13097 13246 13294 13482 13577 13751 14142 14175 14369 14844 15188 15241 15257 15357 15391 15397 15526 15536 15628 15705 16055 16117 16223 16279 16285 16468 16977 17051 17304)
    x Adreno (TM) 610: 89 (7037 8669 9434 9524 10094 10192 10384 10410 10412 10420 10471 10516 10572 10885 10932 11059 11076 11212 11372 11375 11384 11390 11459 11522 11701 11917 11936 11946 11974 12002 12158 12294 12350 12367 12420 12546 12897 12899 12999 13031 13080 13146 13219 13257 13262 13288 13565 13651 13763 13903 13916 14022 14043 14203 14252 14331 14392 14437 14575 14594 14636 14714 14833 14836 14896 15020 15037 15174 15224 15235 15392 15403 15479 15555 15559 15597 15694 15905 15923 15967 15978 16000 16196 16290 16488 16821 17013 17359 17400)
    x Adreno (TM) 612: 20 (5789 6220 7178 7986 9014 10707 10874 11318 11661 12084 12126 12216 12476 14223 14301 14525 14548 15080 15106 15657)
    x Adreno (TM) 615: 15 (5944 6088 6436 7898 7927 8903 9147 9184 9422 10427 11275 12085 12583 12996 13171)
    x Adreno (TM) 616: 17 (4986 5287 6492 7806 9756 10393 10604 11072 11712 12858 13327 13564 14753 14828 15544 15614 15887)
    x Adreno (TM) 618: 82 (6379 7893 9036 9037 9351 9692 9862 10286 10295 10432 10481 10488 10499 10834 10897 10945 11022 11144 11198 11217 11253 11482 11615 11796 11813 11937 12035 12055 12144 12278 12918 13032 13042 13165 13178 13238 13598 13736 13865 13866 13915 13996 13998 13999 14122 14358 14359 14423 14718 14757 14923 15200 15243 15288 15326 15412 15439 15477 15495 15509 15751 15994 16128 16130 16131 16147 16151 16152 16153 16166 16541 16566 16569 16607 16788 16872 16873 16874 16875 17120 17279 17291)
    x Adreno (TM) 619: 37 (11041 11303 11380 11714 11905 12331 12332 12574 12623 12753 12772 12853 13438 13507 13898 14761 14839 14853 14982 15264 15334 15428 15557 15602 15718 15879 15880 16024 16096 16099 16146 16364 16375 16408 16487 16600 17402)
    x Adreno (TM) 620: 27 (9304 9995 10296 10646 10942 11510 11662 11957 12305 12329 12692 12757 12890 12952 13439 14665 14764 14858 15743 16001 16154 16359 16527 16710 16882 16956 17448)
    x Adreno (TM) 630: 123 (2801 3024 3138 3305 3442 3665 3687 3754 3755 3795 3810 3927 4134 4140 4249 4270 4366 4403 4413 4486 4525 4563 4599 4628 4632 4915 4926 5175 5253 5800 5886 6032 6038 6056 6107 6162 6234 6266 6434 6704 6788 6987 6996 7057 7108 7374 7949 8473 8577 8585 8907 8951 9097 9267 9471 10285 10287 10291 10300 10302 10303 10351 10371 10424 10460 10551 10672 10678 10730 10770 10813 10966 11016 11026 11035 11120 11464 11602 11670 11695 11914 11922 12213 12280 12363 12429 12430 12667 12775 13256 13424 13428 13552 13642 13675 13676 13749 13752 13963 13991 14092 14393 14463 14523 14608 14610 14611 14717 14751 14806 15580 15682 15962 15963 15997 16157 16169 16320 16330 16790 16818 16867 16888)
    x Adreno (TM) 640: 127 (5552 5633 6040 6188 6239 6363 6403 6603 6820 6875 7088 7175 7237 7595 7708 9111 9426 9503 10183 10305 10348 10368 10380 10391 10465 10611 10738 10768 10805 10847 10921 10923 10940 10943 10944 11070 11168 11190 11254 11257 11334 11368 11489 11495 11525 11575 11666 11667 11668 11671 11773 11799 11810 11847 11876 11895 11926 12423 12604 12841 12843 12846 12931 13027 13247 13309 13412 13493 13560 13629 13743 13753 13760 14009 14038 14101 14105 14247 14371 14416 14419 14460 14526 14561 14566 14681 14770 14793 14944 14945 14948 14987 15008 15086 15114 15116 15145 15172 15175 15189 15269 15280 15387 15493 15506 15528 15655 15681 15713 15828 15855 15915 16056 16202 16207 16300 16301 16303 16523 16543 16556 16687 16822 16824 17147 17254 17370)
    x Adreno (TM) 642: 4 (13528 14406 14666 16863)
    x Adreno (TM) 642L: 14 (13313 13542 13779 13892 15217 15729 16060 16190 16365 16461 16509 16520 16652 17454)
    x Adreno (TM) 650: 195 (7990 8177 9027 9701 9715 9725 9734 10024 10357 10370 10385 10401 10408 10416 10417 10485 10525 10531 10533 10637 10683 10705 10748 10804 10808 10836 10869 10959 11146 11171 11180 11216 11325 11457 11579 11646 11647 11711 11828 11845 11897 12052 12088 12182 12185 12291 12318 12330 12425 12595 12603 12635 12652 12800 12815 12826 12837 12877 12936 13022 13037 13138 13149 13167 13396 13488 13491 13535 13536 13626 13698 13742 13754 13766 13851 13957 13972 14029 14051 14086 14090 14094 14133 14153 14210 14211 14232 14319 14353 14354 14355 14438 14464 14504 14505 14509 14512 14539 14545 14559 14586 14587 14588 14589 14593 14662 14689 14744 14789 14814 14834 14838 14898 14912 14934 14935 14989 14998 15001 15048 15049 15053 15054 15055 15066 15102 15115 15130 15186 15187 15201 15272 15359 15361 15396 15408 15460 15463 15469 15471 15473 15492 15512 15543 15545 15612 15642 15644 15662 15663 15728 15814 15829 15839 15876 15898 15975 16376 16377 16399 16432 16453 16522 16538 16545 16620 16649 16659 16706 16707 16717 16720 16735 16736 16739 16776 16777 16787 16789 16801 16804 16817 16839 16861 16879 16948 16978 16980 17014 17199 17210 17334 17438 17440 17488)
    x Adreno (TM) 660: 72 (10268 10345 10721 10814 10948 10983 11001 11296 11333 11339 11405 11512 11523 11534 11672 11731 11873 11935 11991 12221 12323 12431 12437 12497 12511 12553 12587 13062 13064 13207 13249 13296 13400 13504 13583 13631 13792 13804 13981 14171 14212 14214 14290 14462 14518 14669 14817 14824 15132 15139 15209 15245 15266 15329 15347 15383 15530 15586 15626 15832 15838 15892 16245 16258 16260 16331 16343 16690 16946 17164 17168 17453)
    x Adreno (TM) 730: 51 (13441 13717 13731 13905 14181 14215 14220 14270 14277 14397 14481 14487 14511 14524 14905 14988 15402 15434 15453 15574 15646 15760 15771 15781 15803 15860 15889 15913 15929 15949 16163 16191 16203 16212 16217 16226 16263 16269 16312 16318 16496 16536 16568 16664 16703 16999 17028 17345 17475 17485 17494)
    x Adreno (TM) 740: 1 (17447)
    x Intel(R) Amber Lake (Kabylake) GT2: 1 (10423)
    x Intel(R) Bay Trail: 7 (6981 7230 7433 7444 7520 7643 8008)
    x Intel(R) HD Graphics (BYT): 9 (7808 8050 8437 8527 8735 9821 10325 11896 17121)
    x Intel(R) HD Graphics (CHV): 1 (9041)
    x Intel(R) HD Graphics (Cherrytrail): 4 (1774 4833 4957 7044)
    x Intel(R) HD Graphics (Coffeelake 3x8 GT2): 3 (3382 6017 7474)
    x Intel(R) HD Graphics (Coffeelake 3x8 GT3): 1 (6074)
    x Intel(R) HD Graphics (Comet Lake 3x8 GT2): 1 (8861)
    x Intel(R) HD Graphics 500 (Broxton 2x6): 4 (1734 1878 1971 3940)
    x Intel(R) HD Graphics 5000 (HSW GT3): 1 (9566)
    x Intel(R) HD Graphics 505: 3 (4241 4935 4978)
    x Intel(R) HD Graphics 505 (Broxton): 2 (3827 4946)
    x Intel(R) HD Graphics 510 (SKL GT1): 1 (13104)
    x Intel(R) HD Graphics 510 (Skylake GT1): 2 (3419 8103)
    x Intel(R) HD Graphics 515 (Skylake GT2): 1 (7805)
    x Intel(R) HD Graphics 520 (Skylake GT2): 33 (1445 1621 1847 1901 2098 2485 2486 2648 2667 2951 2987 3251 3343 3393 3549 3889 4008 4030 4114 4154 4389 4543 5131 5292 5640 5841 5845 6584 6807 7814 7867 8234 9885)
    x Intel(R) HD Graphics 530 (Skylake GT2): 72 (1446 1531 1555 1613 1638 1752 1767 1848 1849 1940 2076 2167 2189 2196 2397 2446 2476 2509 2600 2734 2758 2897 2958 3099 3195 3370 3464 3486 3536 3613 3619 3794 3798 3807 3998 4094 4104 4124 4317 4320 4333 4335 4345 4448 4559 4726 4880 5145 5212 5358 5446 5730 5749 5831 6277 6362 6557 6608 6666 6678 6768 6899 6931 7101 7174 7291 7476 7510 7580 7754 7763 8958)
    x Intel(R) HD Graphics 5300 (Broadwell GT2): 1 (1497)
    x Intel(R) HD Graphics 5500 (Broadwell GT2): 46 (1444 1618 1835 1993 2268 2320 2321 2451 2521 2595 2690 2875 2923 2977 3054 3180 3247 3275 3615 3689 3731 3999 4654 5182 5346 5736 5793 5996 6777 6779 6913 7036 7068 7113 7314 7382 7576 7596 7715 7809 7880 7916 7926 8121 8661 8930)
    x Intel(R) HD Graphics 6000 (BDW GT3): 1 (13392)
    x Intel(R) HD Graphics 6000 (Broadwell GT3): 2 (4716 7342)
    x Intel(R) HD Graphics 610 (Kaby Lake GT1): 4 (1464 2464 3455 4000)
    x Intel(R) HD Graphics 615 (KBL GT2): 1 (9353)
    x Intel(R) HD Graphics 615 (Kaby Lake GT2): 9 (2339 3440 3518 3938 4016 4177 4761 5951 6766)
    x Intel(R) HD Graphics 620 (Kaby Lake GT2): 67 (1449 1737 1879 1905 2004 2331 2501 2563 2594 3007 3022 3069 3115 3116 3203 3243 3246 3278 3398 3425 3468 3584 3591 3616 3617 3626 3644 3937 4082 4273 4519 4715 4819 4974 5048 5147 5564 5594 5699 5827 5858 5986 6118 6171 6189 6497 6504 6687 6744 6810 6831 6882 6989 6990 7034 7046 7047 7199 7338 7339 7470 7549 7566 7789 7801 8039 8371)
    x Intel(R) HD Graphics 630 (Kaby Lake GT2): 47 (1948 2070 2153 2364 2960 3038 3139 3446 3627 3823 3839 3861 4001 4005 4055 4206 4404 4633 4691 4808 4858 4862 4903 4951 5448 5467 5754 5976 6458 6541 6590 6646 6748 6793 6843 7083 7097 7104 7157 7204 7240 7344 7400 7704 7799 7914 8168)
    x Intel(R) HD Graphics P4000 (IVB GT2): 2 (8278 8900)
    x Intel(R) HD Graphics P530: 1 (6154)
    x Intel(R) HD Graphics P530 (Skylake GT2): 1 (7419)
    x Intel(R) HD Graphics P630: 3 (2698 8981 10049)
    x Intel(R) HD Graphics XXX (Braswell): 23 (1680 1740 1789 1929 1946 2281 2495 2669 3238 3465 3488 3565 3678 3679 3809 4185 4329 4330 4570 5153 5837 5838 10052)
    x Intel(R) Haswell Desktop: 12 (6432 7311 7332 7413 7557 7665 7803 7816 7917 7952 8076 9194)
    x Intel(R) Haswell Mobile: 12 (7006 7053 7330 7417 7423 7551 7650 7656 7700 7813 7924 7930)
    x Intel(R) Iris 6100 (Broadwell GT3): 2 (3245 7089)
    x Intel(R) Iris Graphics 540 (Skylake GT3e): 4 (1545 1673 2231 2332)
    x Intel(R) Iris Plus Graphics 640 (Kaby Lake GT3e): 2 (3986 3987)
    x Intel(R) Iris Plus Graphics 650 (Kaby Lake GT3e): 2 (6435 6726)
    x Intel(R) Iris Pro Graphics 580 (Skylake GT4e): 2 (4285 4877)
    x Intel(R) Iris(R) Graphics 6100 (BDW GT3): 3 (8386 8939 9197)
    x Intel(R) Iris(R) Plus Graphics (Ice Lake 8x8 GT2): 2 (7170 7908)
    x Intel(R) Iris(R) Plus Graphics 650: 1 (7315)
    x Intel(R) Iris(R) Pro Graphics 580: 3 (3285 3601 6559)
    x Intel(R) Iris(R) Pro Graphics 580 (SKL GT4): 1 (9704)
    x Intel(R) Iris(R) Pro Graphics P5200 (HSW GT3): 2 (9912 10783)
    x Intel(R) Ivybridge Desktop: 4 (7032 7081 7583 8252)
    x Intel(R) Ivybridge Mobile: 10 (7004 7153 7484 7699 7755 7774 7779 7812 7929 8240)
    x Intel(R) Ivybridge Server: 1 (7942)
    x Intel(R) UHD Graphics (Comet Lake 3x8 GT2): 3 (7563 7581 8390)
    x Intel(R) UHD Graphics (Whiskey Lake 3x8 GT2): 6 (7158 7471 7482 7587 7988 8098)
    x Intel(R) UHD Graphics 600 (Geminilake 2x6): 1 (17198)
    x Intel(R) UHD Graphics 605 (Geminilake): 3 (3898 4195 5676)
    x Intel(R) UHD Graphics 610: 1 (10176)
    x Intel(R) UHD Graphics 610 (CML GT1): 1 (11453)
    x Intel(R) UHD Graphics 620 (Kabylake GT2): 27 (2363 2573 2655 3911 4028 4091 4171 4233 4963 5180 5425 5463 5574 5581 5782 5936 6202 6241 6757 6852 7308 7452 7721 7731 7800 8163 8382)
    x Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2): 15 (4576 5045 5513 5810 6549 6836 7026 7080 7427 7437 7473 7567 7632 7807 8019)
    x Intel(R) UHD Graphics P630: 2 (7524 12345)
    x Mali-G51: 22 (4923 5377 6292 7669 10777 10788 11259 11286 11335 11337 11360 11379 11778 12255 12619 13310 13384 14281 15038 16156 16200 16482)
    x PowerVR B-Series BXT-32-1024: 1 (15920)
    x Turnip Adreno (TM) 618: 1 (14703)
  In SOME reports (49 deviceNames):
    ~ Intel(R) Graphics (RKL GT1): 2 of 6 (11835 11999; ok: 12632 14298 14314 16974)
    ~ Intel(R) HD Graphics (HSW GT1): 1 of 2 (10452; ok: 15901)
    ~ Intel(R) HD Graphics 2500 (IVB GT1): 5 of 10 (8863 10001 11199 12017 16753; ok: 12759 13563 14644 16444 16695)
    ~ Intel(R) HD Graphics 4000 (IVB GT2): 21 of 30 (7904 8299 8355 8723 9007 9101 9152 9421 9721 10047 10270 10349 10415 11073 11323 11356 11797 12426 12475 13314 17079; ok: 12428 13832 14366 14553 14791 15063 15598 16328 16634)
    ~ Intel(R) HD Graphics 4400 (HSW GT2): 7 of 24 (7859 8565 8886 9156 10164 13517 17428; ok: 12060 13551 13561 13679 13826 13870 14021 14023 14177 14293 14502 14517 14682 15078 15131 15588 17280)
    ~ Intel(R) HD Graphics 4600 (HSW GT2): 10 of 17 (8018 8030 8067 8069 8089 8247 8357 8666 9720 9795; ok: 12242 12556 12675 13189 13465 15447 15925)
    ~ Intel(R) HD Graphics 500: 5 of 14 (7890 9389 9719 12540 13994; ok: 9801 9841 10912 11157 12001 13409 13471 16680 17024)
    ~ Intel(R) HD Graphics 510: 3 of 4 (2336 6714 7782; ok: 16284)
    ~ Intel(R) HD Graphics 515: 3 of 4 (2284 3510 7078; ok: 10978)
    ~ Intel(R) HD Graphics 520: 51 of 87 (1617 2356 2985 3017 3103 3354 3636 3799 3947 4221 4276 4479 4659 4848 5018 5302 5636 5681 5776 5878 5979 6182 6544 6813 6825 6945 7093 7186 7250 7299 7528 7751 7957 7976 8224 8507 8570 8587 8676 8793 8905 8985 9205 9323 9466 9579 9682 9886 10023 12609 15508; ok: 9708 9733 9840 10082 10167 10228 10389 10647 10746 11154 11342 11417 11571 11736 11927 12111 12150 12314 12434 12491 12712 13034 13214 13418 14041 14124 14426 14606 14713 15042 15129 15344 15941 16754 16860 16870)
    ~ Intel(R) HD Graphics 520 (SKL GT2): 9 of 20 (8361 8531 9451 9639 11467 11494 11716 13347 13805; ok: 12659 13036 13145 13372 13678 13831 14489 15268 15965 16716 17005)
    ~ Intel(R) HD Graphics 530: 83 of 145 (1527 1756 2172 2260 2529 2538 2967 3106 3323 3395 3572 3573 3632 3733 3806 3954 4208 4230 4441 4487 4665 4865 5024 5149 5217 5265 5469 5547 5635 5651 5756 5779 5882 5925 5935 5982 6144 6204 6235 6428 6464 6550 6607 6661 6792 6816 6935 6944 6957 7125 7143 7191 7300 7319 7409 7449 7548 7687 7745 7877 7968 8198 8199 8238 8506 8574 8631 8656 8798 8911 8997 9042 9227 9228 9352 9445 9446 9447 9477 9540 9612 11091 13163; ok: 9681 9710 9744 9745 9858 9919 9934 10075 10083 10209 10210 10253 10392 10497 10636 10798 10799 10967 11131 11132 11133 11242 11304 11422 11503 11624 12253 12254 12488 12743 12758 13006 13045 13158 13425 13427 13434 13435 13660 13695 14005 14069 14450 14457 14722 14731 15032 15033 15138 15161 15363 15445 15476 15571 15950 16140 16182 16341 16654 16657 16954 17149)
    ~ Intel(R) HD Graphics 530 (SKL GT2): 39 of 77 (7743 7838 7839 7967 8261 8394 8713 8731 8750 8751 8794 8836 9010 9177 9238 9249 9289 9452 9543 9613 9749 9859 10250 10260 10282 10444 10523 11084 11135 11243 11308 11331 11753 11879 11899 12036 12995 14027 14034; ok: 11462 11628 12416 12741 12919 13005 13025 13157 13337 13387 13757 13880 14120 14174 14292 14368 14640 14799 14831 14871 15150 15284 15291 15294 15362 15520 15521 15570 15773 15867 15979 16047 16176 16360 16456 17268 17311 17466)
    ~ Intel(R) HD Graphics 5500 (BDW GT2): 16 of 26 (7973 8287 8312 8419 8496 8497 8662 8674 8687 8810 8986 9395 9491 9549 9921 10839; ok: 13248 13408 13960 14352 14405 14659 14782 15163 15292 16886)
    ~ Intel(R) HD Graphics 610: 4 of 5 (5337 6375 6660 6721; ok: 15047)
    ~ Intel(R) HD Graphics 615: 4 of 5 (2280 4838 5020 6225; ok: 11087)
    ~ Intel(R) HD Graphics 620: 58 of 85 (2064 2327 2438 2666 2849 3085 3109 3805 4024 4256 4707 4786 4867 5387 5623 5642 6085 6734 6837 6976 7100 7226 7307 7451 7468 7603 7604 7762 7767 7790 7921 7983 8035 8101 8257 8487 8522 8657 8670 8736 8831 8992 9022 9207 9234 9255 9341 9480 9563 9624 9804 10563 12007 13208 13315 13581 15854 16885; ok: 9776 9845 10090 10170 10252 10515 10754 11251 11352 11641 11645 11677 11953 12187 12452 12565 13659 14112 14953 15170 15648 15719 16170 16442 16708 16794 17205)
    ~ Intel(R) HD Graphics 620 (KBL GT2): 25 of 44 (7980 8275 8479 8519 8549 8550 8563 8730 8862 8894 8996 9009 9103 9167 9244 9277 9283 9378 9418 9971 10889 11451 11766 11916 12850; ok: 12747 12980 13356 13483 13680 13872 14219 14474 14490 14746 14873 14910 14972 15258 15330 15875 16071 16334 16524)
    ~ Intel(R) HD Graphics 630: 55 of 76 (2074 2145 2482 2514 2519 2963 3117 3284 3389 3669 3955 4202 4268 4465 4478 4655 5015 5169 5423 5453 5583 5781 5883 6156 6221 6371 6614 6673 6795 6874 6933 7091 7183 7229 7303 7350 7439 7521 7609 7734 7797 8344 8525 8596 8700 8817 8982 9253 9330 9364 9508 9678 10356 11414 14286; ok: 9740 9793 10151 10280 10615 10794 11412 11587 12156 12389 13044 14077 14772 14840 15263 15692 16053 16237 16644 17048 17360)
    ~ Intel(R) HD Graphics 630 (KBL GT2): 14 of 25 (8294 8551 9124 9457 9510 9627 9778 9967 10298 10856 10974 10976 11856 11881; ok: 12303 12447 12648 13672 13764 14201 14395 14413 15353 16458 17418)
    ~ Intel(R) HD Graphics XXX (BSW): 4 of 6 (9636 11681 11861 12324; ok: 12296 15109)
    ~ Intel(R) Iris(R) Graphics 540: 3 of 5 (2545 2625 3128; ok: 13416 13953)
    ~ Intel(R) Iris(R) Plus Graphics: 12 of 18 (6783 7442 7590 7706 7857 8346 8510 8634 8890 9583 10640 12639; ok: 10340 10704 10970 15216 15758 17153)
    ~ Intel(R) Iris(R) Plus Graphics (ICL GT2): 6 of 11 (8317 8471 9149 9372 9454 11134; ok: 12354 13722 14494 15687 17441)
    ~ Intel(R) Iris(R) Plus Graphics 640: 6 of 11 (2095 4197 5251 5400 7855 12435; ok: 12541 12907 13192 13567 14096)
    ~ Intel(R) Iris(R) Plus Graphics 655: 4 of 7 (6545 7744 8248 8314; ok: 9980 13107 15449)
    ~ Intel(R) Iris(TM) Plus Graphics 640: 1 of 6 (1732; ok: 13263 13264 13266 13756 15516)
    ~ Intel(R) UHD Graphics: 13 of 56 (8353 9376 9417 9899 10136 10155 10233 11751 13124 14527 15043 15446 17288; ok: 9878 10073 10161 10172 10288 10394 10634 10758 11173 11524 11684 11852 11891 11907 11928 12258 12547 12612 12755 13070 13455 13691 13737 13808 14044 14439 14647 14851 15219 15399 16007 16014 16274 16358 16826 16901 17107 17112 17119 17171 17188 17273 17384)
    ~ Intel(R) UHD Graphics (CML GT2): 19 of 34 (8913 9397 9410 10100 10175 10544 10666 11201 11411 11445 11529 11831 11965 11984 12067 12070 12211 12502 12856; ok: 12252 12407 12586 13611 14273 14350 14421 14535 14564 14723 14932 15220 15818 16021 16435)
    ~ Intel(R) UHD Graphics (ICL GT1): 3 of 5 (9011 11082 12761; ok: 16032 16150)
    ~ Intel(R) UHD Graphics 600: 5 of 15 (7713 7736 8844 13359 16224; ok: 10021 10247 10595 11211 12444 13166 14827 15191 16674 17389)
    ~ Intel(R) UHD Graphics 605: 1 of 2 (10293; ok: 17088)
    ~ Intel(R) UHD Graphics 620: 63 of 86 (2350 2353 2944 2992 3318 3462 3684 3788 4265 4557 4740 4875 5195 5246 5509 5816 5977 6382 6539 6569 6654 6664 6682 6695 6790 6832 6937 6951 6966 7017 7131 7182 7296 7461 7523 7792 7987 8049 8140 8227 8518 8613 8690 8790 8796 8834 8842 9026 9334 9482 9486 9587 9722 9759 10229 10718 11954 12510 12629 12703 15604 16894 16906; ok: 9889 10350 10809 11018 11508 11708 11784 11992 12695 13343 13349 13746 14178 14283 14715 14978 15320 15365 15429 15948 16489 16902 17266)
    ~ Intel(R) UHD Graphics 620 (KBL GT2): 13 of 22 (8380 8443 8557 8627 8632 8765 9428 9500 9920 11402 11790 12490 13518; ok: 12499 13330 13476 13820 13914 14333 16286 16398 17409)
    ~ Intel(R) UHD Graphics 620 (WHL GT2): 15 of 45 (8113 8334 8617 9107 9405 9703 9823 9846 10824 10862 11075 11295 11816 13503 13628; ok: 12307 12751 12949 12958 13834 13879 13936 14146 14399 14480 14674 14826 14993 15040 15103 15251 15305 15456 15458 15634 15755 15954 16148 16210 16252 16564 16756 16858 17140 17411)
    ~ Intel(R) UHD Graphics 630: 56 of 105 (2796 3114 3168 3346 3744 3817 4385 4513 4686 4890 4919 5285 5639 6022 6050 6181 6187 6543 6601 6649 6811 6923 6991 7024 7092 7185 7298 7518 7748 7956 8100 8267 8569 8580 8586 8619 8792 8857 8984 9204 9322 9406 9420 9440 9458 9465 9578 9601 11817 12657 12670 13067 13576 14605 16721 17456; ok: 9003 9732 9839 10081 10096 10165 10227 10257 10388 10745 11153 11622 11913 11925 12149 12249 12433 12597 12711 12762 12835 12848 12975 13029 13252 13407 13417 14040 14127 14398 14427 14591 14712 14968 15125 15297 15345 15562 15564 15712 15939 16164 16378 16770 16783 16811 16856 16996 17175)
    ~ Intel(R) UHD Graphics 630 (CFL GT2): 10 of 32 (8243 8347 8644 9166 9176 9338 10343 10917 11062 13183; ok: 11446 11793 12505 12921 12974 13007 13135 13229 13608 13989 14091 14154 14384 15094 15233 15335 15514 15621 15821 16052 16289 17323)
    ~ Intel(R) UHD Graphics 630 (CML GT2): 2 of 4 (10258 10263; ok: 16900 17290)
    ~ Intel(R) Xe Graphics (TGL GT2): 7 of 34 (10605 10782 11483 11822 12083 14144 15467; ok: 13376 13733 13926 13975 13992 14415 14435 14551 14552 14677 14728 14777 15270 15336 15355 15532 15766 16020 16051 16219 16228 16254 16310 16414 17159 17212 17405)
    ~ Mali-G52: 3 of 26 (9942 12630 15378; ok: 10194 11056 11982 12046 12062 12284 12622 12643 12798 14045 14925 15260 15490 15727 15736 15996 16385 16469 16506 16992 17167 17176 17292)
    ~ Mali-G52 MC2: 1 of 41 (7412; ok: 8797 10324 10667 10849 10855 10960 10986 11043 11291 11614 11870 11901 12515 12628 12673 12810 12948 13342 13433 13594 13669 14065 14190 14320 15256 15400 15548 15556 15567 15667 15740 15918 15976 16161 16324 16354 16530 17282 17338 17387)
    ~ Mali-G72: 33 of 72 (2742 3206 3448 3781 3863 4200 4392 4602 4756 4871 5209 5540 6070 6158 6561 6593 6839 6979 9031 10185 10493 10916 10961 11782 12241 13059 13129 14271 14272 14687 15451 15730 16930; ok: 7335 10297 10316 10409 10500 10561 10593 10737 10797 10922 10933 11060 11071 11078 11188 11226 11267 11313 11330 11537 11559 11660 12179 12319 12371 12372 12427 12742 13255 13521 13785 14167 15084 15242 15379 16083 16521 16583 17469)
    ~ Mali-G72 MP3: 10 of 24 (4158 4814 5644 6051 6248 11189 11572 13443 14420 16803; ok: 8572 10811 10812 11183 11939 12222 12658 13147 13286 13293 14890 15513 16380 16997)
    ~ Mali-G76: 32 of 56 (5370 5374 5529 5558 5917 6036 6039 6110 6227 6737 7395 10364 10433 10851 11020 11221 11344 11418 11473 11555 11713 11967 11968 12580 12592 13360 14229 14891 15390 16227 16590 16889; ok: 7441 9760 10520 10553 11165 11601 11649 11650 11848 11853 12326 12373 12654 12748 12894 13326 13822 14108 14263 14563 14701 14803 15110 17262)
    ~ Mali-G76 MC4: 1 of 12 (7301; ok: 8775 11889 12030 13477 13602 13693 13938 14688 14986 15404 16447)
    ~ Turnip Adreno (TM) 630: 1 of 6 (14614; ok: 15190 15899 16477 16537 16670)
    ~ Turnip Adreno (TM) 640: 3 of 12 (14106 14285 14550; ok: 14798 15940 16124 16511 16629 16848 16853 16881 16945)
    ~ Turnip Adreno (TM) 650: 9 of 42 (14102 14104 14119 14231 14280 14543 14612 14702 14809; ok: 14795 14920 14931 14940 15470 15779 15969 16012 16013 16039 16054 16198 16232 16234 16346 16347 16400 16460 16508 16510 16513 16546 16599 16609 16656 16718 16738 17011 17012 17114 17135 17187 17431)
    ~ Turnip Adreno (TM) 660: 2 of 18 (14269 15625; ok: 15328 15722 15782 16006 16016 16189 16455 16514 16515 16621 16668 16808 16947 17083 17095 17163)
At least one of each of the following was still supported:
  + (null) (RADV NAVI22)
  + (null) (RADV REMBRANDT)
  + (null) (RADV RENOIR)
  + AMD 15D8:C8
  + AMD 15D8:C9
  + AMD Embedded Radeon E9175
  + AMD FirePro D300
  + AMD FirePro D300 (FireGL V)
  + AMD FirePro M4150
  + AMD FirePro M5100
  + AMD FirePro S7150
  + AMD FirePro S9150
  + AMD FirePro W2100
  + AMD FirePro W4100
  + AMD FirePro W5100 (RADV BONAIRE)
  + AMD FirePro W7000
  + AMD FirePro W7100
  + AMD RADEON R9 M295X
  + AMD RADV BEIGE_GOBY
  + AMD RADV BONAIRE
  + AMD RADV CAPE VERDE
  + AMD RADV CARRIZO
  + AMD RADV DIMGREY_CAVEFISH
  + AMD RADV FIJI
  + AMD RADV GLADIUS
  + AMD RADV HAINAN
  + AMD RADV HAWAII
  + AMD RADV ICELAND
  + AMD RADV KABINI
  + AMD RADV KAVERI
  + AMD RADV MULLINS
  + AMD RADV NAVI10
  + AMD RADV NAVI14
  + AMD RADV NAVI21
  + AMD RADV NAVY_FLOUNDER
  + AMD RADV OLAND
  + AMD RADV PITCAIRN
  + AMD RADV POLARIS10
  + AMD RADV POLARIS11
  + AMD RADV POLARIS12
  + AMD RADV RAVEN
  + AMD RADV RAVEN2
  + AMD RADV RENOIR
  + AMD RADV SIENNA_CICHLID
  + AMD RADV STONEY
  + AMD RADV TAHITI
  + AMD RADV TONGA
  + AMD RADV VANGOGH
  + AMD RADV VEGA
  + AMD RADV VEGA M
  + AMD RADV VEGA10
  + AMD RADV VEGA20
  + AMD RADV VEGAM
  + AMD RADV VERDE
  + AMD RADV unknown
  + AMD RADV/ACO CARRIZO
  + AMD RADV/ACO FIJI
  + AMD RADV/ACO ICELAND
  + AMD RADV/ACO KABINI
  + AMD RADV/ACO KAVERI
  + AMD RADV/ACO NAVI10
  + AMD RADV/ACO PITCAIRN
  + AMD RADV/ACO POLARIS10
  + AMD RADV/ACO POLARIS11
  + AMD RADV/ACO POLARIS12
  + AMD RADV/ACO RAVEN
  + AMD RADV/ACO RAVEN2
  + AMD RADV/ACO STONEY
  + AMD RADV/ACO TAHITI
  + AMD RADV/ACO VEGA10
  + AMD Radeon (TM) 520
  + AMD Radeon (TM) 535DX
  + AMD Radeon (TM) 620
  + AMD Radeon (TM) HD 8500M/8700M
  + AMD Radeon (TM) Pro WX 7100 Graphics
  + AMD Radeon (TM) R5 340
  + AMD Radeon (TM) R5 M320
  + AMD Radeon (TM) R5 M330
  + AMD Radeon (TM) R5 M335
  + AMD Radeon (TM) R5 M430
  + AMD Radeon (TM) R7 300 Series
  + AMD Radeon (TM) R7 360 Series
  + AMD Radeon (TM) R7 370 Series
  + AMD Radeon (TM) R7 370 Series Graphics
  + AMD Radeon (TM) R7 M340
  + AMD Radeon (TM) R7 M350
  + AMD Radeon (TM) R7 M360
  + AMD Radeon (TM) R7 M460
  + AMD Radeon (TM) R9 200 Series
  + AMD Radeon (TM) R9 370 Series
  + AMD Radeon (TM) R9 380 Series
  + AMD Radeon (TM) R9 390 Series
  + AMD Radeon (TM) R9 Fury Series
  + AMD Radeon (TM) R9 M360
  + AMD Radeon (TM) R9 M375
  + AMD Radeon (TM) R9 M375X
  + AMD Radeon (TM) RX 460 Graphics
  + AMD Radeon (TM) RX 470 Graphics
  + AMD Radeon (TM) RX 480
  + AMD Radeon (TM) RX 480 Graphics
  + AMD Radeon (TM) RX 570
  + AMD Radeon (TM) RX 580
  + AMD Radeon Graphics
  + AMD Radeon Graphics (RADV RENOIR)
  + AMD Radeon HD - FirePro D300
  + AMD Radeon HD 7700 Series
  + AMD Radeon HD 7700M Series
  + AMD Radeon HD 7770 GHz Edition
  + AMD Radeon HD 7800 Series
  + AMD Radeon HD 7800 Series (RADV PITCAIRN)
  + AMD Radeon HD 7900 Series
  + AMD Radeon HD 8330
  + AMD Radeon HD 8400 / R3 Series
  + AMD Radeon HD 8500 Series
  + AMD Radeon HD 8500 series
  + AMD Radeon HD 8500M
  + AMD Radeon HD 8500M Series
  + AMD Radeon HD 8570
  + AMD Radeon HD 8600/8700M
  + AMD Radeon HD 8600M Series
  + AMD Radeon HD 8790M
  + AMD Radeon HD 8800M Series
  + AMD Radeon HD 8950
  + AMD Radeon PRO W6400
  + AMD Radeon PRO W6800
  + AMD Radeon Pro 460
  + AMD Radeon Pro 5300M
  + AMD Radeon Pro 5500M
  + AMD Radeon Pro 555X
  + AMD Radeon Pro 560
  + AMD Radeon Pro 5600M
  + AMD Radeon Pro 560X
  + AMD Radeon Pro 580X
  + AMD Radeon Pro V520 MxGPU
  + AMD Radeon Pro Vega 20
  + AMD Radeon Pro Vega 56
  + AMD Radeon Pro W5500
  + AMD Radeon Pro W6600
  + AMD Radeon Pro WX 5100 Graphics
  + AMD Radeon Pro WX 5100 Graphics (RADV POLARIS10)
  + AMD Radeon Pro WX Series
  + AMD Radeon R3 Graphics
  + AMD Radeon R5 430
  + AMD Radeon R5 Graphics
  + AMD Radeon R5 M200 Series
  + AMD Radeon R5 M230 Series
  + AMD Radeon R5 M255
  + AMD Radeon R5 M445 Series
  + AMD Radeon R6 Graphics
  + AMD Radeon R6 Graphics (RADV CARRIZO)
  + AMD Radeon R7 200 Series
  + AMD Radeon R7 240
  + AMD Radeon R7 240 Series
  + AMD Radeon R7 250 Series
  + AMD Radeon R7 350 Series
  + AMD Radeon R7 Graphics
  + AMD Radeon R7 Graphics + R7 200 Dual Graphics
  + AMD Radeon R7 M260
  + AMD Radeon R7 M260 Series
  + AMD Radeon R7 M260DX
  + AMD Radeon R7 M265 Series
  + AMD Radeon R7 M360 (RADV ICELAND)
  + AMD Radeon R9 200 / HD 7900 Series
  + AMD Radeon R9 200 Series
  + AMD Radeon R9 380 Series (RADV TONGA)
  + AMD Radeon R9 390 Series (RADV HAWAII)
  + AMD Radeon R9 Fury Series (RADV FIJI)
  + AMD Radeon R9 M200X Series
  + AMD Radeon R9 M370X
  + AMD Radeon R9 M380
  + AMD Radeon RX 550 / 550 Series
  + AMD Radeon RX 550 / 550 Series (RADV POLARIS12)
  + AMD Radeon RX 550 Series (RADV POLARIS11)
  + AMD Radeon RX 5500
  + AMD Radeon RX 5500 XT
  + AMD Radeon RX 5500 XT (RADV NAVI14)
  + AMD Radeon RX 560 Series
  + AMD Radeon RX 560 Series (RADV POLARIS11)
  + AMD Radeon RX 5600 XT
  + AMD Radeon RX 5600 XT (RADV NAVI10)
  + AMD Radeon RX 5600M
  + AMD Radeon RX 570
  + AMD Radeon RX 570 Series
  + AMD Radeon RX 570 Series (RADV POLARIS10)
  + AMD Radeon RX 5700
  + AMD Radeon RX 5700 XT
  + AMD Radeon RX 5700 XT (RADV NAVI10)
  + AMD Radeon RX 5700 XT 50th Anniversary
  + AMD Radeon RX 580
  + AMD Radeon RX 580 2048SP
  + AMD Radeon RX 580 Series
  + AMD Radeon RX 580 Series (RADV POLARIS10)
  + AMD Radeon RX 6400
  + AMD Radeon RX 6500 XT
  + AMD Radeon RX 6600
  + AMD Radeon RX 6600 XT
  + AMD Radeon RX 6600 XT (RADV NAVI23)
  + AMD Radeon RX 6700
  + AMD Radeon RX 6700 (RADV NAVI22)
  + AMD Radeon RX 6700 XT
  + AMD Radeon RX 6700S
  + AMD Radeon RX 6750 XT
  + AMD Radeon RX 6800
  + AMD Radeon RX 6800 (RADV NAVI21)
  + AMD Radeon RX 6800 XT
  + AMD Radeon RX 6800 XT (RADV NAVI21)
  + AMD Radeon RX 6800M
  + AMD Radeon RX 6900 XT
  + AMD Radeon RX 6900 XT (RADV NAVI21)
  + AMD Radeon RX 6950 XT (RADV NAVI21)
  + AMD Radeon RX Vega
  + AMD Radeon RX Vega (RADV VEGA10)
  + AMD Radeon RX Vega 64
  + AMD Radeon RX550 series
  + AMD Radeon VII
  + AMD Radeon Vega 10 Graphics
  + AMD Radeon Vega 10 Graphics (RADV RAVEN)
  + AMD Radeon Vega 3 Graphics
  + AMD Radeon Vega 8 Graphics
  + AMD Radeon Vega 8 Graphics (RADV RAVEN)
  + AMD Radeon(TM) 530
  + AMD Radeon(TM) Graphics
  + AMD Radeon(TM) HD 8800 Series
  + AMD Radeon(TM) HD8970M
  + AMD Radeon(TM) R2 Graphics
  + AMD Radeon(TM) R3 Graphics
  + AMD Radeon(TM) R4 Graphics
  + AMD Radeon(TM) R5 240
  + AMD Radeon(TM) R5 340X
  + AMD Radeon(TM) R5 Graphics
  + AMD Radeon(TM) R5 M430
  + AMD Radeon(TM) R6 Graphics
  + AMD Radeon(TM) R7 350X
  + AMD Radeon(TM) R7 Graphics
  + AMD Radeon(TM) R9 370 series
  + AMD Radeon(TM) RX 560 Series
  + AMD Radeon(TM) RX 6500 XT
  + AMD Radeon(TM) RX Vega 10 Graphics
  + AMD Radeon(TM) RX Vega 10 Graphics 
  + AMD Radeon(TM) RX Vega 11 Graphics
  + AMD Radeon(TM) Vega 10 Graphics
  + AMD Radeon(TM) Vega 11 Graphics
  + AMD Radeon(TM) Vega 3
  + AMD Radeon(TM) Vega 3 Graphics
  + AMD Radeon(TM) Vega 3 Graphics 
  + AMD Radeon(TM) Vega 3 Mobile Graphics
  + AMD Radeon(TM) Vega 6 Graphics
  + AMD Radeon(TM) Vega 6 Graphics 
  + AMD Radeon(TM) Vega 8 Graphics
  + AMD Radeon(TM) Vega 8 Graphics 
  + AMD Radeon(TM) Vega 8 Mobile Graphics
  + AMD Ryzen Embedded V1605B with Radeon Vega Gfx
  + AMD Unknown (RADV REMBRANDT)
  + AMD Unknown (RADV RENOIR)
  + ASUS R7 265 Series
  + ASUS R9 280 Series
  + Apple M1
  + Apple M1 Max
  + Apple M1 Pro
  + Apple M1 Ultra
  + Apple M2
  + GRID T4-2B
  + GeForce 840A
  + GeForce 840M
  + GeForce 845M
  + GeForce 920M
  + GeForce 920MX
  + GeForce 930M
  + GeForce 930MX
  + GeForce 940M
  + GeForce 940MX
  + GeForce GPU
  + GeForce GT 1030
  + GeForce GT 630
  + GeForce GT 635
  + GeForce GT 640
  + GeForce GT 640M
  + GeForce GT 640M LE
  + GeForce GT 645M
  + GeForce GT 650M
  + GeForce GT 710
  + GeForce GT 720
  + GeForce GT 730
  + GeForce GT 730M
  + GeForce GT 740
  + GeForce GT 740M
  + GeForce GT 745M
  + GeForce GT 750M
  + GeForce GT 755M
  + GeForce GTX 1050
  + GeForce GTX 1050 Ti
  + GeForce GTX 1050 Ti with Max-Q Design
  + GeForce GTX 1050 with Max-Q Design
  + GeForce GTX 1060
  + GeForce GTX 1060 3GB
  + GeForce GTX 1060 6GB
  + GeForce GTX 1060 with Max-Q Design
  + GeForce GTX 1070
  + GeForce GTX 1070 Ti
  + GeForce GTX 1070 with Max-Q Design
  + GeForce GTX 1080
  + GeForce GTX 1080 Ti
  + GeForce GTX 1080 with Max-Q Design
  + GeForce GTX 1650
  + GeForce GTX 1650 SUPER
  + GeForce GTX 1650 Ti
  + GeForce GTX 1650 Ti with Max-Q Design
  + GeForce GTX 1650 with Max-Q Design
  + GeForce GTX 1660
  + GeForce GTX 1660 SUPER
  + GeForce GTX 1660 Ti
  + GeForce GTX 1660 Ti with Max-Q Design
  + GeForce GTX 645
  + GeForce GTX 650
  + GeForce GTX 650 Ti
  + GeForce GTX 650 Ti BOOST
  + GeForce GTX 660
  + GeForce GTX 660 Ti
  + GeForce GTX 660M
  + GeForce GTX 670
  + GeForce GTX 670MX
  + GeForce GTX 675MX
  + GeForce GTX 680
  + GeForce GTX 680MX
  + GeForce GTX 690
  + GeForce GTX 745
  + GeForce GTX 750
  + GeForce GTX 750 Ti
  + GeForce GTX 760
  + GeForce GTX 760 (192-bit)
  + GeForce GTX 760 Ti OEM
  + GeForce GTX 760M
  + GeForce GTX 765M
  + GeForce GTX 770
  + GeForce GTX 770M
  + GeForce GTX 780
  + GeForce GTX 780 Ti
  + GeForce GTX 780M
  + GeForce GTX 850M
  + GeForce GTX 860M
  + GeForce GTX 870M
  + GeForce GTX 880M
  + GeForce GTX 950
  + GeForce GTX 950M
  + GeForce GTX 960
  + GeForce GTX 960M
  + GeForce GTX 965M
  + GeForce GTX 970
  + GeForce GTX 970M
  + GeForce GTX 980
  + GeForce GTX 980 Ti
  + GeForce GTX 980M
  + GeForce GTX TITAN
  + GeForce GTX TITAN Black
  + GeForce GTX TITAN X
  + GeForce GTX TITAN Z
  + GeForce MX110
  + GeForce MX130
  + GeForce MX150
  + GeForce MX230
  + GeForce MX250
  + GeForce MX330
  + GeForce MX350
  + GeForce RTX 2060
  + GeForce RTX 2060 SUPER
  + GeForce RTX 2060 with Max-Q Design
  + GeForce RTX 2070
  + GeForce RTX 2070 SUPER
  + GeForce RTX 2070 with Max-Q Design
  + GeForce RTX 2080
  + GeForce RTX 2080 SUPER
  + GeForce RTX 2080 Super with Max-Q Design
  + GeForce RTX 2080 Ti
  + GeForce RTX 2080 with Max-Q Design
  + GeForce RTX 3050 Laptop GPU
  + GeForce RTX 3050 Ti Laptop GPU
  + GeForce RTX 3060 Laptop GPU
  + GeForce RTX 3060 Ti
  + GeForce RTX 3070
  + GeForce RTX 3070 Laptop GPU
  + GeForce RTX 3080
  + GeForce RTX 3080 Laptop GPU
  + GeForce RTX 3090
  + Intel HD Graphics 4000
  + Intel HD Graphics 5000
  + Intel Iris Graphics
  + Intel Iris Pro Graphics
  + Intel(R) Arc(TM) A370M Graphics
  + Intel(R) Arc(TM) A380  Graphics
  + Intel(R) Arc(TM) A380 Graphics
  + Intel(R) Arc(TM) A750 Graphics
  + Intel(R) Arc(TM) A770 Graphics
  + Intel(R) Arc(tm) A380 Graphics (DG2)
  + Intel(R) Arc(tm) A750 Graphics (DG2)
  + Intel(R) Graphics (ADL GT2)
  + Intel(R) Graphics (ADL-S GT1)
  + Intel(R) Graphics (DG2)
  + Intel(R) Graphics (RKL GT1)
  + Intel(R) HD Graphics (HSW GT1)
  + Intel(R) HD Graphics 2500 (IVB GT1)
  + Intel(R) HD Graphics 400 (BSW)
  + Intel(R) HD Graphics 4000 (IVB GT2)
  + Intel(R) HD Graphics 4400 (HSW GT2)
  + Intel(R) HD Graphics 4600 (HSW GT2)
  + Intel(R) HD Graphics 500
  + Intel(R) HD Graphics 500 (APL 2)
  + Intel(R) HD Graphics 505 (APL 3)
  + Intel(R) HD Graphics 510
  + Intel(R) HD Graphics 515
  + Intel(R) HD Graphics 520
  + Intel(R) HD Graphics 520 (SKL GT2)
  + Intel(R) HD Graphics 530
  + Intel(R) HD Graphics 530 (SKL GT2)
  + Intel(R) HD Graphics 5500 (BDW GT2)
  + Intel(R) HD Graphics 610
  + Intel(R) HD Graphics 610 (KBL GT1)
  + Intel(R) HD Graphics 615
  + Intel(R) HD Graphics 620
  + Intel(R) HD Graphics 620 (KBL GT2)
  + Intel(R) HD Graphics 630
  + Intel(R) HD Graphics 630 (KBL GT2)
  + Intel(R) HD Graphics Gen11
  + Intel(R) HD Graphics XXX (BSW)
  + Intel(R) Iris(R) Graphics 540
  + Intel(R) Iris(R) Graphics 540 (SKL GT3)
  + Intel(R) Iris(R) Graphics 550
  + Intel(R) Iris(R) Plus Graphics
  + Intel(R) Iris(R) Plus Graphics (ICL GT1.5)
  + Intel(R) Iris(R) Plus Graphics (ICL GT2)
  + Intel(R) Iris(R) Plus Graphics 640
  + Intel(R) Iris(R) Plus Graphics 640 (Kaby Lake GT3e) (KBL GT3)
  + Intel(R) Iris(R) Plus Graphics 655
  + Intel(R) Iris(R) Plus Graphics 655 (CFL GT3)
  + Intel(R) Iris(R) Xe Graphics
  + Intel(R) Iris(R) Xe MAX Graphics
  + Intel(R) Iris(TM) Graphics 6000
  + Intel(R) Iris(TM) Plus Graphics
  + Intel(R) Iris(TM) Plus Graphics 640
  + Intel(R) Iris(TM) Plus Graphics 645
  + Intel(R) Iris(TM) Plus Graphics 650
  + Intel(R) SKL Unknown
  + Intel(R) UHD Graphics
  + Intel(R) UHD Graphics (CML GT2)
  + Intel(R) UHD Graphics (ICL GT1)
  + Intel(R) UHD Graphics (TGL GT1)
  + Intel(R) UHD Graphics 600
  + Intel(R) UHD Graphics 605
  + Intel(R) UHD Graphics 620
  + Intel(R) UHD Graphics 620 (KBL GT2)
  + Intel(R) UHD Graphics 620 (WHL GT2)
  + Intel(R) UHD Graphics 630
  + Intel(R) UHD Graphics 630 (CFL GT2)
  + Intel(R) UHD Graphics 630 (CML GT2)
  + Intel(R) UHD Graphics 730
  + Intel(R) UHD Graphics 750
  + Intel(R) UHD Graphics 770
  + Intel(R) UHD Graphics 770 (ADL-S GT1)
  + Intel(R) Xe Graphics (TGL GT2)
  + Mali-G52
  + Mali-G52 MC2
  + Mali-G57
  + Mali-G57 MC2
  + Mali-G57 MC3
  + Mali-G610
  + Mali-G610 MC6
  + Mali-G68
  + Mali-G68 MC4
  + Mali-G710
  + Mali-G710 MC10
  + Mali-G72
  + Mali-G72 MP3
  + Mali-G76
  + Mali-G76 MC4
  + Mali-G77
  + Mali-G77 MC7
  + Mali-G77 MC9
  + Mali-G78
  + MuMu GL/VK
  + NVIDIA GeForce 830M
  + NVIDIA GeForce 840M
  + NVIDIA GeForce 930M
  + NVIDIA GeForce 940M
  + NVIDIA GeForce 940MX
  + NVIDIA GeForce GT 1030
  + NVIDIA GeForce GT 630
  + NVIDIA GeForce GT 635
  + NVIDIA GeForce GT 640
  + NVIDIA GeForce GT 650M
  + NVIDIA GeForce GT 710
  + NVIDIA GeForce GT 730
  + NVIDIA GeForce GT 730M
  + NVIDIA GeForce GT 740
  + NVIDIA GeForce GT 750M
  + NVIDIA GeForce GTX 1050
  + NVIDIA GeForce GTX 1050 Ti
  + NVIDIA GeForce GTX 1050 Ti with Max-Q Design
  + NVIDIA GeForce GTX 1050 with Max-Q Design
  + NVIDIA GeForce GTX 1060
  + NVIDIA GeForce GTX 1060 3GB
  + NVIDIA GeForce GTX 1060 6GB
  + NVIDIA GeForce GTX 1060 with Max-Q Design
  + NVIDIA GeForce GTX 1070
  + NVIDIA GeForce GTX 1070 Ti
  + NVIDIA GeForce GTX 1070 with Max-Q Design
  + NVIDIA GeForce GTX 1080
  + NVIDIA GeForce GTX 1080 Ti
  + NVIDIA GeForce GTX 1650
  + NVIDIA GeForce GTX 1650 SUPER
  + NVIDIA GeForce GTX 1650 Ti
  + NVIDIA GeForce GTX 1660
  + NVIDIA GeForce GTX 1660 SUPER
  + NVIDIA GeForce GTX 1660 Ti
  + NVIDIA GeForce GTX 1660 Ti with Max-Q Design
  + NVIDIA GeForce GTX 650
  + NVIDIA GeForce GTX 650 Ti
  + NVIDIA GeForce GTX 660
  + NVIDIA GeForce GTX 670
  + NVIDIA GeForce GTX 680MX
  + NVIDIA GeForce GTX 690
  + NVIDIA GeForce GTX 745
  + NVIDIA GeForce GTX 750
  + NVIDIA GeForce GTX 750 Ti
  + NVIDIA GeForce GTX 760
  + NVIDIA GeForce GTX 760 (192-bit)
  + NVIDIA GeForce GTX 765M
  + NVIDIA GeForce GTX 770
  + NVIDIA GeForce GTX 780
  + NVIDIA GeForce GTX 780 Ti
  + NVIDIA GeForce GTX 850M
  + NVIDIA GeForce GTX 860M
  + NVIDIA GeForce GTX 950
  + NVIDIA GeForce GTX 950M
  + NVIDIA GeForce GTX 960
  + NVIDIA GeForce GTX 960M
  + NVIDIA GeForce GTX 970
  + NVIDIA GeForce GTX 970M
  + NVIDIA GeForce GTX 980
  + NVIDIA GeForce GTX 980 Ti
  + NVIDIA GeForce GTX 980M
  + NVIDIA GeForce GTX TITAN X
  + NVIDIA GeForce MX110
  + NVIDIA GeForce MX130
  + NVIDIA GeForce MX150
  + NVIDIA GeForce MX230
  + NVIDIA GeForce MX250
  + NVIDIA GeForce MX330
  + NVIDIA GeForce MX350
  + NVIDIA GeForce MX450
  + NVIDIA GeForce RTX 2060
  + NVIDIA GeForce RTX 2060 SUPER
  + NVIDIA GeForce RTX 2060 with Max-Q Design
  + NVIDIA GeForce RTX 2070
  + NVIDIA GeForce RTX 2070 SUPER
  + NVIDIA GeForce RTX 2070 Super
  + NVIDIA GeForce RTX 2070 with Max-Q Design
  + NVIDIA GeForce RTX 2080
  + NVIDIA GeForce RTX 2080 SUPER
  + NVIDIA GeForce RTX 2080 Super with Max-Q Design
  + NVIDIA GeForce RTX 2080 Ti
  + NVIDIA GeForce RTX 2080 with Max-Q Design
  + NVIDIA GeForce RTX 3050
  + NVIDIA GeForce RTX 3050 Laptop GPU
  + NVIDIA GeForce RTX 3050 Ti Laptop GPU
  + NVIDIA GeForce RTX 3060
  + NVIDIA GeForce RTX 3060 Laptop GPU
  + NVIDIA GeForce RTX 3060 Ti
  + NVIDIA GeForce RTX 3070
  + NVIDIA GeForce RTX 3070 Laptop GPU
  + NVIDIA GeForce RTX 3070 Ti
  + NVIDIA GeForce RTX 3070 Ti Laptop GPU
  + NVIDIA GeForce RTX 3080
  + NVIDIA GeForce RTX 3080 Laptop GPU
  + NVIDIA GeForce RTX 3080 Ti
  + NVIDIA GeForce RTX 3090
  + NVIDIA GeForce RTX 3090 Ti
  + NVIDIA GeForce RTX 4080
  + NVIDIA GeForce RTX 4090
  + NVIDIA Quadro K2100M
  + NVIDIA Quadro K4200
  + NVIDIA Quadro M2200
  + NVIDIA Quadro P4000
  + NVIDIA Quadro P620
  + NVIDIA Quadro RTX 5000 with Max-Q Design
  + NVIDIA Quadro T2000
  + NVIDIA RTX A2000 8GB Laptop GPU
  + NVIDIA RTX A2000 Laptop GPU
  + NVIDIA RTX A3000 Laptop GPU
  + NVIDIA RTX A4000
  + NVIDIA RTX A4500
  + NVIDIA RTX A5000
  + NVIDIA RTX A5000 Laptop GPU
  + NVIDIA RTX A6000
  + NVIDIA T1200 Laptop GPU
  + NVIDIA T400
  + NVIDIA T400 4GB
  + NVIDIA T500
  + NVIDIA T600
  + NVIDIA T600 Laptop GPU
  + NVIDIA TITAN V
  + NVIDIA TITAN X (Pascal)
  + NVIDIA Tegra K1
  + NVIDIA Tegra X1
  + NVIDIA Tegra X1 (nvgpu)
  + NVIDIA Tegra X1 (rev B) (nvgpu)
  + NVIDIA Tegra X2 (nvgpu)
  + NVIDIA Tegra Xavier (nvgpu)
  + NVS 510
  + Null hardware (RADV NAVI10)
  + P106-090
  + P106-100
  + Quadro GP100
  + Quadro GV100
  + Quadro K1000M
  + Quadro K1100M
  + Quadro K2000
  + Quadro K2000M
  + Quadro K2100M
  + Quadro K2200
  + Quadro K3100M
  + Quadro K4000
  + Quadro K4000M
  + Quadro K420
  + Quadro K4200
  + Quadro K5100M
  + Quadro K5200
  + Quadro K600
  + Quadro K620
  + Quadro M1000M
  + Quadro M1200
  + Quadro M2000
  + Quadro M2000M
  + Quadro M2200
  + Quadro M4000
  + Quadro M4000M
  + Quadro M5000M
  + Quadro M520
  + Quadro M6000
  + Quadro M6000 24GB
  + Quadro M620
  + Quadro P1000
  + Quadro P2000
  + Quadro P3200
  + Quadro P3200 with Max-Q Design
  + Quadro P400
  + Quadro P4000
  + Quadro P500
  + Quadro P5000
  + Quadro P5200
  + Quadro P600
  + Quadro P6000
  + Quadro P620
  + Quadro RTX 3000
  + Quadro RTX 3000 with Max-Q Design
  + Quadro RTX 4000
  + Quadro RTX 5000
  + Quadro RTX 6000
  + Quadro RTX 8000
  + Quadro T1000
  + Quadro T2000
  + Quadro T2000 with Max-Q Design
  + RTX A3000 Laptop GPU
  + RTX A6000
  + Radeon (TM) 520
  + Radeon (TM) 530
  + Radeon (TM) Pro Duo
  + Radeon (TM) Pro WX 4100
  + Radeon (TM) Pro WX 5100 Graphics
  + Radeon (TM) Pro WX 9100
  + Radeon (TM) R5 M430
  + Radeon (TM) R7 M445
  + Radeon (TM) RX 470 Graphics
  + Radeon (TM) RX 480 Graphics
  + Radeon (TM) RX 550
  + Radeon 500 Series
  + Radeon 530 Series
  + Radeon 540X Series
  + Radeon 550 Series
  + Radeon Pro 555X
  + Radeon Pro 560X
  + Radeon Pro 575
  + Radeon Pro 580
  + Radeon Pro Vega 20
  + Radeon Pro Vega 48
  + Radeon Pro WX 5100
  + Radeon R4/R5 Graphics
  + Radeon RX 550 Series
  + Radeon RX 5500 XT
  + Radeon RX 560 Series
  + Radeon RX 560X
  + Radeon RX 560X Series
  + Radeon RX 570 Series
  + Radeon RX 5700 / 5700 XT
  + Radeon RX 580 Series
  + Radeon RX 590 Series
  + Radeon RX Vega
  + Radeon RX Vega M GH Graphics
  + Radeon RX Vega M GL Graphics
  + Radeon RX550/550 Series
  + Radeon Vega Frontier Edition
  + Radeon(TM) 520
  + Radeon(TM) RX 460 Graphics
  + Radeon(TM) RX 580
  + Radeon(TM) RX580
  + Samsung Xclipse 920
  + SwiftShader Device
  + T600 Laptop GPU
  + TITAN RTX
  + TITAN V
  + TITAN X (Pascal)
  + TITAN Xp
  + Tesla P100-PCIE-12GB
  + Tesla T4
  + Turnip Adreno (TM) 619
  + Turnip Adreno (TM) 630
  + Turnip Adreno (TM) 640
  + Turnip Adreno (TM) 650
  + Turnip Adreno (TM) 660
  + Virtio-GPU Venus (AMD RADV VEGA10)
  + Virtio-GPU Venus (Intel(R) HD Graphics 530 (SKL GT2))
  + Virtio-GPU Venus (NVIDIA TITAN V)
  + Virtio-GPU Venus (llvmpipe)
  + llvmpipe
  + unknown device

@Jiawei-Shao
Copy link
Contributor Author

bgra8unorm storage is supported always on Metal, never on D3D12,

Actually the support of using DXGI_FORMAT_B8G8R8A8_UNORM as UAV can be queried with below code:

D3D12_FEATURE_DATA_FORMAT_SUPPORT formatInfo = {};
formatInfo.Format = DXGI_FORMAT_B8G8R8A8_UNORM;

device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &formatInfo, sizeof(formatInfo))));
if (formatInfo.Support1 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) {
    printf("DXGI_FORMAT_B8G8R8A8_UNORM supports UAV on this GPU.");
}

The usage of D3D12_FEATURE_DATA_FORMAT_SUPPORT can be referenced here and the meaning of D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW can be referenced here.

I've verified DXGI_FORMAT_B8G8R8A8_UNORM can be used as UAV on Intel (HD630, UHD770), AMD (RX480) and NVidia (2080Ti) GPUs.

@kainino0x
Copy link
Contributor

kainino0x commented Dec 5, 2022

Interesting. I was only checking FL11_1. I should have checked FL12_1, but even on FL12_1 this is listed as "disallowed or not available":
https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/hardware-support-for-direct3d-12-1-formats#dxgi_format_b8g8r8a8_unormfcs-87
image
Maybe I misunderstood the meaning of "disallowed or not available"? Or maybe it's added as optional in FL12_2? I can't seem to find a table for that feature level.

@Jiawei-Shao
Copy link
Contributor Author

@RafaelCintron could you help double-check if my understanding in #3640 (comment) is correct?

@kdashg
Copy link
Contributor

kdashg commented Dec 6, 2022

WGSL 2022-11-29 Minutes
  • KG: Surprised this touches on WGSL.
  • DN: If it's ok in API, then we'll make it so.
  • KG: Yup. We do need to do this separately. Won't happen automatically, can't connect BGRA storage buffer and read as RGBA, would need in shader to say it's BGRA.
  • DN: Have not looked at this. Does that mean we have to put something in backend that does swizzle on loads and stores?
  • KG: Think this is setup so we don't have to,j ust have to match pipeline layouts. In same boat as you. Discovered this last night.
  • DN: Needs review.
  • DG: Need time to get up to speed.
  • AB: How do we feel about extension per texel format? How many will we have? 1000?
  • KG: Lucky in that we won't have a tonne probably. This is specifically BGRA8 which is a burden that will always be with us. As much as would like to not support, folks want it. If already decided to support in API, then we'll support in WGSL
  • AB: Can it be required?
  • KG: Probably not, but don't know. KN says it would be useful. Talked about this at some point and made decision, but didn't put minutes back into issue. Will dig in and pull up background info so we can make more educated review.
  • AB: Should we consider some other way to do the enable. Like, enable texel_format or something. Thinking ahead, don't want so many enums.
  • KG: Question of to many formats, I think the answer is no. Think we'll end up with half a dozen but not a dozen. Which is tolerable.
  • KG: Related: Consider "magic" format that can be either rgba8unorm or bgra8unorm #2869 and The preferred format is not always storage-capable #2748
  • KG: Which is post-v1 should consider format that can be either and if we did have an either format we wouldn't' need a BGRA format. Wouldn't need optional BGRA that is sometimes missing, but would tell folks to use the magical one.

@kdashg kdashg added this to the V1.0 milestone Dec 6, 2022
dneto0
dneto0 previously approved these changes Dec 6, 2022
Copy link
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My review is a mechanical one about the WGSL changes.
The API folks should decide if the feature should be allowed.

@dneto0 dneto0 dismissed their stale review December 6, 2022 15:01

The feature should be decided by the API folks.

@kainino0x
Copy link
Contributor

The API spec already has this feature, so what we need to figure out is whether this is actually a gap that prevents it from being implemented.

  • On Metal, we know we don't need it. The MSL type is texture2d<float, access::write>.

  • On D3D12, it seems we don't need it unless we have to generate code to swizzle the vec4 into the texture. The HLSL type is RWTexture2D<float4>.

  • On Vulkan, same.

    There is no SPIR-V type for this. The type for rgba8unorm is OpTypeImage (OpTypeFloat 32) 2D 2 0 0 2 Rgba32f. There is no Bgra32f. However it's possible that the format would be simply OpTypeImage (OpTypeFloat 32) 2D 2 0 0 2 Unknown. This is valid according to the spirv-vulkan matching rules:
    https://registry.khronos.org/vulkan/specs/1.3-extensions/html/chap49.html#spirvenv-image-formats
    however Unknown (when available) is only allowed for certain formats, and VK_FORMAT_B8G8R8A8_UNORM is not one of them.
    https://registry.khronos.org/vulkan/specs/1.3-extensions/html/chap46.html#formats-without-shader-storage-format

    All that said, we still see Vulkan devices that claim to support bgra8unorm storage. Given these are also D3D12 devices, I strongly suspect that, if they really support it, they do so by violating the spec and allowing either Unknown or Rgba8f in this case. Rgba8f is what real-world HLSL->SPIR-V toolchains would generate.

@kainino0x
Copy link
Contributor

If we're really not sure, we technically could go ahead and add this, under the assumption we might eventually need it, and then lift restrictions later if we can. The reason I'm hesitant to do this is, no equivalent exists in any other language. Cross compilers from HLSL/GLSL/SPIR-V/etc. would be out of luck without out-of-band information that they should pass bgra8unorm here instead of rgba8unorm.

@kainino0x
Copy link
Contributor

I just found that in Jiawei and Corentin's discussion they discovered the same constraints of Vulkan. Link for the record:
https://dawn-review.googlesource.com/c/dawn/+/111380/3..5//COMMIT_MSG#b14

@Jiawei-Shao
Copy link
Contributor Author

I've just submitted the PR to allow bgra8unorm in pipeline layout be compatible with rgba8unorm in WGSL: #3667

PTAL, thanks!

wgsl/index.bs Outdated
@@ -3664,6 +3664,8 @@ which support the [[WebGPU#dom-gputextureusage-storage|WebGPU STORAGE]] usage.
These texel formats are used to parameterize the storage texture types defined
in [[#texture-storage]].

Note that `bgra8unorm` can only be used when the extension `bgra8unorm_storage` is enabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do go with this, this section needs to list the new WGSL extension (like the shader-f16 feature above it):
https://gpuweb.github.io/gpuweb/#bgra8unorm-storage

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this in the WGSL meeting on 2022-12-13.
The WGSL feature should not be guarded by an "enable". Please remove this sentence.

@kainino0x
Copy link
Contributor

I've just submitted the PR to allow bgra8unorm in pipeline layout be compatible with rgba8unorm in WGSL: #3667

@Jiawei-Shao If that works, I'm in favor of it. But we do want to make sure it will work on Vulkan (or decide this extension won't target Vulkan). I'd like to understand how that format feature flag can be used.

Actually, reading the proposed implementation after having dug into the Vulkan spec for a while, I bet format reinterpretation is how that flag can be used (that reinterpretation is valid). We need to find out whether we need to inject a swizzle into the shader:

But we could do texture format reinterpretation for storage bgra8unorm such that we give an RGBA8 view to the shader and things... should work? Maybe we'll need to do the swizzling in the shader but if the type of the texture is known to be bgra8unorm it's easy to inject the code to do the swizzling.
-- Corentin

If swizzling is required, we need to know the format at code generation time, which means we need the format in the shader, otherwise we can't generate code until pipeline creation (when we have the bind group layout).

However if swizzling is not required, then I think #3667 is valid.

Views of compatible formats will have ... only the interpretation of the bit pattern changing.
-- https://registry.khronos.org/vulkan/specs/1.3/html/chap12.html#resources-image-views

Unfortunately it sounds like format reinterpretation only reinterprets the bits, which would mean swizzling is required.


I wonder if it's possible to just make the WebGPU application responsible for doing the reinterpretation, when it creates a texture view. This might be possible as long as all backends have the same behavior (bit reinterpretation with no swizzle):

@kainino0x
Copy link
Contributor

bgra8unorm storage is supported always on Metal, never on D3D12,

Actually the support of using DXGI_FORMAT_B8G8R8A8_UNORM as UAV can be queried with below code:

I have an idea about this. It might mean that you can use it as a UAV but only when reinterpreted as an R32 format. There's a special carveout for this:
https://microsoft.github.io/DirectX-Specs/d3d/archive/D3D11_3_FunctionalSpec.htm#5.3.9.5%20Limitations%20on%20Typed%20UAVs

@kdashg
Copy link
Contributor

kdashg commented Dec 7, 2022

WGSL 2022-12-06 Minutes
  • DN: The PR is well-formed, and the only question is, should we add it. We want to defer this question to the API folks. We don’t want to pollute the extension name space with a zillion different extension names. The main question is just whether to add it or not. This seems to be mostly an API concern.
  • KG: In the issue, Kai (Ninomiya) is saying, this something we probably don’t need at the WGSL layer.
  • JS: I think we need this decoration in WGSL because we need to call getBindGroupLayout from this pipeline, and we need to return a bindgroup layout with this format, and check the texture format. So we need this at least for getBindGroupLayout
  • KG: Isn’t getBindGroupLayout just a way to get around specifying the layouts yourself? Do e really need to add something to WGSL just to help auto-generated BGLs?
  • JS: without the WGSL feature, you’d need to manually specify the format.
  • JS: Another question: it’s weird to have BGRA8 without having something that can be directly translated into SPIR-V
  • KG: It’s a layering thing. You might have a BGRA8 resource at the API layer, but the SPIR-V would always work with it as if it were RGBA8. The binding would do the swizzling. So technically there’s nothing we need to do in WGSL. IT’s only on the API side that you can present something that’s BGRA8 anyway.
  • DN: I think that’s right. In Vulkan, you specify swizzles applied to those axes outside the shader itself.
    • What I found is that the rearrangement of the components (swizzling) is specified in the creation of the texture view:
  • AB: Language clarification: We have the .rgba accessors, is the swizzle visible to these? Would the first component be the ‘b’, or the ‘r’?
  • DN: In the WGSL swizzle context, .rgba is just a synonym for .xyzw
  • ZJ: I thought accessing .r in WGSL should always get the R channel in both RGBA and BGRA format?
  • KG: I think that’s how it’s set up today. If you create a Vulkan bindgroup that has BGRA storage, and then you write ‘r’ in the shader, you get the ‘r’ value. The ‘r’ is semantic, not necessarily referring to exactly how the bytes are laid out in storage. If the storage is BGRA, the shader doesn’t have to know. ‘R’ is always ‘r’.
  • KG: So I think we’re set here, except for getBindGroupLayout. We could just say, don’t use that, then. But it does mean it’s ambiguous what the layout should be. I think we should just default to the RGBA8 format.
  • KG: If all that’s correct, I think we shouldn’t have BGRA specified as part of WGSL, if the only purpose is for getBindGroupLayout.
  • JS: So we should allow the getBindGroupLayout with the BGRA enum match the WGSL with RGBA8?
  • KG: Those would not be compatible layouts. The getBindGroupLayout time would be the time at which that would be selected.
  • JS: I’m thinking of the case where we manually created a getBindGroupLayout object specifying BGRA8 format. When we use that with a shader, we need to decide if that matches the shader’s expected texture.
  • ZJ: We can always specify that BGRA8 is mapped to …
  • AB: That’s only for a sampled texture. For storage textures, that’s where the format needs to match.
  • KG: The constraint here is, you have a bindgroup layout and the storage format will be either RGBA8 or BGRA8, and any image you attach must match. So if you call getBindGroupLayout to infer a layout, then you will have to use RGBA8 resources with it. If you wanted to use BGRA8 layout, you’d have to manually create a bindgroup layout, but then you would only be able to use … formats. So the only thing to add here is maybe something that helps getBindGroupLayout, but that doesn’t seem necessary for V1.
  • JS: So, you mean we cannot create a pipeline with a layout that has BGRA8 storage texture format? It has to match the declaration in WGSL, and we don’t have such a declaration.
  • KG: it would be compatible with that.
  • JS: So BGR8 and RGB8 would both be compatible with a shader that specifies RGB8?
  • KG: The getBindGroupLayout would determine the format of the storage texture.
  • AB: I think they’re asking about storage textures. There’s a line in the API that the texel format has to match. We would either have to relax that, or you couldn’t use it in a storage texture. The step is at the end of “validate shader binding”(???) So either this is already doable, or WGSL needs a format to satisfy that validation step
  • KG: If the WGSL format is RGBA8, then the pipeline layout format must be either RGBA8 or BGRA8, at pipeline creation time.
  • JB: The API spec validation does not say that. Need to update that part of the API spec validation to allow matching rgba8unorm in the declaration of the texture type in WGSL with either rgba8unorm or bgra8unorm in the API storage texture format.
  • KG: Sounds like we can kick this back over to the API side.

@Kangz
Copy link
Contributor

Kangz commented Dec 7, 2022

The discussion WGSL seems to have assumed that using texture view swizzling with storage textures is possible. But actually it isn't allowed.

So the way to implement bgra8-unorm storage in Vulkan is to make storage bgra8unorm textures have viewFormats rgba8unorm, then creating rgba8unorm views when binding as storage. Finally in the shader I'm almost certains we'll need to add a swizzle when reading and writing to the texture (because storage textures are just using memory loads and not the texture units). The rgba8unorm vs. bgra8unorm is a signal for the WGSL compilers to inject these swizzling operations.

@jenatali
Copy link

jenatali commented Dec 7, 2022

Regarding BGRA UNORM support in D3D12, it was added along with an iteration of relaxing format casting (D3D12_FEATURE_DATA_D3D12_OPTIONS3::CastingFullyTypedFormatSupported, not D3D12_FEATURE_DATA_D3D12_OPTIONS12::RelaxedFormatCastingSupported). See https://microsoft.github.io/DirectX-Specs/d3d/RelaxedCasting.html#additional-minor-optional-feature.

This sounds like we probably need to update some docs. I'll ping our doc author to get those tables updated with an additional footnote.

@kainino0x
Copy link
Contributor

That straightforwardly resolves the D3D12 mystery. Thanks!

On the call @jenatali said D3D12 probably swizzles (when binding BGRA, the vec4 will be in the order RGBA), but he'll double check on this.

This leaves the Vulkan mystery, which Google will try to find an answer to.

@Jiawei-Shao
Copy link
Contributor Author

On the call @jenatali said D3D12 probably swizzles (when binding BGRA, the vec4 will be in the order RGBA), but he'll double check on this.

It is true according to the test results in my patch to support bgra8unorm-storage in Dawn.

@jenatali
Copy link

jenatali commented Dec 8, 2022

Yes, D3D swizzles. I've also asked the doc team to update the format table docs, indicating that these are optionally supported by D3D12 (but not D3D11).

@kainino0x
Copy link
Contributor

Hi Myles!

Wait a minute, the pipeline layout already includes the format of storage textures (but not sampled textures). So the shader compiler already knows whether the texture being bound to a resource will be rgba or bgra. So maybe this is totally a non-issue?

We want to be able to generate any necessary swizzling code (Vulkan) or packing code (D3D12) at shader compilation time, so just having the info at pipeline creation time isn't enough.

Thinking about this more, did the group discuss an option where bgra textures are supported at the API level, and the shading language doesn't include any swizzle information inside it, and SPIR-V codegen will make all (relevant) texture operations unconditionally include swizzling instructions, but the swizzling instructions are predicated on a bit from a side-channel (presumably inside the bind group)? It can likely be done without a branch, and the extra ALU is probably negligible compared to the cost of a memory access.

The benefit would be that all APIs still can support bgra textures, but bgra/rgba swizzle information wouldn't need to be present in the shading language, making porting from other languages easier.

This idea is very interesting. I'm not sure if it was discussed in the WGSL meeting where I wasn't present. I have a few concerns about it, though they don't necessarily block the idea.

  • Setting up a side channel is not necessarily easy because it impacts limits.
  • It would (however slightly) impact performance of rgba8unorm storage as well, not just bgra8unorm storage. There's no impact on Metal, or D3D12 with the "additional minor optional feature", but no Vulkan devices can currently avoid it.

Copy link
Contributor

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review comment: If we want to make this available in core we'll also need to remove the bgra8unorm-storage feature from the API spec. I think it should be in the same PR (though technically this PR is valid as is, it just implements a slightly different proposal)

@Jiawei-Shao
Copy link
Contributor Author

Jiawei-Shao commented Dec 15, 2022

Review comment: If we want to make this available in core we'll also need to remove the bgra8unorm-storage feature from the API spec. I think it should be in the same PR (though technically this PR is valid as is, it just implements a slightly different proposal)

Done

@kainino0x
Copy link
Contributor

kainino0x commented Dec 15, 2022

LGTM but we can give other folks a chance to see Myles's comments before landing, just in case it inspires reconsideration (Also David still needs to re-review, officially)

@mehmetoguzderin
Copy link
Member

@litherum I also intended to inquire about this approach in one of previous meetings (not the most recent one) but couldn't articulate well. #3640 (comment)

@litherum
Copy link
Contributor

just having the info at pipeline creation time isn't enough

Aha! Early compilation strikes again! 😅😅😅

@Jiawei-Shao
Copy link
Contributor Author

PTAL, thanks!

@kainino0x
Copy link
Contributor

I don't think this needs to wait, I'm just going to land it

@kainino0x kainino0x dismissed dneto0’s stale review January 4, 2023 22:47

Comment addressed

@kainino0x kainino0x enabled auto-merge (squash) January 4, 2023 22:48
@kainino0x kainino0x merged commit 4be4321 into gpuweb:main Jan 4, 2023
@teoxoy
Copy link
Member

teoxoy commented Jan 6, 2023

@litherum is it the case that BGRA8Unorm in Metal supports "Write" access?
According to the Metal-Feature-Set-Tables-Metal3-v3 pdf it's missing "Write" access in the "Texture buffer pixel formats" table despite it supporting "All" capabilities in the "GPU texture capabilities by pixel format" table.

I previously asked about these kind of discrepancies between the 2 tables in the pdf in the WebGPU matrix room (link to message).

@teoxoy
Copy link
Member

teoxoy commented Jan 6, 2023

Regarding Vulkan, I think the list of formats in the "Formats without shader storage format" section wants to convey something else; and not restrict usage of Unkown (see KhronosGroup/Vulkan-Docs#2027).

@alan-baker thoughts?

@litherum
Copy link
Contributor

I don't think this needs to wait

SPIR-V codegen will make all (relevant) texture operations unconditionally include swizzling instructions

Was this suggestion discussed?

@litherum
Copy link
Contributor

it's missing "Write" access in the "Texture buffer pixel formats" table despite it supporting "All" capabilities in the "GPU texture capabilities by pixel format" table.

Texture buffers are different than textures, and have different capabilities.

@kdashg
Copy link
Contributor

kdashg commented Jan 11, 2023

WGSL 2023-01-10 Minutes
  • (Merged, but Myles had a follow-up question)
  • MM: If you have a BGRA texture bound as a storage texture, in Vulkan this is impossible - it has to be polyfilled by attaching an RGBA texture, and then emitting additional instructions to do the swizzle
  • AB: In D3D you have to have a packing instruction instead of a swizzle, and would load+unpack from an r32uint
  • MM: I believe there is no shading language today where the swizzling is contained within the shading language itself, where the language itself makes a distinction between bgra and rgba textures. Is this true?
  • AB: Not sure. In SPIR-V, I don’t think you write BGRA anywhere
  • MM: The problem is that if someone has a shader in another language and they want to compile it to WGSL, then they have to divide up this information about whether it’s BGRA or RGBA. Can we avoid this? We could force the person to add this information in order to produce WGSL, but what would it take to make it unnecessary for them to add this information? And for the texture types that do require additional instructions, could we unconditionally have the instructions around the store, but predicated on some other contextual information, so that the side channel information could be provided at compile time, and used to either swizzle or not swizzle (hopefully without a branch). Was this considered in Nov/Dec?
  • DN: When compiling from a different language, if the other shading language doesn’t distinguish between BGRA8 or RGBA8, then why not always unconditionally map it to the RGBA8unorm? Isn’t that viable?
  • MM: Suppose you have a two-pass algorithm: first pass renders into a BGRA texture, using a rendertarget. That writes data 1,2,3,4. Then you have a second pass algorithm that attaches that output as a storage texture, and you read from it. Ideally, you’d want that read to also be 1,2,3,4. That seems to fall down.
  • AB: Right now we don’t do storage reads. We do texel loads. We swizzle on write, so when you sample later, it’ll get the right components. I think all this was predicated on the idea that it was a performance benefit on Metal to expose the BGRA. IS that actually the case?
  • MM: It’s important that the results of this discussion aren’t, let’s remove BGRA, because our compositor can’t handle RGBA, so we want it to at least be possible for a WebGPU impl to produce an BGRA texture, so we don’t always have to do a blit. That’s why there’s a performance concern. The perf of loads and stores in a shader isn’t the issue.
  • KG: Can we say storage is always rgba8unrom?
  • MM: Alternate: shader lang doesn’t say it’s rgba or bgra, and be able to bind either kind to your shader. Then have your shader be flexible with that runtime side channel flag.
  • AB: We require a format in the shader for storage texture. So you’re saying always require that to say rgba8 but then exploit side channel to conditionalize the swizzle in the shader code.
  • MM: Benefit is for the shader porter. Move the burden to the API implementor.
  • AB: Don’t have enough context. Not sure it’s (...missed this).
  • BC: Are there other formats that require swizzling in the shader? So this new magic thing would apply to this format.
  • MM: Yes.
  • BC: Feels a bit funky. What we have is very explicit. The API to the shader is 1-1 mapping.
  • AB: We discussed about loosening the validation on the API side, and allow binding either. But API folks decided intentionally to not allow that.
  • MM:Ok, Glad it was explicitly discussed. Wanted to make sure it was on the table.

@kainino0x
Copy link
Contributor

For the record @teoxoy has been discussing this here, it turns out there's some Vulkan support? I didn't read through the issue yet.
KhronosGroup/Vulkan-Docs#2027 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wgsl WebGPU Shading Language Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants