mojoshader.c
changeset 1076 e17375519c45
parent 1075 61e5b2764ec8
child 1077 57e18783574e
equal deleted inserted replaced
1075:61e5b2764ec8 1076:e17375519c45
  2812     output_line(ctx, "%s", code);
  2812     output_line(ctx, "%s", code);
  2813 } // emit_GLSL_FRC
  2813 } // emit_GLSL_FRC
  2814 
  2814 
  2815 static void emit_GLSL_M4X4(Context *ctx)
  2815 static void emit_GLSL_M4X4(Context *ctx)
  2816 {
  2816 {
  2817     // !!! FIXME: d3d is row-major, glsl is column-major, I think.
       
  2818     char src0[64]; make_GLSL_srcarg_string_full(ctx, 0, src0, sizeof (src0));
  2817     char src0[64]; make_GLSL_srcarg_string_full(ctx, 0, src0, sizeof (src0));
  2819     char row0[64]; make_GLSL_srcarg_string_full(ctx, 1, row0, sizeof (row0));
  2818     char row0[64]; make_GLSL_srcarg_string_full(ctx, 1, row0, sizeof (row0));
  2820     char row1[64]; make_GLSL_srcarg_string_full(ctx, 2, row1, sizeof (row1));
  2819     char row1[64]; make_GLSL_srcarg_string_full(ctx, 2, row1, sizeof (row1));
  2821     char row2[64]; make_GLSL_srcarg_string_full(ctx, 3, row2, sizeof (row2));
  2820     char row2[64]; make_GLSL_srcarg_string_full(ctx, 3, row2, sizeof (row2));
  2822     char row3[64]; make_GLSL_srcarg_string_full(ctx, 4, row3, sizeof (row3));
  2821     char row3[64]; make_GLSL_srcarg_string_full(ctx, 4, row3, sizeof (row3));
  2827     output_line(ctx, "%s", code);
  2826     output_line(ctx, "%s", code);
  2828 } // emit_GLSL_M4X4
  2827 } // emit_GLSL_M4X4
  2829 
  2828 
  2830 static void emit_GLSL_M4X3(Context *ctx)
  2829 static void emit_GLSL_M4X3(Context *ctx)
  2831 {
  2830 {
  2832     // !!! FIXME: d3d is row-major, glsl is column-major, I think.
       
  2833     char src0[64]; make_GLSL_srcarg_string_full(ctx, 0, src0, sizeof (src0));
  2831     char src0[64]; make_GLSL_srcarg_string_full(ctx, 0, src0, sizeof (src0));
  2834     char row0[64]; make_GLSL_srcarg_string_full(ctx, 1, row0, sizeof (row0));
  2832     char row0[64]; make_GLSL_srcarg_string_full(ctx, 1, row0, sizeof (row0));
  2835     char row1[64]; make_GLSL_srcarg_string_full(ctx, 2, row1, sizeof (row1));
  2833     char row1[64]; make_GLSL_srcarg_string_full(ctx, 2, row1, sizeof (row1));
  2836     char row2[64]; make_GLSL_srcarg_string_full(ctx, 3, row2, sizeof (row2));
  2834     char row2[64]; make_GLSL_srcarg_string_full(ctx, 3, row2, sizeof (row2));
  2837     char code[128];
  2835     char code[128];
  2841     output_line(ctx, "%s", code);
  2839     output_line(ctx, "%s", code);
  2842 } // emit_GLSL_M4X3
  2840 } // emit_GLSL_M4X3
  2843 
  2841 
  2844 static void emit_GLSL_M3X4(Context *ctx)
  2842 static void emit_GLSL_M3X4(Context *ctx)
  2845 {
  2843 {
  2846     // !!! FIXME: d3d is row-major, glsl is column-major, I think.
       
  2847     char src0[64]; make_GLSL_srcarg_string_vec3(ctx, 0, src0, sizeof (src0));
  2844     char src0[64]; make_GLSL_srcarg_string_vec3(ctx, 0, src0, sizeof (src0));
  2848     char row0[64]; make_GLSL_srcarg_string_vec3(ctx, 1, row0, sizeof (row0));
  2845     char row0[64]; make_GLSL_srcarg_string_vec3(ctx, 1, row0, sizeof (row0));
  2849     char row1[64]; make_GLSL_srcarg_string_vec3(ctx, 2, row1, sizeof (row1));
  2846     char row1[64]; make_GLSL_srcarg_string_vec3(ctx, 2, row1, sizeof (row1));
  2850     char row2[64]; make_GLSL_srcarg_string_vec3(ctx, 3, row2, sizeof (row2));
  2847     char row2[64]; make_GLSL_srcarg_string_vec3(ctx, 3, row2, sizeof (row2));
  2851     char row3[64]; make_GLSL_srcarg_string_vec3(ctx, 4, row3, sizeof (row3));
  2848     char row3[64]; make_GLSL_srcarg_string_vec3(ctx, 4, row3, sizeof (row3));
  2859     output_line(ctx, "%s", code);
  2856     output_line(ctx, "%s", code);
  2860 } // emit_GLSL_M3X4
  2857 } // emit_GLSL_M3X4
  2861 
  2858 
  2862 static void emit_GLSL_M3X3(Context *ctx)
  2859 static void emit_GLSL_M3X3(Context *ctx)
  2863 {
  2860 {
  2864     // !!! FIXME: d3d is row-major, glsl is column-major, I think.
       
  2865     char src0[64]; make_GLSL_srcarg_string_vec3(ctx, 0, src0, sizeof (src0));
  2861     char src0[64]; make_GLSL_srcarg_string_vec3(ctx, 0, src0, sizeof (src0));
  2866     char row0[64]; make_GLSL_srcarg_string_vec3(ctx, 1, row0, sizeof (row0));
  2862     char row0[64]; make_GLSL_srcarg_string_vec3(ctx, 1, row0, sizeof (row0));
  2867     char row1[64]; make_GLSL_srcarg_string_vec3(ctx, 2, row1, sizeof (row1));
  2863     char row1[64]; make_GLSL_srcarg_string_vec3(ctx, 2, row1, sizeof (row1));
  2868     char row2[64]; make_GLSL_srcarg_string_vec3(ctx, 3, row2, sizeof (row2));
  2864     char row2[64]; make_GLSL_srcarg_string_vec3(ctx, 3, row2, sizeof (row2));
  2869     char code[128];
  2865     char code[128];
  2873     output_line(ctx, "%s", code);
  2869     output_line(ctx, "%s", code);
  2874 } // emit_GLSL_M3X3
  2870 } // emit_GLSL_M3X3
  2875 
  2871 
  2876 static void emit_GLSL_M3X2(Context *ctx)
  2872 static void emit_GLSL_M3X2(Context *ctx)
  2877 {
  2873 {
  2878     // !!! FIXME: d3d is row-major, glsl is column-major, I think.
       
  2879     char src0[64]; make_GLSL_srcarg_string_vec3(ctx, 0, src0, sizeof (src0));
  2874     char src0[64]; make_GLSL_srcarg_string_vec3(ctx, 0, src0, sizeof (src0));
  2880     char row0[64]; make_GLSL_srcarg_string_vec3(ctx, 1, row0, sizeof (row0));
  2875     char row0[64]; make_GLSL_srcarg_string_vec3(ctx, 1, row0, sizeof (row0));
  2881     char row1[64]; make_GLSL_srcarg_string_vec3(ctx, 2, row1, sizeof (row1));
  2876     char row1[64]; make_GLSL_srcarg_string_vec3(ctx, 2, row1, sizeof (row1));
  2882 
  2877 
  2883     char code[128];
  2878     char code[128];