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: backend components created and conditionally logged #8507

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AndyHovingh
Copy link

@AndyHovingh AndyHovingh commented Mar 10, 2025

Initial groundwork in creating WebGPU backend components, namely the instance, adapter, device, and queue.
If configured to do so, the backend will print out details about these components.
The samples/hellotriangle.cpp was slightly modified to include a webgpu option which allows for exercising the above, but does not yet draw anything to the screen/window.
NOTE: This has only been sanity tested with hello triangle on Mac OS and the Android emulator at this time, NOT IOS, Windows, or Linux yet.

BUGS = [400212369]

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@AndyHovingh AndyHovingh added the internal Issue/PR does not affect clients label Mar 10, 2025
@AndyHovingh AndyHovingh force-pushed the ajh/webgpu_hello_triangle_hc_wgsl branch from b38675b to bbf8350 Compare March 10, 2025 14:45
[[nodiscard]] ShaderModel getShaderModel() const noexcept final;
[[nodiscard]] ShaderLanguage getShaderLanguage() const noexcept final;

WebGPUPlatform& mPlatform;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems ok to me as long as we can assume the platform will always outlive the driver. We need to verify that assumption,.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@poweifeng is this a fair and safe assumption that the platform should always outlive the driver?

@AndyHovingh AndyHovingh changed the title WebGPU: backend components created and conditionally logged webgpu: backend components created and conditionally logged Mar 11, 2025
@AndyHovingh AndyHovingh force-pushed the ajh/webgpu_hello_triangle_hc_wgsl branch from bbf8350 to 3257e3a Compare March 11, 2025 19:37
Copy link

@jneljneljnel jneljneljnel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@AndyHovingh AndyHovingh force-pushed the ajh/webgpu_hello_triangle_hc_wgsl branch 3 times, most recently from 639935d to d568cc9 Compare March 11, 2025 22:36
@AndyHovingh AndyHovingh marked this pull request as ready for review March 12, 2025 14:19
@AndyHovingh AndyHovingh requested a review from poweifeng March 12, 2025 14:19
@AndyHovingh
Copy link
Author

AndyHovingh commented Mar 12, 2025

@poweifeng note that we just ran into a snag when rebasing where we get some runtime errors as a result of WebGPUDriver.cpp indicating the shader language is WGSL (as opposed to ESSL3). But, I did not want to have that hold up getting some feedback on the PR as we address it.

ShaderLanguage WebGPUDriver::getShaderLanguage() const noexcept {
    return ShaderLanguage::WGSL;
}

update:
@bridgewaterrobbie proposed a good solution, which involves waiting for #8516 to get merged first and adding webgpu support in the sample and common material generation (when webgpu support is configured on) (+ a few small things, such as variant filter, to ignore known tint WGSL code gen issues). That's the plan.

@AndyHovingh AndyHovingh force-pushed the ajh/webgpu_hello_triangle_hc_wgsl branch from d568cc9 to 807f185 Compare March 12, 2025 20:21
Initial groundwork in creating WebGPU backend components, namely
the instance, adapter, device, and queue.
If configured to do so, the backend will print out details about
these components.
The samples/hellotriangle.cpp was slightly modified to include a
webgpu option which allows for exercising the above, but does not
yet draw anything to the screen/window.
NOTE: This has only been sanity tested with hello triangle
on Mac OS and the Android emulator at this time, NOT IOS,
Windows, or Linux yet.
@AndyHovingh AndyHovingh force-pushed the ajh/webgpu_hello_triangle_hc_wgsl branch from 807f185 to 54536bd Compare March 12, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Issue/PR does not affect clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants