Rename reserved GLSL word on AMD GPU

This commit is contained in:
ExPikaPaka
2026-07-21 14:07:51 +02:00
parent eacc236ccb
commit dc1e8b6dc3
4 changed files with 14 additions and 14 deletions

View File

@@ -40,7 +40,7 @@ varying vec3 clipping_planes_dots;
varying vec4 model_pos; varying vec4 model_pos;
varying vec4 world_pos; varying vec4 world_pos;
varying float weight; varying float weight;
varying float active; varying float island_active;
varying vec2 vertex_uv; varying vec2 vertex_uv;
void projection_axes(vec3 n, out vec3 t, out vec3 b) void projection_axes(vec3 n, out vec3 t, out vec3 b)
@@ -81,7 +81,7 @@ void main()
// Mikkelsen surface-gradient bump; see the 140 variant for the full rationale. Scale-exact // Mikkelsen surface-gradient bump; see the 140 variant for the full rationale. Scale-exact
// for a conformal LSCM map (no global 1/tiling assumption), and gated by the paint weight // for a conformal LSCM map (no global 1/tiling assumption), and gated by the paint weight
// via a multiply so the branch stays uniform (use_vertex_uv is a uniform). // via a multiply so the branch stays uniform (use_vertex_uv is a uniform).
vec2 uv = (active > 0.5) vec2 uv = (island_active > 0.5)
? vec2(dot(island_delta_lin.xy, vertex_uv), dot(island_delta_lin.zw, vertex_uv)) + island_delta_tr ? vec2(dot(island_delta_lin.xy, vertex_uv), dot(island_delta_lin.zw, vertex_uv)) + island_delta_tr
: vertex_uv; : vertex_uv;
float h = texture2D(height_tex, uv).r; float h = texture2D(height_tex, uv).r;

View File

@@ -17,7 +17,7 @@ varying vec3 clipping_planes_dots;
varying vec4 model_pos; varying vec4 model_pos;
varying vec4 world_pos; varying vec4 world_pos;
varying float weight; varying float weight;
varying float active; varying float island_active;
varying vec2 vertex_uv; varying vec2 vertex_uv;
void main() void main()
@@ -28,7 +28,7 @@ void main()
gl_Position = projection_matrix * view_model_matrix * model_pos; gl_Position = projection_matrix * view_model_matrix * model_pos;
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z); clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
weight = v_normal.x; weight = v_normal.x;
active = v_normal.y; island_active = v_normal.y;
vertex_uv = v_tex_coord; vertex_uv = v_tex_coord;
} }

View File

@@ -60,7 +60,7 @@ uniform vec2 uv_offset;
uniform bool invert; uniform bool invert;
uniform bool use_vertex_uv; // true: sample at vertex_uv with a derived tangent frame (LSCM) uniform bool use_vertex_uv; // true: sample at vertex_uv with a derived tangent frame (LSCM)
// A 2x3 affine (columns packed as lin = (m00, m01, m10, m11), tr = (m02, m12)) applied to the uv of // A 2x3 affine (columns packed as lin = (m00, m01, m10, m11), tr = (m02, m12)) applied to the uv of
// the island currently being dragged in the UV editor (active > 0.5). Identity when nothing is // the island currently being dragged in the UV editor (island_active > 0.5). Identity when nothing is
// dragged, so this whole path is a no-op then. Lets a UV island drag move the bump on the model with // dragged, so this whole path is a no-op then. Lets a UV island drag move the bump on the model with
// only a uniform update // only a uniform update
uniform vec4 island_delta_lin; uniform vec4 island_delta_lin;
@@ -70,7 +70,7 @@ in vec3 clipping_planes_dots;
in vec4 model_pos; in vec4 model_pos;
in vec4 world_pos; in vec4 world_pos;
in float weight; in float weight;
in float active; in float island_active;
in vec2 vertex_uv; in vec2 vertex_uv;
out vec4 out_color; out vec4 out_color;
@@ -125,8 +125,8 @@ void main()
// derivatives are well defined; the paint weight gates the result by a plain multiply (k) // derivatives are well defined; the paint weight gates the result by a plain multiply (k)
// rather than a per-fragment branch, keeping it that way. // rather than a per-fragment branch, keeping it that way.
// The dragged island's uv rides a uniform affine so its bump moves without a rebuild; every // The dragged island's uv rides a uniform affine so its bump moves without a rebuild; every
// other vertex (active == 0) samples its baked uv unchanged. // other vertex (island_active == 0) samples its baked uv unchanged.
vec2 uv = (active > 0.5) vec2 uv = (island_active > 0.5)
? vec2(dot(island_delta_lin.xy, vertex_uv), dot(island_delta_lin.zw, vertex_uv)) + island_delta_tr ? vec2(dot(island_delta_lin.xy, vertex_uv), dot(island_delta_lin.zw, vertex_uv)) + island_delta_tr
: vertex_uv; : vertex_uv;
float h = texture(height_tex, uv).r; float h = texture(height_tex, uv).r;

View File

@@ -27,7 +27,7 @@ out vec3 clipping_planes_dots;
out vec4 model_pos; out vec4 model_pos;
out vec4 world_pos; out vec4 world_pos;
out float weight; out float weight;
out float active; out float island_active;
out vec2 vertex_uv; out vec2 vertex_uv;
void main() void main()
@@ -38,7 +38,7 @@ void main()
gl_Position = projection_matrix * view_model_matrix * model_pos; gl_Position = projection_matrix * view_model_matrix * model_pos;
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z); clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
weight = v_normal.x; weight = v_normal.x;
active = v_normal.y; island_active = v_normal.y;
vertex_uv = v_tex_coord; vertex_uv = v_tex_coord;
} }