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

Solves the issue #566 #573

Merged
merged 2 commits into from
Jun 11, 2023
Merged

Solves the issue #566 #573

merged 2 commits into from
Jun 11, 2023

Conversation

Erlangist
Copy link
Contributor

In issue #566 all consecutive custom materials in UI was treated as one. That's no longer the case.

Probably some more optimizations can be added, if two different UI materials have exactly the same parameters

@rokups rokups requested a review from eugeneko June 10, 2023 12:45
@eugeneko
Copy link
Member

eugeneko commented Jun 11, 2023

@Erlangist can you check if new version of your fix branch still works for you? It seems more correct.

@Erlangist
Copy link
Contributor Author

Yes, it works as intended

// Assuming that custom batch material have different parameters that
// the material in previous batch. Further optimizations are possible.
// Solves the issue #566
if (drawQueue->BeginShaderParameterGroup(SP_MATERIAL, batch.customMaterial_))
Copy link
Member

Choose a reason for hiding this comment

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

The idea is good but I don't think this is correct implementation.
Second parameter indicates wherther the attributes have changed, it's weird to just pass pointer there.

You should track current material (null by default) and pass batch.customMaterial_ != currentMaterial instead.
Can you check if that will work for you?

@eugeneko eugeneko merged commit de3325c into rbfx:master Jun 11, 2023
50 checks passed
eugeneko added a commit that referenced this pull request Jun 12, 2023
In issue #566 all consecutive custom materials in UI was treated as one.
That's no longer the case.

Probably some more optimizations can be added, if two different UI
materials have exactly the same parameters

---------

Co-authored-by: Eugene Kozlov <nekoeuge@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants