Implement a toggle to disable sample variables.
Sample mask variables and all functionality introduced by GL_OES_sample_variables was not made core until ES 3.2. Implement a toggle to disable the functionality if not supported by the backend. Bug: dawn:673 Change-Id: I7a5ec61fb57da343f0f72ffd3b0c69031eaaff8f Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/41142 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
39b478df0c
commit
02fd17c754
|
@ -134,6 +134,11 @@ namespace dawn_native {
|
|||
"Disables reading from depth/stencil textures which is unsupported on some "
|
||||
"platforms.",
|
||||
"https://crbug.com/dawn/667"}},
|
||||
{Toggle::DisableSampleVariables,
|
||||
{"disable_sample_variables",
|
||||
"Disables gl_SampleMask and related functionality which is unsupported on some "
|
||||
"platforms.",
|
||||
"https://crbug.com/dawn/673"}},
|
||||
{Toggle::UseD3D12SmallShaderVisibleHeapForTesting,
|
||||
{"use_d3d12_small_shader_visible_heap",
|
||||
"Enable use of a small D3D12 shader visible heap, instead of using a large one by "
|
||||
|
|
|
@ -42,6 +42,7 @@ namespace dawn_native {
|
|||
DisableIndexedDrawBuffers,
|
||||
DisableSnormRead,
|
||||
DisableDepthStencilRead,
|
||||
DisableSampleVariables,
|
||||
UseD3D12SmallShaderVisibleHeapForTesting,
|
||||
UseDXC,
|
||||
DisableRobustness,
|
||||
|
|
|
@ -74,6 +74,9 @@ namespace dawn_native { namespace opengl {
|
|||
bool supportsDepthStencilRead =
|
||||
gl.IsAtLeastGL(3, 0) || gl.IsGLExtensionSupported("GL_NV_read_depth_stencil");
|
||||
|
||||
bool supportsSampleVariables = gl.IsAtLeastGL(4, 0) || gl.IsAtLeastGLES(3, 2) ||
|
||||
gl.IsGLExtensionSupported("GL_OES_sample_variables");
|
||||
|
||||
// TODO(crbug.com/dawn/343): We can support the extension variants, but need to load the EXT
|
||||
// procs without the extension suffix.
|
||||
// We'll also need emulation of shader builtins gl_BaseVertex and gl_BaseInstance.
|
||||
|
@ -94,6 +97,7 @@ namespace dawn_native { namespace opengl {
|
|||
SetToggle(Toggle::DisableIndexedDrawBuffers, !supportsIndexedDrawBuffers);
|
||||
SetToggle(Toggle::DisableSnormRead, !supportsSnormRead);
|
||||
SetToggle(Toggle::DisableDepthStencilRead, !supportsDepthStencilRead);
|
||||
SetToggle(Toggle::DisableSampleVariables, !supportsSampleVariables);
|
||||
SetToggle(Toggle::FlushBeforeClientWaitSync, gl.GetVersion().IsES());
|
||||
}
|
||||
|
||||
|
|
|
@ -736,8 +736,9 @@ TEST_P(MultisampledRenderingTest, ResolveInto2DTextureWithSampleMaskAndShaderOut
|
|||
// TODO(crbug.com/tint/372): Support sample mask builtin.
|
||||
DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator"));
|
||||
|
||||
// TODO(crbug.com/dawn/644): Diagnose and fix this ANGLE failure.
|
||||
DAWN_SKIP_TEST_IF(IsANGLE());
|
||||
// TODO(crbug.com/dawn/672): Work around or enforce via validation that sample variables are not
|
||||
// supported on some platforms.
|
||||
DAWN_SKIP_TEST_IF(HasToggleEnabled("disable_sample_variables"));
|
||||
|
||||
constexpr bool kTestDepth = false;
|
||||
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
|
||||
|
@ -785,8 +786,9 @@ TEST_P(MultisampledRenderingTest, ResolveIntoMultipleResolveTargetsWithShaderOut
|
|||
// TODO(crbug.com/tint/372): Support sample mask builtin.
|
||||
DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator"));
|
||||
|
||||
// TODO(crbug.com/dawn/644): Diagnose and fix this ANGLE failure.
|
||||
DAWN_SKIP_TEST_IF(IsANGLE());
|
||||
// TODO(crbug.com/dawn/672): Work around or enforce via validation that sample variables are not
|
||||
// supported on some platforms.
|
||||
DAWN_SKIP_TEST_IF(HasToggleEnabled("disable_sample_variables"));
|
||||
|
||||
wgpu::TextureView multisampledColorView2 =
|
||||
CreateTextureForRenderAttachment(kColorFormat, kSampleCount).CreateView();
|
||||
|
|
Loading…
Reference in New Issue