Cleanup: Workbench: Address shader warnings
This commit is contained in:
@@ -43,7 +43,6 @@ void main()
|
||||
vec3 center_wpos, tan, binor;
|
||||
|
||||
hair_get_center_pos_tan_binor_time(is_persp,
|
||||
ModelMatrixInverse,
|
||||
drw_view.viewinv[3].xyz,
|
||||
drw_view.viewinv[2].xyz,
|
||||
center_wpos,
|
||||
|
||||
@@ -96,5 +96,7 @@ if (WITH_GPU_SHADER_CPP_COMPILATION)
|
||||
compile_sources_as_cpp(workbench_cpp_shaders_vert "${SRC_GLSL_VERT}" "GPU_VERTEX_SHADER")
|
||||
compile_sources_as_cpp(workbench_cpp_shaders_frag "${SRC_GLSL_FRAG}" "GPU_FRAGMENT_SHADER")
|
||||
compile_sources_as_cpp(workbench_cpp_shaders_comp "${SRC_GLSL_COMP}" "GPU_COMPUTE_SHADER")
|
||||
compile_sources_as_cpp(workbench_cpp_shaders_lib "${SRC_GLSL_LIB}" "GPU_LIBRARY_SHADER")
|
||||
# Only enable to make sure they compile on their own.
|
||||
# Otherwise it creates a warning about pragma once.
|
||||
# compile_sources_as_cpp(workbench_cpp_shaders_lib "${SRC_GLSL_LIB}" "GPU_LIBRARY_SHADER")
|
||||
endif()
|
||||
|
||||
@@ -43,7 +43,7 @@ void main()
|
||||
#endif
|
||||
|
||||
#ifdef WORKBENCH_LIGHTING_STUDIO
|
||||
float roughness, metallic;
|
||||
float roughness = 0.0, metallic = 0.0;
|
||||
workbench_float_pair_decode(mat_data.a, roughness, metallic);
|
||||
color.rgb = get_world_lighting(base_color, roughness, metallic, N, V);
|
||||
#endif
|
||||
|
||||
@@ -109,7 +109,6 @@ void main_downsample()
|
||||
vec4 color3 = textureLod(sceneColorTex, texel.zy, 0.0);
|
||||
vec4 color4 = textureLod(sceneColorTex, texel.xw, 0.0);
|
||||
|
||||
vec4 depths;
|
||||
vec2 cocs1 = textureLod(inputCocTex, texel.xy, 0.0).rg;
|
||||
vec2 cocs2 = textureLod(inputCocTex, texel.zw, 0.0).rg;
|
||||
vec2 cocs3 = textureLod(inputCocTex, texel.zy, 0.0).rg;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
SHADER_LIBRARY_CREATE_INFO(workbench_color_texture)
|
||||
|
||||
/* TODO(fclem): deduplicate code. */
|
||||
bool node_tex_tile_lookup(inout vec3 co, sampler2DArray ima, sampler1DArray map)
|
||||
bool node_tex_tile_lookup(inout vec3 co, sampler1DArray map)
|
||||
{
|
||||
vec2 tile_pos = floor(co.xy);
|
||||
|
||||
@@ -41,7 +41,7 @@ vec3 workbench_image_color(vec2 uvs)
|
||||
|
||||
vec3 co = vec3(uvs, 0.0);
|
||||
if (isImageTile) {
|
||||
if (node_tex_tile_lookup(co, imageTileArray, imageTileData)) {
|
||||
if (node_tex_tile_lookup(co, imageTileData)) {
|
||||
color = texture(imageTileArray, co);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -56,7 +56,7 @@ void workbench_hair_random_material(float rand,
|
||||
void main()
|
||||
{
|
||||
bool is_persp = (drw_view.winmat[3][3] == 0.0);
|
||||
float time, thick_time, thickness;
|
||||
float time = 0.0, thick_time = 0.0, thickness = 0.0;
|
||||
vec3 world_pos, tan, binor;
|
||||
hair_get_pos_tan_binor_time(is_persp,
|
||||
drw_modelinv(),
|
||||
|
||||
@@ -46,10 +46,7 @@ void emit_cap(bool front,
|
||||
tri_EmitVertex(2, out_vertex_id, geom_out);
|
||||
}
|
||||
|
||||
void geometry_main(VertOut geom_in[3],
|
||||
uint out_vertex_id,
|
||||
uint out_primitive_id,
|
||||
uint out_invocation_id)
|
||||
void geometry_main(VertOut geom_in[3], uint out_vertex_id, uint out_invocation_id)
|
||||
{
|
||||
vec3 v10 = geom_in[0].lP - geom_in[1].lP;
|
||||
vec3 v12 = geom_in[2].lP - geom_in[1].lP;
|
||||
@@ -96,8 +93,6 @@ void main()
|
||||
uint in_primitive_first_vertex = in_primitive_id * input_primitive_vertex_count;
|
||||
|
||||
uint out_vertex_id = uint(gl_VertexID) % ouput_primitive_vertex_count;
|
||||
uint out_primitive_id = (uint(gl_VertexID) / ouput_primitive_vertex_count) %
|
||||
ouput_primitive_count;
|
||||
uint out_invocation_id = (uint(gl_VertexID) / output_vertex_count_per_invocation) %
|
||||
ouput_invocation_count;
|
||||
|
||||
@@ -113,5 +108,5 @@ void main()
|
||||
|
||||
/* Discard by default. */
|
||||
gl_Position = vec4(NAN_FLT);
|
||||
geometry_main(vert_out, out_vertex_id, out_primitive_id, out_invocation_id);
|
||||
geometry_main(vert_out, out_vertex_id, out_invocation_id);
|
||||
}
|
||||
|
||||
@@ -187,7 +187,6 @@ in float dummy;
|
||||
# endif
|
||||
|
||||
void hair_get_center_pos_tan_binor_time(bool is_persp,
|
||||
mat4 invmodel_mat,
|
||||
vec3 camera_pos,
|
||||
vec3 camera_z,
|
||||
out vec3 wpos,
|
||||
@@ -237,7 +236,7 @@ void hair_get_pos_tan_binor_time(bool is_persp,
|
||||
out float thick_time)
|
||||
{
|
||||
hair_get_center_pos_tan_binor_time(
|
||||
is_persp, invmodel_mat, camera_pos, camera_z, wpos, wtan, wbinor, time, thickness);
|
||||
is_persp, camera_pos, camera_z, wpos, wtan, wbinor, time, thickness);
|
||||
if (hairThicknessRes > 1) {
|
||||
thick_time = float(gl_VertexID % hairThicknessRes) / float(hairThicknessRes - 1);
|
||||
thick_time = thickness * (thick_time * 2.0 - 1.0);
|
||||
|
||||
@@ -46,7 +46,7 @@ void pointcloud_get_pos_and_radius(out vec3 outpos, out float outradius)
|
||||
void pointcloud_get_pos_nor_radius(out vec3 outpos, out vec3 outnor, out float outradius)
|
||||
{
|
||||
vec3 p;
|
||||
float radius;
|
||||
float radius = 0.0;
|
||||
pointcloud_get_pos_and_radius(p, radius);
|
||||
|
||||
mat3 facing_mat = pointcloud_get_facing_matrix(p);
|
||||
@@ -88,7 +88,7 @@ void pointcloud_get_pos_nor_radius(out vec3 outpos, out vec3 outnor, out float o
|
||||
void pointcloud_get_pos_and_nor(out vec3 outpos, out vec3 outnor)
|
||||
{
|
||||
vec3 nor, pos;
|
||||
float radius;
|
||||
float radius = 0.0;
|
||||
pointcloud_get_pos_nor_radius(pos, nor, radius);
|
||||
outpos = pos;
|
||||
outnor = nor;
|
||||
|
||||
Reference in New Issue
Block a user