618{
621
622
624 {
626
628 break;
629
633
635 || (
i == 0 &&
settings->color_key_enabled))
637
639 {
645 break;
646
647 default:
648 break;
649 }
650
652 continue;
653
657
660 }
661
663 {
664 const char *sampler_type;
665
666 if (!(tex_map & (1u <<
i)))
667 continue;
668
670 {
672 sampler_type = "1D";
673 break;
675 sampler_type = "2D";
676 break;
678 sampler_type = "3D";
679 break;
681 sampler_type = "CUBE";
682 break;
683 default:
686 break;
687 }
688 if (sampler_type)
690
692 }
693
694
701
706
714
719
722
726
728 {
729 if (tex_map & (1u <<
i))
730 {
733 else
735 }
736 }
737
738
739
741 {
742 const char *texture_function, *coord_mask;
743 bool proj;
744
745 if (!(tex_map & (1u <<
i)))
746 continue;
747
749 {
750 proj = false;
751 }
754 {
755 proj = true;
756 }
757 else
758 {
759 FIXME(
"Unexpected projection mode %d.\n",
settings->op[
i].projected);
760 proj = true;
761 }
762
764 {
766 texture_function = "tex1D";
767 coord_mask = "x";
768 break;
770 texture_function = "tex2D";
771 coord_mask = "xy";
772 break;
774 texture_function = "tex3D";
775 coord_mask = "xyz";
776 break;
778 texture_function = "texCUBE";
779 coord_mask = "xyz";
780 break;
781 default:
783 texture_function = "";
784 coord_mask = "xyzw";
785 proj = false;
786 break;
787 }
788
789 if (proj)
790 coord_mask = "xyzw";
791
795 {
796 shader_addline(
buffer,
"ret.xy = mul(transpose((float2x2)c.bumpenv_matrices[%u]), tex%u.xy);\n",
i - 1,
i - 1);
797
798
799
800
802 {
804 {
807 }
808 else
809 {
812 }
813 }
814 else
815 {
817 }
818
820 i, texture_function, proj ?
"proj" :
"",
i, coord_mask);
821
823 {
824 shader_addline(
buffer,
"tex%u *= saturate(tex%u.z * c.bumpenv_lscale[%u][%u] + c.bumpenv_loffset[%u][%u]);\n",
825 i,
i - 1, (
i - 1) / 4, (
i - 1) % 4, (
i - 1) / 4, (
i - 1) % 4);
826 }
827 }
829 {
831 i, texture_function, proj ?
"proj" :
"",
i,
i);
832 }
833 else
834 {
836 i, texture_function, proj ?
"proj" :
"",
i,
i, coord_mask);
837 }
838 }
839
841 {
844 }
845
847
849 {
850 bool op_equal;
851
853 break;
854
867 else
872
874 {
878 }
879 else if (op_equal)
880 {
884 }
887 {
894 }
895 }
896
898
900
901 return true;
902}
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
static void generate_fragment_op(struct wined3d_string_buffer *buffer, unsigned int stage, bool color, bool alpha, bool tmp_dst, unsigned int op, unsigned int dw_arg0, unsigned int dw_arg1, unsigned int dw_arg2)
GLuint GLuint GLuint GLuint arg1
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define WINED3DTA_SELECTMASK
@ WINED3D_TOP_SELECT_ARG1
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM
@ WINED3D_TOP_BUMPENVMAP_LUMINANCE
@ WINED3D_TOP_SELECT_ARG2
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA
#define WINED3D_MAX_FFP_TEXTURES
#define WINED3DTA_TEXTURE
@ WINED3D_GL_RES_TYPE_TEX_3D
@ WINED3D_GL_RES_TYPE_TEX_CUBE
@ WINED3D_GL_RES_TYPE_TEX_2D
@ WINED3D_GL_RES_TYPE_TEX_1D
@ WINED3D_PROJECTION_COUNT3
@ WINED3D_PROJECTION_NONE
@ WINED3D_PROJECTION_COUNT4