diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-11-08 00:16:03 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-11-08 00:16:13 +0300 |
commit | bdd44564c9c1e22396fc8e30b6b6d831add02b56 (patch) | |
tree | f968b2a07d94e633bb8d38728deeb912d0bcb77b /source/blender/nodes/shader | |
parent | 4f709152f4f0140a03edd69c1a501dbd5cec4b55 (diff) |
GPU: Cleanups: Remove GPUMatType, Vectorize / MADD some operations
Diffstat (limited to 'source/blender/nodes/shader')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c | 3 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_tex_coord.c | 17 |
2 files changed, 5 insertions, 15 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c index 16d35c7003a..c628fd7a7f5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c @@ -103,8 +103,7 @@ static int node_shader_gpu_bsdf_principled(GPUMaterial *mat, bNode *node, bNodeE sss_scale = in[2].link; } else { - float one[3] = {1.0f, 1.0f, 1.0f}; - GPU_link(mat, "set_rgb", GPU_constant((float *)one), &sss_scale); + GPU_link(mat, "set_rgb_one", &sss_scale); } bool use_diffuse = socket_not_one(4) && socket_not_one(15); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c index 002fdc6d3ae..58fea60f9f5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c @@ -46,22 +46,13 @@ static int node_shader_gpu_tex_coord(GPUMaterial *mat, bNode *node, bNodeExecDat { GPUNodeLink *orco = GPU_attribute(CD_ORCO, ""); GPUNodeLink *mtface = GPU_attribute(CD_MTFACE, ""); - GPUMatType type = GPU_Material_get_type(mat); GPU_link(mat, "generated_from_orco", orco, &orco); - if (type == GPU_MATERIAL_TYPE_WORLD) { - return GPU_stack_link(mat, node, "node_tex_coord_background", in, out, - GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL), - GPU_builtin(GPU_INVERSE_VIEW_MATRIX), GPU_builtin(GPU_INVERSE_OBJECT_MATRIX), - GPU_builtin(GPU_CAMERA_TEXCO_FACTORS), orco, mtface); - } - else { - return GPU_stack_link(mat, node, "node_tex_coord", in, out, - GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL), - GPU_builtin(GPU_INVERSE_VIEW_MATRIX), GPU_builtin(GPU_INVERSE_OBJECT_MATRIX), - GPU_builtin(GPU_CAMERA_TEXCO_FACTORS), orco, mtface); - } + return GPU_stack_link(mat, node, "node_tex_coord", in, out, + GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL), + GPU_builtin(GPU_INVERSE_VIEW_MATRIX), GPU_builtin(GPU_INVERSE_OBJECT_MATRIX), + GPU_builtin(GPU_CAMERA_TEXCO_FACTORS), orco, mtface); } /* node type definition */ |