- Posts: 85
share functions/textures/samplers between shaders
- moriz1
-
Topic Author
- Offline
Less More
2 years 9 months ago #1 by moriz1
share functions/textures/samplers between shaders was created by moriz1
i vaguely remember reading somewhere that it is possible to share functions/textures/samplers between shader effects. if this is possible, what's the syntax to get it to work?
reason i'm asking, is because i've written two shaders with the same luma adaptation effects. if i run both shaders, i suspect the two adaptation effects will intefere with each other.
reason i'm asking, is because i've written two shaders with the same luma adaptation effects. if i run both shaders, i suspect the two adaptation effects will intefere with each other.
Please Log in or Create an account to join the conversation.
- crosire
-
- Offline
Less More
- Posts: 3836
2 years 9 months ago #2 by crosire
Replied by crosire on topic share functions/textures/samplers between shaders
Textures are shared. As long as they have the same name in both effects, they access the same memory. Anything else is not shared, though name clashes are between effects are undefined behavior. How you access a texture (that is, with which sampler or render target) is irrelevant.
Please Log in or Create an account to join the conversation.
- moriz1
-
Topic Author
- Offline
Less More
- Posts: 85
2 years 9 months ago #3 by moriz1
Replied by moriz1 on topic share functions/textures/samplers between shaders
is there a way to check if a texture has already been instantiated in another shader?
Please Log in or Create an account to join the conversation.
- crosire
-
- Offline
Less More
- Posts: 3836
2 years 9 months ago #4 by crosire
Replied by crosire on topic share functions/textures/samplers between shaders
No.
Please Log in or Create an account to join the conversation.