-
Notifications
You must be signed in to change notification settings - Fork 861
[ShaderGraph] [Backport 10.3] Fix texture associated state (samplerstate, TexelSize) for subgraphs, CFNs #2577
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
Merged
Merged
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
15c6805
Add ST to texture params
c76e53b
Working with Universal / Texture2D (but not CFN yet)
464c730
CustomFunctionNode Texture2D working, allows full bare/non-bare selec…
6def478
Started on Cubemap/Array/3D
7564cec
Partial fixes fore 3d/array/cubemap
6d95d2b
Fix for texelSize node
a1acbb3
Texture2D nodes all working
5529870
Fixes for cubemap nodes, Texture2DArray nodes, Texture3d nodes
2f57ecb
Fix for HDRP
51cd85a
Fixes for GLES2
59fd40d
Fixes for NormalFromTextureNode, Texture2dAssetNode
32c4aed
Added SamplerState handling, cleaned up code to remove macro usage
c6a191f
Fix for ParallaxOcclusionMappingNode
857ffb5
Fix for NormalFromTextureNode, cleanup, adding changelog
9025101
Fix for old Texture2DArray and Texture3D inputs to CustomFunctionNodes
152ab5d
Fix for ParallaxMapping and Triplanar nodes handling of SamplerState …
1d1cbed
Cleanup, removing unused code and _ST values (for now)
4451e34
Fix samplerstates on SampleRawCubemap and SampleTexture2DLOD nodes
5028e08
Fix for VFX support, additional cleanup
1dcee04
Fix for decals
c7eb890
Fix for tests
3507116
Fix VFX path generation issues with textures
aa1db2d
Improved backwards compatibility, added graphics tests, addressing fe…
228c1f8
Merge branch '10.x.x/release' into 10.x.x/sg/fix/textures
796dc2d
Fix for GLES2 compilation
6452658
Fix for OpenGL Core
babacdd
Adding GLCore support for LOAD_TEXTURE3D and LOAD_TEXTURE3D_LOD
3347c9a
Fix for consoles
684e3bb
Disallow creating v0 of custom function node (which will upgrade inco…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| #ifndef UNITY_TEXTURE_INCLUDED | ||
| #define UNITY_TEXTURE_INCLUDED | ||
|
|
||
| #ifdef SHADER_API_GLES | ||
| #define SAMPLERDECL(n) GLES2UnsupportedSamplerState n; | ||
| #else | ||
| #define SAMPLERDECL(n) SAMPLER(n); | ||
| #endif | ||
|
|
||
| struct GLES2UnsupportedSamplerState | ||
| { | ||
| }; | ||
|
|
||
| struct UnitySamplerState | ||
| { | ||
| SAMPLERDECL(samplerstate) | ||
| }; | ||
|
|
||
| #ifdef SHADER_API_GLES | ||
| #define UnityBuildSamplerStateStruct(n) UnityBuildSamplerStateStructInternal() | ||
| #else | ||
| #define UnityBuildSamplerStateStruct(n) UnityBuildSamplerStateStructInternal(n) | ||
| #endif | ||
|
|
||
| UnitySamplerState UnityBuildSamplerStateStructInternal(SAMPLER(samplerstate)) | ||
| { | ||
| UnitySamplerState result; | ||
| ASSIGN_SAMPLER(result.samplerstate, samplerstate); | ||
| return result; | ||
| } | ||
|
|
||
| struct UnityTexture2D | ||
| { | ||
| TEXTURE2D(tex); | ||
| SAMPLERDECL(samplerstate) | ||
| float4 texelSize; | ||
| float4 scaleTranslate; | ||
| }; | ||
|
|
||
| #define UnityBuildTexture2DStruct(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, n##_ST) | ||
| #define UnityBuildTexture2DStructNoScale(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, float4(1, 1, 0, 0)) | ||
| UnityTexture2D UnityBuildTexture2DStructInternal(TEXTURE2D_PARAM(tex, samplerstate), float4 texelSize, float4 scaleTranslate) | ||
| { | ||
| UnityTexture2D result; | ||
| result.tex = tex; | ||
| ASSIGN_SAMPLER(result.samplerstate, samplerstate); | ||
| result.texelSize = texelSize; | ||
| result.scaleTranslate = scaleTranslate; | ||
| return result; | ||
| } | ||
|
|
||
| struct UnityTexture2DArray | ||
| { | ||
| TEXTURE2D_ARRAY(tex); | ||
| SAMPLERDECL(samplerstate) | ||
| }; | ||
|
|
||
| #define UnityBuildTexture2DArrayStruct(n) UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_ARGS(n, sampler##n)) | ||
| UnityTexture2DArray UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_PARAM(tex, samplerstate)) | ||
| { | ||
| UnityTexture2DArray result; | ||
| result.tex = tex; | ||
| ASSIGN_SAMPLER(result.samplerstate, samplerstate); | ||
| return result; | ||
| } | ||
|
|
||
|
|
||
| struct UnityTextureCube | ||
| { | ||
| TEXTURECUBE(tex); | ||
| SAMPLERDECL(samplerstate) | ||
| }; | ||
|
|
||
| #define UnityBuildTextureCubeStruct(n) UnityBuildTextureCubeStructInternal(TEXTURECUBE_ARGS(n, sampler##n)) | ||
| UnityTextureCube UnityBuildTextureCubeStructInternal(TEXTURECUBE_PARAM(tex, samplerstate)) | ||
| { | ||
| UnityTextureCube result; | ||
| result.tex = tex; | ||
| ASSIGN_SAMPLER(result.samplerstate, samplerstate); | ||
| return result; | ||
| } | ||
|
|
||
|
|
||
| struct UnityTexture3D | ||
| { | ||
| TEXTURE3D(tex); | ||
| SAMPLERDECL(samplerstate) | ||
| }; | ||
|
|
||
| #define UnityBuildTexture3DStruct(n) UnityBuildTexture3DStructInternal(TEXTURE3D_ARGS(n, sampler##n)) | ||
| UnityTexture3D UnityBuildTexture3DStructInternal(TEXTURE3D_PARAM(tex, samplerstate)) | ||
| { | ||
| UnityTexture3D result; | ||
| result.tex = tex; | ||
| ASSIGN_SAMPLER(result.samplerstate, samplerstate); | ||
| return result; | ||
| } | ||
|
|
||
| #undef SAMPLERDECL | ||
|
|
||
| #endif // UNITY_TEXTURE_INCLUDED |
10 changes: 10 additions & 0 deletions
10
com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.