Lines Matching refs:RGB
67 /** If the scheduler has paired an RGB and an Alpha instruction together,
257 else if (sinst->Instruction->U.P.RGB.Opcode == RC_OPCODE_NOP)
306 if (!sinst->Instruction->U.P.RGB.OutputWriteMask &&
310 RGB.OutputWriteMask
341 sinst->Score += sinst->Instruction->U.P.RGB.Src[src_idx].Used +
497 * dst_full is an rgb instruction, meaning that it has a vector instruction(rgb)
517 dst_sub = &dst_full->RGB;
529 info = rc_get_opcode_info(dst_full->RGB.Opcode);
575 /*If this arg does not read from an rgb source,
577 if (!(rc_source_type_swz(dst_full->RGB.Arg[arg].Swizzle)
582 if (dst_full->RGB.Arg[arg].Source == srcp_src)
583 dst_full->RGB
587 else if(dst_full->RGB.Arg[arg].Source == free_source
589 dst_full->RGB.Arg[arg].Source = srcp_src;
597 /* This function assumes that rgb.Alpha and alpha.RGB are unused */
599 struct rc_pair_instruction * rgb,
604 assert(rgb->Alpha.Opcode == RC_OPCODE_NOP);
605 assert(alpha->RGB.Opcode == RC_OPCODE_NOP);
611 /* Merge the rgb presubtract registers. */
612 if (alpha->RGB.Src[RC_PAIR_PRESUB_SRC].Used) {
613 if (!merge_presub_sources(rgb, alpha->RGB, RC_SOURCE_RGB)) {
619 if(!merge_presub_sources(rgb, alpha->Alpha, RC_SOURCE_ALPHA)){
624 /* Copy alpha args into rgb */
637 file = alpha->RGB.Src[oldsrc].File;
638 index = alpha->RGB.Src[oldsrc].Index;
645 source = rc_pair_alloc_source(rgb, srcrgb, srcalpha, file, index);
649 rgb->Alpha.Arg[arg].Source = source;
650 rgb->Alpha.Arg[arg].Swizzle = alpha->Alpha.Arg[arg].Swizzle;
651 rgb->Alpha.Arg[arg].Abs = alpha->Alpha.Arg[arg].Abs;
652 rgb->Alpha.Arg[arg].Negate = alpha->Alpha.Arg[arg].Negate;
655 /* Copy alpha opcode into rgb */
656 rgb->Alpha.Opcode = alpha->Alpha.Opcode;
657 rgb->Alpha.DestIndex = alpha->Alpha.DestIndex;
658 rgb->Alpha.WriteMask = alpha->Alpha.WriteMask;
659 rgb->Alpha.OutputWriteMask = alpha->Alpha.OutputWriteMask;
660 rgb->Alpha.DepthWriteMask = alpha->Alpha.DepthWriteMask;
661 rgb->Alpha.Saturate = alpha->Alpha.Saturate;
662 rgb->Alpha.Omod = alpha->Alpha.Omod;
666 if (rgb->WriteALUResult)
669 rgb->WriteALUResult = alpha->WriteALUResult;
670 rgb->ALUResultCompare = alpha->ALUResultCompare;
674 rgb->SemWait |= alpha->SemWait;
680 * Try to merge the given instructions into the rgb instructions.
685 static int merge_instructions(struct rc_pair_instruction * rgb, struct rc_pair_instruction * alpha)
691 if ((rgb->WriteALUResult && alpha->Alpha.OutputWriteMask)
692 || (rgb->RGB.OutputWriteMask && alpha->WriteALUResult)) {
698 if ((rgb->RGB.OutputWriteMask && !alpha->Alpha.OutputWriteMask)
699 || (!rgb->RGB.OutputWriteMask && alpha->Alpha.OutputWriteMask)) {
703 memcpy(&backup, rgb, sizeof(struct rc_pair_instruction));
705 if (destructive_merge_instructions(rgb, alpha))
708 memcpy(rgb, &backup, sizeof(struct rc_pair_instruction));
719 if (emitted->Prev->U.P.RGB.WriteMask)
720 prev_rgb_index = emitted->Prev->U.P.RGB.DestIndex;
728 /* Check the previous rgb instruction */
729 if (emitted->U.P.RGB.Src[RC_PAIR_PRESUB_SRC].Used) {
731 emitted->U.P.RGB.Src[RC_PAIR_PRESUB_SRC].Index);
733 unsigned int index = emitted->U.P.RGB.Src[i].Index;
734 if (emitted->U.P.RGB.Src[i].File == RC_FILE_TEMPORARY
823 if (!can_remap(inst->U.P.RGB.Opcode)
885 unsigned int old_mask = pair_inst->RGB.WriteMask;
888 rc_get_opcode_info(pair_inst->RGB.Opcode);
895 if (!pair_inst->RGB.WriteMask)
898 if (!can_convert_opcode_to_alpha(pair_inst->RGB.Opcode)
913 for (i = pair_inst->RGB.DestIndex; i < RC_REGISTER_MAX_INDEX; i++) {
920 pair_inst->RGB.DestIndex,
934 * as the RGB opcode, then the Alpha instruction will already contain
938 if (pair_inst->RGB.Opcode != RC_OPCODE_REPL_ALPHA) {
939 pair_inst->Alpha.Opcode = pair_inst->RGB.Opcode;
940 memcpy(pair_inst->Alpha.Arg, pair_inst->RGB.Arg,
945 pair_inst->Alpha.Target = pair_inst->RGB.Target;
946 pair_inst->Alpha.OutputWriteMask = pair_inst->RGB.OutputWriteMask;
947 pair_inst->Alpha.DepthWriteMask = pair_inst->RGB.DepthWriteMask;
948 pair_inst->Alpha.Saturate = pair_inst->RGB.Saturate;
949 pair_inst->Alpha.Omod = pair_inst->RGB.Omod;
962 pair_inst->RGB.Opcode = RC_OPCODE_NOP;
963 pair_inst->RGB.DestIndex = 0;
964 pair_inst->RGB.WriteMask = 0;
965 pair_inst->RGB.Target = 0;
966 pair_inst->RGB.OutputWriteMask = 0;
967 pair_inst->RGB.DepthWriteMask = 0;
968 pair_inst->RGB.Saturate = 0;
969 memset(pair_inst->RGB.Arg, 0, sizeof(pair_inst->RGB.Arg));
987 && list_ptr->Instruction->U.P.RGB.Opcode
1022 * This function attempts to merge RGB and Alpha instructions together.
1038 /* Remove RGB and Alpha from their ready lists.
1055 /* Full instructions that have RC_OPCODE_REPL_ALPHA in the RGB
1059 /* Try to convert some of the RGB instructions to Alpha and
1060 * try to pair it with another RGB. */
1098 fprintf(stderr, "RGB:\n");
1295 /* Get global readers for possible RGB->Alpha conversion. */