Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/svm/svm_math.h
| Show All 10 Lines | |||||
| * distributed under the License is distributed on an "AS IS" BASIS, | * distributed under the License is distributed on an "AS IS" BASIS, | ||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| * See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | ||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| /* Nodes */ | |||||
| ccl_device void svm_node_math(KernelGlobals *kg, | ccl_device void svm_node_math(KernelGlobals *kg, | ||||
| ShaderData *sd, | ShaderData *sd, | ||||
| float *stack, | float *stack, | ||||
| uint itype, | uint type, | ||||
| uint f1_offset, | uint a_and_b_stack_offsets, | ||||
| uint f2_offset, | uint result_stack_offset, | ||||
| int *offset) | int *offset) | ||||
| { | { | ||||
| NodeMath type = (NodeMath)itype; | uint a_stack_offset, b_stack_offset; | ||||
| float f1 = stack_load_float(stack, f1_offset); | decode_node_uchar4(a_and_b_stack_offsets, &a_stack_offset, &b_stack_offset, NULL, NULL); | ||||
| float f2 = stack_load_float(stack, f2_offset); | |||||
| float f = svm_math(type, f1, f2); | |||||
| uint4 node1 = read_node(kg, offset); | float a = stack_load_float(stack, a_stack_offset); | ||||
| float b = stack_load_float(stack, b_stack_offset); | |||||
| float result = svm_math((NodeMathType)type, a, b); | |||||
| stack_store_float(stack, node1.y, f); | stack_store_float(stack, result_stack_offset, result); | ||||
| } | } | ||||
| ccl_device void svm_node_vector_math(KernelGlobals *kg, | ccl_device void svm_node_vector_math(KernelGlobals *kg, | ||||
| ShaderData *sd, | ShaderData *sd, | ||||
| float *stack, | float *stack, | ||||
| uint itype, | uint itype, | ||||
| uint v1_offset, | uint v1_offset, | ||||
| uint v2_offset, | uint v2_offset, | ||||
| Show All 19 Lines | |||||