Lines Matching defs:op
378 std::ostringstream& op = isVertexCase ? vtx : frag;
395 op << "uniform mediump int ui_zero, ui_one, ui_two, ui_three;\n";
397 op << "uniform mediump int ui_four;\n";
399 op << "uniform ${PRECISION} ${VAR_TYPE} u_arr[${ARRAY_LEN}];\n";
411 op << " ${PRECISION} ${VAR_TYPE} res = ${VAR_TYPE}(0.0);\n";
414 op << " res += u_arr[0];\n";
415 op << " res += u_arr[1];\n";
416 op << " res += u_arr[2];\n";
417 op << " res += u_arr[3];\n";
421 op << " res += u_arr[ui_zero];\n";
422 op << " res += u_arr[ui_one];\n";
423 op << " res += u_arr[ui_two];\n";
424 op << " res += u_arr[ui_three];\n";
428 op << " for (int i = 0; i < 4; i++)\n";
429 op << " res += u_arr[i];\n";
434 op << " for (int i = 0; i < ui_four; i++)\n";
435 op << " res += u_arr[i];\n";
488 std::ostringstream& op = isVertexCase ? vtx : frag;
505 op << "uniform mediump int ui_zero, ui_one, ui_two, ui_three;\n";
508 op << "uniform mediump int ui_four;\n";
521 op
523 op << " ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(v_coords);\n";
525 op << " ${PRECISION} ${VAR_TYPE} arr[${ARRAY_LEN}];\n";
528 op << " arr[0] = ${VAR_TYPE}(coords);\n";
529 op << " arr[1] = ${VAR_TYPE}(coords) * 0.5;\n";
530 op << " arr[2] = ${VAR_TYPE}(coords) * 0.25;\n";
531 op << " arr[3] = ${VAR_TYPE}(coords) * 0.125;\n";
535 op << " arr[ui_zero] = ${VAR_TYPE}(coords);\n";
536 op << " arr[ui_one] = ${VAR_TYPE}(coords) * 0.5;\n";
537 op << " arr[ui_two] = ${VAR_TYPE}(coords) * 0.25;\n";
538 op << " arr[ui_three] = ${VAR_TYPE}(coords) * 0.125;\n";
542 op << " for (int i = 0; i < 4; i++)\n";
543 op << " {\n";
544 op << " arr[i] = ${VAR_TYPE}(coords);\n";
545 op << " coords = coords * 0.5;\n";
546 op << " }\n";
551 op << " for (int i = 0; i < ui_four; i++)\n";
552 op << " {\n";
553 op << " arr[i] = ${VAR_TYPE}(coords);\n";
554 op << " coords = coords * 0.5;\n";
555 op << " }\n";
559 op << " ${PRECISION} ${VAR_TYPE} res = ${VAR_TYPE}(0.0);\n";
562 op << " res += arr[0];\n";
563 op << " res += arr[1];\n";
564 op << " res += arr[2];\n";
565 op << " res += arr[3];\n";
569 op << " res += arr[ui_zero];\n";
570 op << " res += arr[ui_one];\n";
571 op << " res += arr[ui_two];\n";
572 op << " res += arr[ui_three];\n";
576 op << " for (int i = 0; i < 4; i++)\n";
577 op << " res += arr[i];\n";
582 op << " for (int i = 0; i < ui_four; i++)\n";
583 op << " res += arr[i];\n";
652 std::ostringstream& op = isVertexCase ? vtx : frag;
673 op << "uniform mediump int ui_zero";
674 if (vecLen >= 2) op << ", ui_one";
675 if (vecLen >= 3) op << ", ui_two";
676 if (vecLen >= 4) op << ", ui_three";
677 op << ";\n";
681 op << "uniform mediump int " << vecLenName << ";\n";
694 op << " ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(a_coords);\n";
696 op << " ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(v_coords);\n";
698 op << " ${PRECISION} ${VAR_TYPE} tmp;\n";
700 op << " tmp = coords.${SWIZZLE} * vec4(1.0, 0.5, 0.25, 0.125).${SWIZZLE};\n";
703 op << " tmp.x = coords.x;\n";
704 if (vecLen >= 2) op << " tmp.y = coords.y * 0.5;\n";
705 if (vecLen >= 3) op << " tmp.z = coords.z * 0.25;\n";
706 if (vecLen >= 4) op << " tmp.w = coords.w * 0.125;\n";
710 op << " tmp[0] = coords.x;\n";
711 if (vecLen >= 2) op << " tmp[1] = coords.y * 0.5;\n";
712 if (vecLen >= 3) op << " tmp[2] = coords.z * 0.25;\n";
713 if (vecLen >= 4) op << " tmp[3] = coords.w * 0.125;\n";
717 op << " tmp[ui_zero] = coords.x;\n";
718 if (vecLen >= 2) op << " tmp[ui_one] = coords.y * 0.5;\n";
719 if (vecLen >= 3) op << " tmp[ui_two] = coords.z * 0.25;\n";
720 if (vecLen >= 4) op << " tmp[ui_three] = coords.w * 0.125;\n";
724 op << " for (int i = 0; i < " << vecLen << "; i++)\n";
725 op << " {\n";
726 op << " tmp[i] = coords.x;\n";
727 op << " coords = coords.${ROT_SWIZZLE} * 0.5;\n";
728 op << " }\n";
733 op << " for (int i = 0; i < " << vecLenName << "; i++)\n";
734 op << " {\n";
735 op << " tmp[i] = coords.x;\n";
736 op << " coords = coords.${ROT_SWIZZLE} * 0.5;\n";
737 op << " }\n";
741 op << " ${PRECISION} float res = 0.0;\n";
743 op << " res = dot(tmp, ${VAR_TYPE}(1.0));\n";
746 op << " res += tmp.x;\n";
747 if (vecLen >= 2) op << " res += tmp.y;\n";
748 if (vecLen >= 3) op << " res += tmp.z;\n";
749 if (vecLen >= 4) op << " res += tmp.w;\n";
753 op << " res += tmp[0];\n";
754 if (vecLen >= 2) op << " res += tmp[1];\n";
755 if (vecLen >= 3) op << " res += tmp[2];\n";
756 if (vecLen >= 4) op << " res += tmp[3];\n";
760 op << " res += tmp[ui_zero];\n";
761 if (vecLen >= 2) op << " res += tmp[ui_one];\n";
762 if (vecLen >= 3) op << " res += tmp[ui_two];\n";
763 if (vecLen >= 4) op << " res += tmp[ui_three];\n";
767 op << " for (int i = 0; i < " << vecLen << "; i++)\n";
768 op << " res += tmp[i];\n";
773 op << " for (int i = 0; i < " << vecLenName << "; i++)\n";
774 op << " res += tmp[i];\n";
838 std::ostringstream& op = isVertexCase ? vtx : frag;
860 op << "uniform mediump int ui_zero";
861 if (matSize >= 2) op << ", ui_one";
862 if (matSize >= 3) op << ", ui_two";
863 if (matSize >= 4) op << ", ui_three";
864 op << ";\n";
868 op << "uniform mediump int " << matSizeName << ";\n";
881 op << " ${PRECISION} vec4 coords = a_coords;\n";
883 op << " ${PRECISION} vec4 coords = v_coords;\n";
885 op << " ${PRECISION} ${MAT_TYPE} tmp;\n";
888 op << " tmp[0] = ${VEC_TYPE}(coords);\n";
889 if (matSize >= 2) op << " tmp[1] = ${VEC_TYPE}(coords.yzwx) * 0.5;\n";
890 if (matSize >= 3) op << " tmp[2] = ${VEC_TYPE}(coords.zwxy) * 0.25;\n";
891 if (matSize >= 4) op << " tmp[3] = ${VEC_TYPE}(coords.wxyz) * 0.125;\n";
895 op << " tmp[ui_zero] = ${VEC_TYPE}(coords);\n";
896 if (matSize >= 2) op << " tmp[ui_one] = ${VEC_TYPE}(coords.yzwx) * 0.5;\n";
897 if (matSize >= 3) op << " tmp[ui_two] = ${VEC_TYPE}(coords.zwxy) * 0.25;\n";
898 if (matSize >= 4) op << " tmp[ui_three] = ${VEC_TYPE}(coords.wxyz) * 0.125;\n";
902 op << " for (int i = 0; i < " << matSize << "; i++)\n";
903 op << " {\n";
904 op << " tmp[i] = ${VEC_TYPE}(coords);\n";
905 op << " coords = coords.yzwx * 0.5;\n";
906 op << " }\n";
911 op << " for (int i = 0; i < " << matSizeName << "; i++)\n";
912 op << " {\n";
913 op << " tmp[i] = ${VEC_TYPE}(coords);\n";
914 op << " coords = coords.yzwx * 0.5;\n";
915 op << " }\n";
919 op << " ${PRECISION} ${VEC_TYPE} res = ${VEC_TYPE}(0.0);\n";
922 op << " res += tmp[0];\n";
923 if (matSize >= 2) op << " res += tmp[1];\n";
924 if (matSize >= 3) op << " res += tmp[2];\n";
925 if (matSize >= 4) op << " res += tmp[3];\n";
929 op << " res += tmp[ui_zero];\n";
930 if (matSize >= 2) op << " res += tmp[ui_one];\n";
931 if (matSize >= 3) op << " res += tmp[ui_two];\n";
932 if (matSize >= 4) op << " res += tmp[ui_three];\n";
936 op << " for (int i = 0; i < " << matSize << "; i++)\n";
937 op << " res += tmp[i];\n";
942 op << " for (int i = 0; i < " << matSizeName << "; i++)\n";
943 op << " res += tmp[i];\n";