diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-03-24 02:09:06 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-03-24 18:49:46 +0300 |
commit | 5801a016d4cf2384274b0f813e29d61662dc8ee2 (patch) | |
tree | 599380a204a5e54505f7940b4b33ff93b19c0017 /intern/cycles | |
parent | 2bec6f1f06dff400d3b5abd08064ef05312a29bf (diff) |
Cycles: slightly improve OpenCL performance by reordering SVM enum values
Ref T71479
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/kernel/svm/svm.h | 4 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_types.h | 122 |
2 files changed, 63 insertions, 63 deletions
diff --git a/intern/cycles/kernel/svm/svm.h b/intern/cycles/kernel/svm/svm.h index 0b2cbad4ff8..abeb8fa7457 100644 --- a/intern/cycles/kernel/svm/svm.h +++ b/intern/cycles/kernel/svm/svm.h @@ -231,6 +231,8 @@ ccl_device_noinline void svm_eval_nodes(KernelGlobals *kg, uint4 node = read_node(kg, &offset); switch (node.x) { + case NODE_END: + return; #if NODES_GROUP(NODE_GROUP_LEVEL_0) case NODE_SHADER_JUMP: { if (type == SHADER_TYPE_SURFACE) @@ -539,8 +541,6 @@ ccl_device_noinline void svm_eval_nodes(KernelGlobals *kg, svm_node_aov_value(kg, sd, stack, node, buffer); break; #endif /* NODES_GROUP(NODE_GROUP_LEVEL_4) */ - case NODE_END: - return; default: kernel_assert(!"Unknown node type was passed to the SVM machine"); return; diff --git a/intern/cycles/kernel/svm/svm_types.h b/intern/cycles/kernel/svm/svm_types.h index 86e5a52174a..85ede7770e9 100644 --- a/intern/cycles/kernel/svm/svm_types.h +++ b/intern/cycles/kernel/svm/svm_types.h @@ -63,98 +63,98 @@ CCL_NAMESPACE_BEGIN typedef enum ShaderNodeType { NODE_END = 0, + NODE_SHADER_JUMP, NODE_CLOSURE_BSDF, NODE_CLOSURE_EMISSION, NODE_CLOSURE_BACKGROUND, NODE_CLOSURE_SET_WEIGHT, NODE_CLOSURE_WEIGHT, + NODE_EMISSION_WEIGHT, NODE_MIX_CLOSURE, NODE_JUMP_IF_ZERO, NODE_JUMP_IF_ONE, - NODE_TEX_IMAGE, - NODE_TEX_IMAGE_BOX, - NODE_TEX_SKY, NODE_GEOMETRY, - NODE_GEOMETRY_DUPLI, - NODE_LIGHT_PATH, + NODE_CONVERT, + NODE_TEX_COORD, NODE_VALUE_F, NODE_VALUE_V, - NODE_MIX, NODE_ATTR, - NODE_CONVERT, - NODE_FRESNEL, - NODE_WIREFRAME, - NODE_WAVELENGTH, - NODE_BLACKBODY, - NODE_EMISSION_WEIGHT, - NODE_TEX_GRADIENT, - NODE_TEX_VORONOI, - NODE_TEX_MUSGRAVE, - NODE_TEX_WAVE, - NODE_TEX_MAGIC, - NODE_TEX_NOISE, - NODE_SHADER_JUMP, - NODE_SET_DISPLACEMENT, + NODE_VERTEX_COLOR, NODE_GEOMETRY_BUMP_DX, NODE_GEOMETRY_BUMP_DY, + NODE_SET_DISPLACEMENT, + NODE_DISPLACEMENT, + NODE_VECTOR_DISPLACEMENT, + NODE_TEX_IMAGE, + NODE_TEX_IMAGE_BOX, + NODE_TEX_NOISE, NODE_SET_BUMP, - NODE_MATH, - NODE_VECTOR_MATH, - NODE_VECTOR_TRANSFORM, - NODE_MAPPING, - NODE_TEX_COORD, - NODE_TEX_COORD_BUMP_DX, - NODE_TEX_COORD_BUMP_DY, NODE_ATTR_BUMP_DX, NODE_ATTR_BUMP_DY, - NODE_TEX_ENVIRONMENT, + NODE_VERTEX_COLOR_BUMP_DX, + NODE_VERTEX_COLOR_BUMP_DY, + NODE_TEX_COORD_BUMP_DX, + NODE_TEX_COORD_BUMP_DY, + NODE_CLOSURE_SET_NORMAL, + NODE_ENTER_BUMP_EVAL, + NODE_LEAVE_BUMP_EVAL, + NODE_HSV, NODE_CLOSURE_HOLDOUT, + NODE_FRESNEL, NODE_LAYER_WEIGHT, NODE_CLOSURE_VOLUME, - NODE_SEPARATE_VECTOR, - NODE_COMBINE_VECTOR, - NODE_SEPARATE_HSV, - NODE_COMBINE_HSV, - NODE_HSV, - NODE_CAMERA, - NODE_INVERT, - NODE_NORMAL, + NODE_PRINCIPLED_VOLUME, + NODE_MATH, + NODE_VECTOR_MATH, + NODE_RGB_RAMP, NODE_GAMMA, - NODE_TEX_CHECKER, NODE_BRIGHTCONTRAST, - NODE_RGB_RAMP, - NODE_RGB_CURVES, - NODE_VECTOR_CURVES, - NODE_MIN_MAX, - NODE_LIGHT_FALLOFF, + NODE_LIGHT_PATH, NODE_OBJECT_INFO, NODE_PARTICLE_INFO, + NODE_HAIR_INFO, + NODE_TEXTURE_MAPPING, + NODE_MAPPING, + NODE_MIN_MAX, + NODE_CAMERA, + NODE_TEX_ENVIRONMENT, + NODE_TEX_SKY, + NODE_TEX_GRADIENT, + NODE_TEX_VORONOI, + NODE_TEX_MUSGRAVE, + NODE_TEX_WAVE, + NODE_TEX_MAGIC, + NODE_TEX_CHECKER, NODE_TEX_BRICK, - NODE_CLOSURE_SET_NORMAL, - NODE_AMBIENT_OCCLUSION, + NODE_TEX_WHITE_NOISE, + NODE_NORMAL, + NODE_LIGHT_FALLOFF, + NODE_IES, + NODE_RGB_CURVES, + NODE_VECTOR_CURVES, NODE_TANGENT, NODE_NORMAL_MAP, - NODE_HAIR_INFO, - NODE_UVMAP, - NODE_TEX_VOXEL, - NODE_ENTER_BUMP_EVAL, - NODE_LEAVE_BUMP_EVAL, - NODE_BEVEL, - NODE_DISPLACEMENT, - NODE_VECTOR_DISPLACEMENT, - NODE_PRINCIPLED_VOLUME, - NODE_IES, + NODE_INVERT, + NODE_MIX, + NODE_SEPARATE_VECTOR, + NODE_COMBINE_VECTOR, + NODE_SEPARATE_HSV, + NODE_COMBINE_HSV, + NODE_VECTOR_ROTATE, + NODE_VECTOR_TRANSFORM, + NODE_WIREFRAME, + NODE_WAVELENGTH, + NODE_BLACKBODY, NODE_MAP_RANGE, NODE_CLAMP, - NODE_TEXTURE_MAPPING, - NODE_TEX_WHITE_NOISE, - NODE_VERTEX_COLOR, - NODE_VERTEX_COLOR_BUMP_DX, - NODE_VERTEX_COLOR_BUMP_DY, + NODE_BEVEL, + NODE_AMBIENT_OCCLUSION, + NODE_TEX_VOXEL, NODE_AOV_START, - NODE_AOV_VALUE, NODE_AOV_COLOR, - NODE_VECTOR_ROTATE, + NODE_AOV_VALUE, + /* NOTE: for best OpenCL performance, item definition in the enum must + * match the switch case order in svm.h. */ } ShaderNodeType; typedef enum NodeAttributeType { |