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

One texture in two different slots #1759

Closed
solan-solan opened this issue Mar 19, 2024 · 5 comments
Closed

One texture in two different slots #1759

solan-solan opened this issue Mar 19, 2024 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@solan-solan
Copy link
Contributor

  • axmol version:
  • devices test on:
  • developing environments
    • NDK version: r23c
    • Xcode version: 14.2+
    • Visual Studio:
      • VS version: 2022 (17.9+)
      • MSVC version: 19.39+
      • Windows SDK version: 10.0.22621.0+
    • cmake version:
      Steps to Reproduce:

Direct me please if it is bad designe from my side. Really I can avoid this case (and will do), but it happend in my application.

One shader use's some texture with slot 7. The second shader use's the same texture with slot 8. The second shader is drawn right after the first according to the accident.
Then the texture will not be bind to the slot 8 for the second shader
image
image

@DelinWorks
Copy link
Contributor

go to the config and turn off gl state cache and see if that helps

@solan-solan
Copy link
Contributor Author

solan-solan commented Mar 19, 2024

With disabled ...GUARD... macros texture works as expected, since bind will pass, but this feature reduce gl calls

May be it's better to leave all as is to avoid overhead, since this case looks rare, and textures have locations in builting shaders

@solan-solan solan-solan closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2024
@halx99 halx99 added this to the 2.1.3 milestone Mar 20, 2024
@halx99
Copy link
Collaborator

halx99 commented Mar 20, 2024

The cache should process active slot and texture binding, this should be the opengl state cache bug

@halx99 halx99 added the bug Something isn't working label Mar 20, 2024
@halx99 halx99 reopened this Mar 20, 2024
@halx99 halx99 closed this as completed in 2701bd1 Mar 20, 2024
@halx99
Copy link
Collaborator

halx99 commented Mar 20, 2024

@solan-solan please check latest commit: 2701bd1

@solan-solan
Copy link
Contributor Author

@halx99 I checked and it looks very good optimization, since there are no more extra texture bindings for objects which use multiple textures (ex. diffuse, then normal map) and drawn one by one. Thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants