Skip to content
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

[WebGPU] webgpu:api,operation,resource_init,texture_zero:* does not pass #21091

Conversation

mwyrzykowski
Copy link
Contributor

@mwyrzykowski mwyrzykowski commented Nov 30, 2023

aadb708

[WebGPU] webgpu:api,operation,resource_init,texture_zero:* does not pass
https://bugs.webkit.org/show_bug.cgi?id=265430
<radar://118866231>

Reviewed by Tadeu Zagallo.

Textures are not cleared by default and we don't want to incur
the cost of clearing them on creation, so track if they are loaded
or copied prior to being cleared and clear if needed.

Also resolve ambiguitiy that 'discard' on a render target should
clear the render target, which does not seem obvious, but per
gpuweb/gpuweb#4398 is intentional.

* Source/WebGPU/WebGPU/CommandEncoder.h:
* Source/WebGPU/WebGPU/CommandEncoder.mm:
(-[TextureAndResolve initWithTexture:resolveTexture:]):
(WebGPU::createSimplePso):
(WebGPU::CommandEncoder::runClearEncoder):
(WebGPU::CommandEncoder::beginRenderPass):
(WebGPU::CommandEncoder::copyBufferToTexture):
(WebGPU::CommandEncoder::clearTexture):
(WebGPU::CommandEncoder::copyTextureToBuffer):
(WebGPU::CommandEncoder::copyTextureToTexture):
* Source/WebGPU/WebGPU/PresentationContextCoreAnimation.mm:
(WebGPU::PresentationContextCoreAnimation::Configuration::generateCurrentFrameState):
* Source/WebGPU/WebGPU/PresentationContextIOSurface.mm:
(WebGPU::PresentationContextIOSurface::configure):
* Source/WebGPU/WebGPU/Queue.h:
* Source/WebGPU/WebGPU/Queue.mm:
(WebGPU::Queue::clearTexture):
(WebGPU::Queue::writeTexture):
* Source/WebGPU/WebGPU/RenderPassEncoder.h:
* Source/WebGPU/WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::RenderPassEncoder):
(WebGPU::RenderPassEncoder::executePreDrawCommands):
(WebGPU::RenderPassEncoder::endPass):
(WebGPU::RenderPassEncoder::executeBundles):
(WebGPU::RenderPassEncoder::setScissorRect):
* Source/WebGPU/WebGPU/Texture.h:
* Source/WebGPU/WebGPU/Texture.mm:
(WebGPU::Texture::createView):
(WebGPU::Texture::previouslyCleared const):
(WebGPU::Texture::setPreviouslyCleared):
* Source/WebGPU/WebGPU/TextureView.h:
(WebGPU::TextureView::create):
(WebGPU::TextureView::createInvalid):
* Source/WebGPU/WebGPU/TextureView.mm:
(WebGPU::TextureView::TextureView):
(WebGPU::m_parentTexture):
(WebGPU::TextureView::previouslyCleared const):
(WebGPU::TextureView::setPreviouslyCleared):
(WebGPU::TextureView::width const):
(WebGPU::TextureView::height const):
(WebGPU::m_device): Deleted.

Canonical link: https://commits.webkit.org/271400@main

18b6298

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv-sim
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@mwyrzykowski mwyrzykowski self-assigned this Nov 30, 2023
@mwyrzykowski mwyrzykowski added the WebGPU For bugs in WebGPU label Nov 30, 2023
@mwyrzykowski mwyrzykowski force-pushed the eng/WebGPU-webgpuapioperationresource_inittexture_zero-does-not-pass branch from deab9c4 to e1340b1 Compare November 30, 2023 06:06
@mwyrzykowski mwyrzykowski added merging-blocked Applied to prevent a change from being merged and removed merging-blocked Applied to prevent a change from being merged labels Nov 30, 2023
@mwyrzykowski mwyrzykowski force-pushed the eng/WebGPU-webgpuapioperationresource_inittexture_zero-does-not-pass branch from e1340b1 to 14a735c Compare November 30, 2023 07:28
@mwyrzykowski mwyrzykowski added merging-blocked Applied to prevent a change from being merged and removed merging-blocked Applied to prevent a change from being merged labels Dec 1, 2023
@mwyrzykowski mwyrzykowski force-pushed the eng/WebGPU-webgpuapioperationresource_inittexture_zero-does-not-pass branch from 14a735c to 18b6298 Compare December 1, 2023 06:04
@mwyrzykowski mwyrzykowski added safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks merge-queue Applied to send a pull request to merge-queue and removed safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Dec 1, 2023
https://bugs.webkit.org/show_bug.cgi?id=265430
<radar://118866231>

Reviewed by Tadeu Zagallo.

Textures are not cleared by default and we don't want to incur
the cost of clearing them on creation, so track if they are loaded
or copied prior to being cleared and clear if needed.

Also resolve ambiguitiy that 'discard' on a render target should
clear the render target, which does not seem obvious, but per
gpuweb/gpuweb#4398 is intentional.

* Source/WebGPU/WebGPU/CommandEncoder.h:
* Source/WebGPU/WebGPU/CommandEncoder.mm:
(-[TextureAndResolve initWithTexture:resolveTexture:]):
(WebGPU::createSimplePso):
(WebGPU::CommandEncoder::runClearEncoder):
(WebGPU::CommandEncoder::beginRenderPass):
(WebGPU::CommandEncoder::copyBufferToTexture):
(WebGPU::CommandEncoder::clearTexture):
(WebGPU::CommandEncoder::copyTextureToBuffer):
(WebGPU::CommandEncoder::copyTextureToTexture):
* Source/WebGPU/WebGPU/PresentationContextCoreAnimation.mm:
(WebGPU::PresentationContextCoreAnimation::Configuration::generateCurrentFrameState):
* Source/WebGPU/WebGPU/PresentationContextIOSurface.mm:
(WebGPU::PresentationContextIOSurface::configure):
* Source/WebGPU/WebGPU/Queue.h:
* Source/WebGPU/WebGPU/Queue.mm:
(WebGPU::Queue::clearTexture):
(WebGPU::Queue::writeTexture):
* Source/WebGPU/WebGPU/RenderPassEncoder.h:
* Source/WebGPU/WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::RenderPassEncoder):
(WebGPU::RenderPassEncoder::executePreDrawCommands):
(WebGPU::RenderPassEncoder::endPass):
(WebGPU::RenderPassEncoder::executeBundles):
(WebGPU::RenderPassEncoder::setScissorRect):
* Source/WebGPU/WebGPU/Texture.h:
* Source/WebGPU/WebGPU/Texture.mm:
(WebGPU::Texture::createView):
(WebGPU::Texture::previouslyCleared const):
(WebGPU::Texture::setPreviouslyCleared):
* Source/WebGPU/WebGPU/TextureView.h:
(WebGPU::TextureView::create):
(WebGPU::TextureView::createInvalid):
* Source/WebGPU/WebGPU/TextureView.mm:
(WebGPU::TextureView::TextureView):
(WebGPU::m_parentTexture):
(WebGPU::TextureView::previouslyCleared const):
(WebGPU::TextureView::setPreviouslyCleared):
(WebGPU::TextureView::width const):
(WebGPU::TextureView::height const):
(WebGPU::m_device): Deleted.

Canonical link: https://commits.webkit.org/271400@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WebGPU-webgpuapioperationresource_inittexture_zero-does-not-pass branch from 18b6298 to aadb708 Compare December 1, 2023 19:35
@webkit-commit-queue
Copy link
Collaborator

Committed 271400@main (aadb708): https://commits.webkit.org/271400@main

Reviewed commits have been landed. Closing PR #21091 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit aadb708 into WebKit:main Dec 1, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebGPU For bugs in WebGPU
Projects
None yet
4 participants