Skip to content

Commit

Permalink
Fix a bug that shader compiled with error in -nobindless mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Sep 8, 2022
1 parent 87b21fc commit b63b417
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Build/svencoop/renderer/shader/wsurf_shader.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ void main()
ClipPlaneTest(v_worldpos.xyz, v_normal.xyz);
#endif

vec2 baseTexcoord = vec2(0.0, 0.0);

#ifdef DIFFUSE_ENABLED

#ifdef REPLACETEXTURE_ENABLED
Expand All @@ -310,15 +312,15 @@ void main()
sampler2D diffuseTex = sampler2D(GetCurrentTextureHandle(TEXTURE_SSBO_REPLACE));
#endif

vec2 baseTexcoord = vec2(v_diffusetexcoord.x * v_replacetexcoord.x, v_diffusetexcoord.y * v_replacetexcoord.y);
baseTexcoord = vec2(v_diffusetexcoord.x * v_replacetexcoord.x, v_diffusetexcoord.y * v_replacetexcoord.y);

#else

#ifdef BINDLESS_ENABLED
sampler2D diffuseTex = sampler2D(GetCurrentTextureHandle(TEXTURE_SSBO_DIFFUSE));
#endif

vec2 baseTexcoord = v_diffusetexcoord.xy;
baseTexcoord = v_diffusetexcoord.xy;

#endif

Expand Down

0 comments on commit b63b417

Please sign in to comment.