Cleanup: Spelling, remove double negative

This commit is contained in:
Hans Goudey 2022-08-04 23:01:50 -05:00
parent 53c0c3cbd7
commit 359aca8d4c
5 changed files with 8 additions and 9 deletions

View File

@ -96,7 +96,7 @@ void main()
float dist_raw = texelFetch(lineTex, center_texel, 0).b;
float dist = decode_line_dist(dist_raw);
/* TODO: Opti: use textureGather. */
/* TODO: Optimization: use textureGather. */
vec4 neightbor_col0 = texelFetchOffset(colorTex, center_texel, 0, ivec2(1, 0));
vec4 neightbor_col1 = texelFetchOffset(colorTex, center_texel, 0, ivec2(-1, 0));
vec4 neightbor_col2 = texelFetchOffset(colorTex, center_texel, 0, ivec2(0, 1));

View File

@ -201,7 +201,7 @@ static void select_cache_populate(void *vedata, Object *ob)
if (!e_data.context.is_dirty && sel_data && sel_data->is_drawn) {
/* The object indices have already been drawn. Fill depth pass.
* Opti: Most of the time this depth pass is not used. */
* Optimization: Most of the time this depth pass is not used. */
struct Mesh *me = ob->data;
if (e_data.context.select_mode & SCE_SELECT_FACE) {
struct GPUBatch *geom_faces = DRW_mesh_batch_cache_get_triangles_with_select_id(me);

View File

@ -29,10 +29,9 @@ static int node_shader_gpu_geometry(GPUMaterial *mat,
if (out[5].hasoutput) {
GPU_material_flag_set(mat, GPU_MATFLAG_BARYCENTRIC);
}
/* Opti: don't request orco if not needed. */
/* Optimization: don't request orco if not needed. */
const float val[4] = {0.0f, 0.0f, 0.0f, 0.0f};
GPUNodeLink *orco_link = (!out[2].hasoutput) ? GPU_constant(val) :
GPU_attribute(mat, CD_ORCO, "");
GPUNodeLink *orco_link = out[2].hasoutput ? GPU_attribute(mat, CD_ORCO, "") : GPU_constant(val);
const bool success = GPU_stack_link(mat, node, "node_geometry", in, out, orco_link);

View File

@ -23,8 +23,8 @@ static int node_shader_gpu_hair_info(GPUMaterial *mat,
{
/* Length: don't request length if not needed. */
static const float zero = 0;
GPUNodeLink *length_link = (!out[2].hasoutput) ? GPU_constant(&zero) :
GPU_attribute(mat, CD_HAIRLENGTH, "");
GPUNodeLink *length_link = out[2].hasoutput ? GPU_attribute(mat, CD_HAIRLENGTH, "") :
GPU_constant(&zero);
return GPU_stack_link(mat, node, "node_hair_info", in, out, length_link);
}

View File

@ -41,9 +41,9 @@ static int node_shader_gpu_tex_coord(GPUMaterial *mat,
GPUNodeLink *inv_obmat = (ob != NULL) ? GPU_uniform(&ob->imat[0][0]) :
GPU_uniform(&dummy_matrix[0][0]);
/* Opti: don't request orco if not needed. */
/* Optimization: don't request orco if not needed. */
float4 zero(0.0f);
GPUNodeLink *orco = (!out[0].hasoutput) ? GPU_constant(zero) : GPU_attribute(mat, CD_ORCO, "");
GPUNodeLink *orco = out[0].hasoutput ? GPU_attribute(mat, CD_ORCO, "") : GPU_constant(zero);
GPUNodeLink *mtface = GPU_attribute(mat, CD_AUTO_FROM_NAME, "");
GPU_stack_link(mat, node, "node_tex_coord", in, out, inv_obmat, orco, mtface);