mojoshader_opengl.c
changeset 773 3e3638be6e2b
parent 772 6ada59b8559a
child 774 9ac0e5ad0205
equal deleted inserted replaced
772:6ada59b8559a 773:3e3638be6e2b
   103 typedef WINGDIAPI const GLubyte * (APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
   103 typedef WINGDIAPI const GLubyte * (APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
   104 typedef WINGDIAPI GLenum (APIENTRYP PFNGLGETERRORPROC) (void);
   104 typedef WINGDIAPI GLenum (APIENTRYP PFNGLGETERRORPROC) (void);
   105 typedef WINGDIAPI void (APIENTRYP PFNGLENABLEPROC) (GLenum cap);
   105 typedef WINGDIAPI void (APIENTRYP PFNGLENABLEPROC) (GLenum cap);
   106 typedef WINGDIAPI void (APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
   106 typedef WINGDIAPI void (APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
   107 
   107 
       
   108 // Max entries for each register file type...
       
   109 #define MAX_REG_FILE_F 8192
       
   110 #define MAX_REG_FILE_I 2047
       
   111 #define MAX_REG_FILE_B 2047
       
   112 
   108 struct MOJOSHADER_glContext
   113 struct MOJOSHADER_glContext
   109 {
   114 {
   110     // Allocators...
   115     // Allocators...
   111     MOJOSHADER_malloc malloc_fn;
   116     MOJOSHADER_malloc malloc_fn;
   112     MOJOSHADER_free free_fn;
   117     MOJOSHADER_free free_fn;
   113     void *malloc_data;
   118     void *malloc_data;
   114 
   119 
   115     // The constant register files...
   120     // The constant register files...
   116     // Man, it kills me how much memory this takes...
   121     // Man, it kills me how much memory this takes...
   117     GLfloat vs_reg_file_f[8192 * 4];
   122     GLfloat vs_reg_file_f[MAX_REG_FILE_F * 4];
   118     GLint vs_reg_file_i[2047 * 4];
   123     GLint vs_reg_file_i[MAX_REG_FILE_I * 4];
   119     uint8 vs_reg_file_b[2047];
   124     uint8 vs_reg_file_b[MAX_REG_FILE_B];
   120     GLfloat ps_reg_file_f[8192 * 4];
   125     GLfloat ps_reg_file_f[MAX_REG_FILE_F * 4];
   121     GLint ps_reg_file_i[2047 * 4];
   126     GLint ps_reg_file_i[MAX_REG_FILE_I * 4];
   122     uint8 ps_reg_file_b[2047];
   127     uint8 ps_reg_file_b[MAX_REG_FILE_B];
   123     GLuint sampler_reg_file[16];
   128     GLuint sampler_reg_file[16];
   124 
   129 
   125     // GL stuff...
   130     // GL stuff...
   126     int opengl_major;
   131     int opengl_major;
   127     int opengl_minor;
   132     int opengl_minor;