-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
V4 custom shader batching support #20584
Open
rh101
wants to merge
10
commits into
cocos2d:v4
Choose a base branch
from
rh101:v4-custom-shader-batching
base: v4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Sync with master branch
Sync with master
Sync with master
Sync with master
Sync with master
Sync with master
…prite batching with custom shaders. This also requires that ProgramState also have its own unique ID, since ProgramState can have different uniform values, and there is no other way to differentiate between ProgramStates, as checking uniform values is an expensive process.
…to its purpose, which is now _programStateBatchId
If anyone has any suggestions on how to implement this differently to achieve the same outcome (supporting batching with custom shaders), then please do put your ideas forward. |
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.
Changed ProgramType IDs to be uint32_t, so that users can specify their own custom ID. This will enable users to batch custom shaders.
Note that the changes do not affect the operation of the built-in types or CUSTOM_PROGRAM type. The code only comes into effect when users set their own ID via Program::setProgramType() and optional ProgramState::setBatchId (for ProgramStates with different uniform values).
An example:
This gives the users the flexibility of providing their own custom shaders while still allowing the nodes using them to be batched.