473{
475 unsigned int stage;
477 GLuint dstmod, argmod0, argmod1, argmod2, argmodextra;
483
485 ERR(
"Failed to generate a GL_ATI_fragment_shader shader id\n");
486 return 0;
487 }
489 checkGLcall(
"GL_EXTCALL(glBindFragmentShaderATI(ret))");
490
491 TRACE(
"glBeginFragmentShaderATI()\n");
493 checkGLcall(
"GL_EXTCALL(glBeginFragmentShaderATI())");
494
495
496 for (stage = 0; stage < gl_info->
limits.textures; ++stage)
497 {
499 break;
502 continue;
503
505
506 TRACE(
"glSampleMapATI(GL_REG_%d_ATI, GL_TEXTURE_%d_ARB, GL_SWIZZLE_STR_ATI)\n",
507 stage, stage);
515 } else {
517 }
518 TRACE(
"glPassTexCoordATI(GL_REG_%d_ATI, GL_TEXTURE_%d_ARB, %s)\n",
523 }
524
525
526 for (stage = 0; stage < gl_info->
limits.textures; ++stage)
527 {
528 GLuint argmodextra_x, argmodextra_y;
530
532 break;
535 continue;
536
537 fixup =
op[stage].color_fixup;
539 {
540 FIXME(
"Swizzles not implemented\n");
543 }
544 else
545 {
546
549 }
550
555
556
557
558
559
560
561
562
563
564
565
574 }
575
576
577 for (stage = 0; stage < gl_info->
limits.textures; ++stage)
578 {
580 break;
581
586 } else {
588 }
589
591 {
592 if (stage > 0
595 {
596 TRACE(
"glSampleMapATI(GL_REG_%d_ATI, GL_REG_%d_ATI, GL_SWIZZLE_STR_ATI)\n",
597 stage, stage);
601 } else {
602 TRACE(
"glSampleMapATI(GL_REG_%d_ATI, GL_TEXTURE_%d_ARB, %s)\n",
607 }
608 }
609 }
610
611
613 {
615 {
616 if (!stage)
617 {
618
623 }
624 break;
625 }
626
628
629
630
631 if(tmparg ==
GL_NONE)
continue;
632
633 dstreg = tmparg;
634 } else {
636 }
637
639 {
640
641 continue;
642 }
643
650
653
655 {
657 FIXME(
"Constant %u already used.\n", stage);
659 }
660
663
664 switch (
op[stage].cop)
665 {
668 argmod1 = argmod2;
669 rep1 = rep2;
670
673 arg1, rep1, argmod1);
674 break;
675
678
682
686 arg2, rep2, argmod2);
687 break;
688
691
694
699 arg2, rep2, argmodextra | argmod2);
700 break;
701
706 arg2, rep2, argmod2);
707 break;
708
711
712
713
716 arg1, rep1, argmodextra,
717 arg1, rep1, argmod1);
718 break;
719
723
727
731
738 arg2, rep2, argmod2);
739 break;
740
746 arg1, rep1, argmod1);
747 break;
748
749
750
753
755 if (!argmodextra)
756 argmodextra = argmod1;
760 arg1, rep1, argmod1);
761 break;
762
765
767 if (!argmodextra)
768 argmodextra = argmod1;
771 arg1, rep1, argmodextra,
773 break;
774
779 break;
780
785 arg0, rep0, argmod0);
786 break;
787
790 arg0, rep0, argmod0,
792 arg2, rep2, argmod2);
793 break;
794
795 default:
FIXME(
"Unhandled color operation %d on stage %d\n",
op[stage].cop, stage);
796 }
797
804
805 switch (
op[stage].aop)
806 {
808
809 if (!stage)
810 {
813 }
814 break;
815
818 argmod1 = argmod2;
819
823 break;
824
828
833
838 break;
839
842
845
851 break;
852
858 break;
859
862
863
864
869 break;
870
874
878
882
890 break;
891
898 break;
899
900
901
906 break;
907
913 break;
914
920 break;
921
928 ERR(
"Application uses an invalid alpha operation\n");
929 break;
930
931 default:
FIXME(
"Unhandled alpha operation %d on stage %d\n",
op[stage].aop, stage);
932 }
933 }
934
936 FIXME(
"Texture factor constant already used.\n");
938
939
941 {
944 }
945
946 TRACE(
"glEndFragmentShaderATI()\n");
948 checkGLcall(
"GL_EXTCALL(glEndFragmentShaderATI())");
950}
static BOOL op_reads_constant(const struct texture_stage_op *op)
static void wrap_op3(const struct wined3d_gl_info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
static void wrap_op2(const struct wined3d_gl_info *gl_info, GLuint op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
static BOOL op_reads_texture(const struct texture_stage_op *op)
static void atifs_color_fixup(const struct wined3d_gl_info *gl_info, struct color_fixup_desc fixup, GLuint reg)
static BOOL op_reads_tfactor(const struct texture_stage_op *op)
static GLuint find_tmpreg(const struct texture_stage_op op[MAX_TEXTURES])
static GLuint register_for_arg(DWORD arg, const struct wined3d_gl_info *gl_info, unsigned int stage, GLuint *mod, GLuint *rep, GLuint tmparg)
#define ATIFS_CONST_BUMPMAT(i)
static const char * debug_swizzle(GLuint swizzle)
GLuint GLuint GLuint GLuint arg1
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
struct wined3d_gl_limits limits
#define WINED3DTA_TFACTOR
#define WINED3DTA_CURRENT
@ WINED3D_TOP_SELECT_ARG1
@ WINED3D_TOP_BLEND_DIFFUSE_ALPHA
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM
@ WINED3D_TOP_BLEND_CURRENT_ALPHA
@ WINED3D_TOP_ADD_SIGNED_2X
@ WINED3D_TOP_MODULATE_INVCOLOR_ADD_ALPHA
@ WINED3D_TOP_MULTIPLY_ADD
@ WINED3D_TOP_MODULATE_INVALPHA_ADD_COLOR
@ WINED3D_TOP_BUMPENVMAP_LUMINANCE
@ WINED3D_TOP_MODULATE_COLOR_ADD_ALPHA
@ WINED3D_TOP_MODULATE_4X
@ WINED3D_TOP_SELECT_ARG2
@ WINED3D_TOP_MODULATE_ALPHA_ADD_COLOR
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA
@ WINED3D_TOP_DOTPRODUCT3
@ WINED3D_TOP_MODULATE_2X
@ WINED3D_TOP_BLEND_FACTOR_ALPHA
#define WINED3DTA_DIFFUSE