-
Notifications
You must be signed in to change notification settings - Fork 16
Add deviceTypes API for WebGPU support #176
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Introduced a new `deviceTypes` prop in the Application component to specify graphics device types, allowing for fallback options between WebGPU and WebGL2. - Updated the Application documentation to include details on the new `deviceTypes` prop and its usage. - Enhanced the Application component to initialize the graphics device based on the specified device types. * changeset
🦋 Changeset detectedLatest commit: 7478e5a The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
- Updated Application component tests to pass the new deviceTypes prop, ensuring compatibility with the latest graphics device initialization. - Modified Container, Entity, Screen, and Script component tests to include deviceTypes for consistent testing across components. - Cleaned up unused code and improved test structure for better readability and maintainability.
…imize graphics device initialization - Set default value for deviceTypes to [DEVICETYPE_WEBGL2] in the ApplicationWithoutCanvas component. - Introduced memoization for deviceTypes to enhance performance during graphics device creation. - Updated graphics device initialization to use memoized deviceTypes for improved consistency.
- Added a test case to warn when an invalid deviceTypes prop is provided, ensuring proper validation. - Refactored the Application component to improve graphics device initialization and memoization of deviceTypes. - Updated the create-graphics-device utility to allow explicit device type specification without injecting additional devices. - Adjusted validation error messages for deviceTypes to provide clearer feedback on incorrect usage.
- Clarified the description of the deviceTypes prop to specify its role in determining the graphics device order. - Added information about the "null" device type for testing purposes, enhancing the documentation's comprehensiveness.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new
deviceTypes
prop to the Application instance which will set the graphics device precedence correctlyThis follows the same behaviour as the engine/editor taking the first successfully created graphics device. Also incldues documentation
Note the in 2.8.0 the engine is using WebGPU shaders, but you will likely still need the glslang transpiler for scripts and custom shaders when usign WebGPU. In this case pass
glslangUrl?: string;
andtwgslUrl?: string;
as graphicsDevice options and the engine will automatically transpile. This will become unnecesary once script shaders are converted.deviceTypes
prop in the Application component to specify graphics device types, allowing for fallback options between WebGPU and WebGL2.deviceTypes
prop and its usage.