mojoshader.c
branchtrunk
changeset 96 bc416e2b9de1
parent 95 56af2093eefe
child 97 4a41e3d17297
equal deleted inserted replaced
95:56af2093eefe 96:bc416e2b9de1
   155     emit_global global_emitter;
   155     emit_global global_emitter;
   156     emit_uniform uniform_emitter;
   156     emit_uniform uniform_emitter;
   157     emit_finalize finalize_emitter;
   157     emit_finalize finalize_emitter;
   158 } Profile;
   158 } Profile;
   159 
   159 
   160 typedef MOJOSHADER_shaderType ShaderType;
       
   161 
       
   162 typedef enum
   160 typedef enum
   163 {
   161 {
   164     RASTOUT_TYPE_POSITION = 0,
   162     RASTOUT_TYPE_POSITION = 0,
   165     RASTOUT_TYPE_FOG = 1,
   163     RASTOUT_TYPE_FOG = 1,
   166     RASTOUT_TYPE_POINT_SIZE = 2,
   164     RASTOUT_TYPE_POINT_SIZE = 2,
   320     const char *failstr;
   318     const char *failstr;
   321     char scratch[SCRATCH_BUFFERS][SCRATCH_BUFFER_SIZE];
   319     char scratch[SCRATCH_BUFFERS][SCRATCH_BUFFER_SIZE];
   322     int scratchidx;  // current scratch buffer.
   320     int scratchidx;  // current scratch buffer.
   323     int profileid;
   321     int profileid;
   324     const Profile *profile;
   322     const Profile *profile;
   325     ShaderType shader_type;
   323     MOJOSHADER_shaderType shader_type;
   326     uint8 major_ver;
   324     uint8 major_ver;
   327     uint8 minor_ver;
   325     uint8 minor_ver;
   328     DestArgInfo dest_args[1];
   326     DestArgInfo dest_args[1];
   329     SourceArgInfo source_args[5];
   327     SourceArgInfo source_args[5];
   330     uint32 dwords[4];
   328     uint32 dwords[4];
  3036 
  3034 
  3037 // Lookup table for instruction opcodes...
  3035 // Lookup table for instruction opcodes...
  3038 typedef struct
  3036 typedef struct
  3039 {
  3037 {
  3040     const char *opcode_string;
  3038     const char *opcode_string;
  3041     ShaderType shader_types;  // mask of shader types that can use this opcode.
  3039     MOJOSHADER_shaderType shader_types;  // mask of types that can use opcode.
  3042     int arg_tokens;
  3040     int arg_tokens;
  3043     args_function parse_args;
  3041     args_function parse_args;
  3044     state_function state;
  3042     state_function state;
  3045     emit_function emitter[STATICARRAYLEN(profiles)];
  3043     emit_function emitter[STATICARRAYLEN(profiles)];
  3046 } Instruction;
  3044 } Instruction;