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 | ||||
| ccl_device_noinline void svm_node_math(ccl_global const KernelGlobals *kg, | ccl_device_noinline void svm_node_math(KernelGlobals kg, | ||||
| ccl_private ShaderData *sd, | ccl_private ShaderData *sd, | ||||
| ccl_private float *stack, | ccl_private float *stack, | ||||
| uint type, | uint type, | ||||
| uint inputs_stack_offsets, | uint inputs_stack_offsets, | ||||
| uint result_stack_offset) | uint result_stack_offset) | ||||
| { | { | ||||
| uint a_stack_offset, b_stack_offset, c_stack_offset; | uint a_stack_offset, b_stack_offset, c_stack_offset; | ||||
| svm_unpack_node_uchar3(inputs_stack_offsets, &a_stack_offset, &b_stack_offset, &c_stack_offset); | svm_unpack_node_uchar3(inputs_stack_offsets, &a_stack_offset, &b_stack_offset, &c_stack_offset); | ||||
| float a = stack_load_float(stack, a_stack_offset); | float a = stack_load_float(stack, a_stack_offset); | ||||
| float b = stack_load_float(stack, b_stack_offset); | float b = stack_load_float(stack, b_stack_offset); | ||||
| float c = stack_load_float(stack, c_stack_offset); | float c = stack_load_float(stack, c_stack_offset); | ||||
| float result = svm_math((NodeMathType)type, a, b, c); | float result = svm_math((NodeMathType)type, a, b, c); | ||||
| stack_store_float(stack, result_stack_offset, result); | stack_store_float(stack, result_stack_offset, result); | ||||
| } | } | ||||
| ccl_device_noinline int svm_node_vector_math(ccl_global const KernelGlobals *kg, | ccl_device_noinline int svm_node_vector_math(KernelGlobals kg, | ||||
| ccl_private ShaderData *sd, | ccl_private ShaderData *sd, | ||||
| ccl_private float *stack, | ccl_private float *stack, | ||||
| uint type, | uint type, | ||||
| uint inputs_stack_offsets, | uint inputs_stack_offsets, | ||||
| uint outputs_stack_offsets, | uint outputs_stack_offsets, | ||||
| int offset) | int offset) | ||||
| { | { | ||||
| uint value_stack_offset, vector_stack_offset; | uint value_stack_offset, vector_stack_offset; | ||||
| Show All 30 Lines | |||||