share functions/textures/samplers between shaders

  • moriz1
  • Topic Author
More
6 years 1 week 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.

Please Log in or Create an account to join the conversation.

  • crosire
More
6 years 1 week 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
More
6 years 1 week 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
More
6 years 1 week 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.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.