Skip to content

Commit f4c6faf

Browse files
authored
Rename ALLOW_NONCOMPLIANT_ADAPTER to ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER (#4760)
* rename `ALLOW_NONCOMPLIANT_ADAPTER` to `ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER` * clarify comment
1 parent ca4e131 commit f4c6faf

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Bottom level categories:
4040

4141
## Unreleased
4242

43-
### `WGPU_ALLOW_NONCOMPLIANT_ADAPTER` environment variable
43+
### `WGPU_ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER` environment variable
4444

4545
This adds a way to allow a Vulkan driver which is non-compliant per VK_KHR_driver_properties to be enumerated. This is intended for testing new Vulkan drivers which are not Vulkan compliant yet.
4646

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ All testing and example infrastructure shares the same set of environment variab
143143
- `WGPU_POWER_PREF` with the power preference to choose when a specific adapter name isn't specified (`high`, `low` or `none`)
144144
- `WGPU_DX12_COMPILER` with the DX12 shader compiler you wish to use (`dxc` or `fxc`, note that `dxc` requires `dxil.dll` and `dxcompiler.dll` to be in the working directory otherwise it will fall back to `fxc`)
145145
- `WGPU_GLES_MINOR_VERSION` with the minor OpenGL ES 3 version number to request (`0`, `1`, `2` or `automatic`).
146-
- `WGPU_ALLOW_NONCOMPLIANT_ADAPTER` with a boolean whether non-compliant drivers are enumerated (`0` for false, `1` for true).
146+
- `WGPU_ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER` with a boolean whether non-compliant drivers are enumerated (`0` for false, `1` for true).
147147

148148
When running the CTS, use the variables `DENO_WEBGPU_ADAPTER_NAME`, `DENO_WEBGPU_BACKEND`, `DENO_WEBGPU_POWER_PREFERENCE`.
149149

wgpu-hal/src/vulkan/adapter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ impl super::Instance {
998998
} else if self
999999
.shared
10001000
.flags
1001-
.contains(wgt::InstanceFlags::ALLOW_NONCOMPLIANT_ADAPTER)
1001+
.contains(wgt::InstanceFlags::ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER)
10021002
{
10031003
log::warn!("Adapter is not Vulkan compliant: {}", info.name);
10041004
} else {

wgpu-types/src/lib.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -858,11 +858,16 @@ bitflags::bitflags! {
858858
const VALIDATION = 1 << 1;
859859
/// Don't pass labels to wgpu-hal.
860860
const DISCARD_HAL_LABELS = 1 << 2;
861-
/// Whether non-compliant adapters should be enumerated.
861+
/// Whether wgpu should expose adapters that run on top of non-compliant adapters.
862+
///
863+
/// Turning this on might mean that some of the functionality provided by the wgpu
864+
/// adapter/device is not working or is broken. It could be that all the functionality
865+
/// wgpu currently exposes works but we can't tell for sure since we have no additional
866+
/// transparency into what is working and what is not on the underlying adapter.
862867
///
863868
/// This mainly applies to a Vulkan driver's compliance version. If the major compliance version
864869
/// is `0`, then the driver is ignored. This flag allows that driver to be enabled for testing.
865-
const ALLOW_NONCOMPLIANT_ADAPTER = 1 << 3;
870+
const ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER = 1 << 3;
866871
}
867872
}
868873

@@ -915,8 +920,8 @@ impl InstanceFlags {
915920
if let Some(bit) = env("WGPU_DEBUG") {
916921
self.set(Self::DEBUG, bit);
917922
}
918-
if let Some(bit) = env("WGPU_ALLOW_NONCOMPLIANT_ADAPTER") {
919-
self.set(Self::ALLOW_NONCOMPLIANT_ADAPTER, bit);
923+
if let Some(bit) = env("WGPU_ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER") {
924+
self.set(Self::ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER, bit);
920925
}
921926

922927
self

0 commit comments

Comments
 (0)