CNA-BUG-282: RendererFeature::MultiSampleMask misreports EasyGL without glSampleMaski (OPENGLES3 on an OpenGL ES 3.0 context, WEBGL2) and WEBGPU over wgpu-native's Metal driver

CNA snapshot 3b43bd86  ·  Known Issues › Current bugs  ·  source links pinned to 3b43bd86

✓

Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 3b43bd86; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.

The feature is defined so that Unsupported means a mask has no effect and Supported means any mask is applied, but EasyGL without glSampleMaski answers Unsupported while it throws NotSupportedException for every mask other than all ones, and WEBGPU over wgpu-native's Metal driver answers Supported while it refuses a partial mask; a program that trusts the answer either fails at the draw or never learns that the mask is refused.

Identifier
CNA-BUG-282
Category
Bug
Subsystem
Graphics & renderers
Status
Open
Verified against
CNA 3b43bd86 (3b43bd8687ed46523d873f9bec4b32bd8481dcb5)
Severity
Low (a triage suggestion, not a project priority)
Evidence basis
Source-verified: read at TARGET, not executed
Tests touching this area
Yes: see Current tests
Affected contract
GraphicsDevice::GetRendererFeatureSupportEXT(CNA::RendererFeature::MultiSampleMask) and the C constant CNA_RENDERER_FEATURE_MULTI_SAMPLE_MASK, against BlendState/GraphicsDevice MultiSampleMask on a multisampled target

Expected behaviour

RendererCapabilityProfile.hpp defines the answers: Supported, any mask selects the samples a draw writes; Restricted, only a mask that keeps every sample or none is applied and any other is refused with NotSupportedException; Unsupported, the mask has no effect. The answer should describe what the renderer then does.

Actual behaviour at TARGET

EasyGLRenderer.hpp answers Unsupported when the context has no glSampleMaski (desktop GL before 3.2, OpenGL ES 3.0, WebGL 2), but ApplyBlendState in EasyGLRenderer.cpp throws NotSupportedException (“BlendState.MultiSampleMask requires desktop GL 3.2 or OpenGL ES 3.1”) for every mask other than all ones there, a mask of none included: the mask is not without effect, it is refused. WebGPURenderer.hpp answers Supported whenever a device exists, while WebGPURenderer.cpp (SupportsPartialMultiSampleMaskEXT, false on WGPUBackendType_Metal) refuses a partial mask on wgpu-native’s Metal driver, whose pipelines have no sample mask; by the definition above that is Restricted.

Source locations

Evidence

Checked by reading at 3b43bd86; not executed. The cross-renderer test that holds the answer to the behaviour (MultiSampleMaskSupportMatchesWhatTheResolvedTargetShows) draws with masks all, none and one: on an EasyGL context without glSampleMaski its mask-0 draw would throw, and on WEBGPU over wgpu-native's Metal driver its partial-mask draw would throw where a Supported renderer must resolve a quarter of the red. CNA records it on Linux, where Mesa's desktop GL has glSampleMaski and wgpu-native uses Vulkan, so neither configuration has run it.

Focused reproduction

No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.

Current tests

CrossRendererContractTests.cpp covers the answer only where CNA runs it, on Linux. There EasyGL runs on desktop GL 3.2 or newer and WEBGPU on wgpu-native’s Vulkan driver; SDL_GPU, SOFTWARE and FNA3D are covered too.

Regression test

The same cross-renderer test on an OpenGL ES 3.0 or WebGL 2 context and on WEBGPU over wgpu-native's Metal driver: it fails today and passes once EasyGL reports what its refusal does (Restricted-like, though even a mask of none is refused there) and WEBGPU over wgpu-native's Metal driver reports Restricted.

Blast radius

Programs that query RendererFeature::MultiSampleMask before using a partial or zero sample mask on OPENGLES3 with an OpenGL ES 3.0 context (for example Android devices without ES 3.1), on WEBGL2, or on WEBGPU on macOS. Programs that never set a mask, and the other renderers, are unaffected.

Workaround

Treat Unsupported on EasyGL and Supported on WEBGPU over wgpu-native's Metal driver as unreliable: keep the mask at all ones there, or catch NotSupportedException around the draw.

The same subject is explained at several altitudes. These are the neighbouring pages at each one.

Deep dives
State objects
Known issues
Bug index