Bug 211363 - GPUTexture objects are returned with “null” native Metal textures backing them when the “usage” flag is not set correctly.
Summary: GPUTexture objects are returned with “null” native Metal textures backing the...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-03 17:45 PDT by gvinals
Modified: 2020-05-03 17:45 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gvinals 2020-05-03 17:45:01 PDT
GPUTexture objects are returned with “null” native Metal textures backing them when the “usage” flag is not set correctly. For example, you can set usage to 0 or a random number and a GPUTexture will still be returned by device.createTexture(…). This texture is also able to create a GPUTextureView.

Unfortunately after that many internal errors may happen that can be very tricky to debug for application developers. 

For example if we always return a null GPUTexture with no Metal texture backing it:

Ref<WebGPUTexture> WebGPUDevice::createTexture(const GPUTextureDescriptor& descriptor) const
{
    auto texture = m_device->tryCreateTexture(descriptor);
    return WebGPUTexture::create(nullptr);
}

The tests under LayoutTests/webgpu/textures-textureviews.html will still all pass.
Comment 1 Radar WebKit Bug Importer 2020-05-03 17:45:26 PDT
<rdar://problem/62822180>