Added dpuint64 and dpint64 types.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12357
d7cf8633-e32d-0410-b094-
e92efae38249
ALIGN(float fb_clipplane[4]);
int shader_mode;
ALIGN(float fb_clipplane[4]);
int shader_mode;
- int shader_permutation;
+ dpuint64 shader_permutation;
int shader_exactspecularmath;
DPSOFTRAST_Texture *texbound[DPSOFTRAST_MAXTEXTUREUNITS];
int shader_exactspecularmath;
DPSOFTRAST_Texture *texbound[DPSOFTRAST_MAXTEXTUREUNITS];
int drawclipped;
int shader_mode;
int drawclipped;
int shader_mode;
- int shader_permutation;
+ dpuint64 shader_permutation;
int shader_exactspecularmath;
int texture_max;
int shader_exactspecularmath;
int texture_max;
dpsoftrast.stride_texcoord[unitnum] = (int)stride;
}
dpsoftrast.stride_texcoord[unitnum] = (int)stride;
}
-DEFCOMMAND(18, SetShader, int mode; int permutation; int exactspecularmath;)
+DEFCOMMAND(18, SetShader, int mode; dpuint64 permutation; int exactspecularmath;)
static void DPSOFTRAST_Interpret_SetShader(DPSOFTRAST_State_Thread *thread, DPSOFTRAST_Command_SetShader *command)
{
thread->shader_mode = command->mode;
thread->shader_permutation = command->permutation;
thread->shader_exactspecularmath = command->exactspecularmath;
}
static void DPSOFTRAST_Interpret_SetShader(DPSOFTRAST_State_Thread *thread, DPSOFTRAST_Command_SetShader *command)
{
thread->shader_mode = command->mode;
thread->shader_permutation = command->permutation;
thread->shader_exactspecularmath = command->exactspecularmath;
}
-void DPSOFTRAST_SetShader(int mode, int permutation, int exactspecularmath)
+void DPSOFTRAST_SetShader(int mode, dpuint64 permutation, int exactspecularmath)
{
DPSOFTRAST_Command_SetShader *command = DPSOFTRAST_ALLOCATECOMMAND(SetShader);
command->mode = mode;
{
DPSOFTRAST_Command_SetShader *command = DPSOFTRAST_ALLOCATECOMMAND(SetShader);
command->mode = mode;
-void DPSOFTRAST_SetShader(int mode, int permutation, int exactspecularmath);
+void DPSOFTRAST_SetShader(int mode, dpuint64 permutation, int exactspecularmath);
#define DPSOFTRAST_Uniform1f(index, v0) DPSOFTRAST_Uniform4f(index, v0, 0, 0, 0)
#define DPSOFTRAST_Uniform2f(index, v0, v1) DPSOFTRAST_Uniform4f(index, v0, v1, 0, 0)
#define DPSOFTRAST_Uniform3f(index, v0, v1, v2) DPSOFTRAST_Uniform4f(index, v0, v1, v2, 0)
#define DPSOFTRAST_Uniform1f(index, v0) DPSOFTRAST_Uniform4f(index, v0, 0, 0, 0)
#define DPSOFTRAST_Uniform2f(index, v0, v1) DPSOFTRAST_Uniform4f(index, v0, v1, 0, 0)
#define DPSOFTRAST_Uniform3f(index, v0, v1, v2) DPSOFTRAST_Uniform4f(index, v0, v1, v2, 0)
/// hash lookup data
struct r_glsl_permutation_s *hashnext;
unsigned int mode;
/// hash lookup data
struct r_glsl_permutation_s *hashnext;
unsigned int mode;
- unsigned int permutation;
/// indicates if we have tried compiling this permutation already
qboolean compiled;
/// indicates if we have tried compiling this permutation already
qboolean compiled;
shaderstaticparmstrings_list[shaderstaticparms_count++] = "#define " n "\n"; \
else \
shaderstaticparmstrings_list[shaderstaticparms_count++] = "\n"
shaderstaticparmstrings_list[shaderstaticparms_count++] = "#define " n "\n"; \
else \
shaderstaticparmstrings_list[shaderstaticparms_count++] = "\n"
-static void R_CompileShader_AddStaticParms(unsigned int mode, unsigned int permutation)
+static void R_CompileShader_AddStaticParms(unsigned int mode, dpuint64 permutation)
{
shaderstaticparms_count = 0;
{
shaderstaticparms_count = 0;
/// storage for permutations linked in the hash table
memexpandablearray_t r_glsl_permutationarray;
/// storage for permutations linked in the hash table
memexpandablearray_t r_glsl_permutationarray;
-static r_glsl_permutation_t *R_GLSL_FindPermutation(unsigned int mode, unsigned int permutation)
+static r_glsl_permutation_t *R_GLSL_FindPermutation(unsigned int mode, dpuint64 permutation)
{
//unsigned int hashdepth = 0;
unsigned int hashindex = (permutation * 0x1021) & (SHADERPERMUTATION_HASHSIZE - 1);
{
//unsigned int hashdepth = 0;
unsigned int hashindex = (permutation * 0x1021) & (SHADERPERMUTATION_HASHSIZE - 1);
return Mem_strdup(r_main_mempool, modeinfo->builtinstring);
}
return Mem_strdup(r_main_mempool, modeinfo->builtinstring);
}
-static void R_GLSL_CompilePermutation(r_glsl_permutation_t *p, unsigned int mode, unsigned int permutation)
+static void R_GLSL_CompilePermutation(r_glsl_permutation_t *p, unsigned int mode, dpuint64 permutation)
// now add all the permutation pretexts
for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
{
// now add all the permutation pretexts
for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
{
- if (permutation & (1<<i))
+ if (permutation & (1ll<<i))
{
vertstrings_list[vertstrings_count++] = shaderpermutationinfo[i].pretext;
geomstrings_list[geomstrings_count++] = shaderpermutationinfo[i].pretext;
{
vertstrings_list[vertstrings_count++] = shaderpermutationinfo[i].pretext;
geomstrings_list[geomstrings_count++] = shaderpermutationinfo[i].pretext;
Mem_Free(sourcestring);
}
Mem_Free(sourcestring);
}
-static void R_SetupShader_SetPermutationGLSL(unsigned int mode, unsigned int permutation)
+static void R_SetupShader_SetPermutationGLSL(unsigned int mode, dpuint64 permutation)
{
r_glsl_permutation_t *perm = R_GLSL_FindPermutation(mode, permutation);
if (r_glsl_permutation != perm)
{
r_glsl_permutation_t *perm = R_GLSL_FindPermutation(mode, permutation);
if (r_glsl_permutation != perm)
for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
{
// reduce i more quickly whenever it would not remove any bits
for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
{
// reduce i more quickly whenever it would not remove any bits
- int j = 1<<(SHADERPERMUTATION_COUNT-1-i);
+ dpuint64 j = 1ll<<(SHADERPERMUTATION_COUNT-1-i);
if (!(permutation & j))
continue;
permutation -= j;
if (!(permutation & j))
continue;
permutation -= j;
/// hash lookup data
struct r_hlsl_permutation_s *hashnext;
unsigned int mode;
/// hash lookup data
struct r_hlsl_permutation_s *hashnext;
unsigned int mode;
- unsigned int permutation;
/// indicates if we have tried compiling this permutation already
qboolean compiled;
/// indicates if we have tried compiling this permutation already
qboolean compiled;
/// storage for permutations linked in the hash table
memexpandablearray_t r_hlsl_permutationarray;
/// storage for permutations linked in the hash table
memexpandablearray_t r_hlsl_permutationarray;
-static r_hlsl_permutation_t *R_HLSL_FindPermutation(unsigned int mode, unsigned int permutation)
+static r_hlsl_permutation_t *R_HLSL_FindPermutation(unsigned int mode, dpuint64 permutation)
{
//unsigned int hashdepth = 0;
unsigned int hashindex = (permutation * 0x1021) & (SHADERPERMUTATION_HASHSIZE - 1);
{
//unsigned int hashdepth = 0;
unsigned int hashindex = (permutation * 0x1021) & (SHADERPERMUTATION_HASHSIZE - 1);
psbin = (DWORD *)Mem_Realloc(tempmempool, psbin, 0);
}
psbin = (DWORD *)Mem_Realloc(tempmempool, psbin, 0);
}
-static void R_HLSL_CompilePermutation(r_hlsl_permutation_t *p, unsigned int mode, unsigned int permutation)
+static void R_HLSL_CompilePermutation(r_hlsl_permutation_t *p, unsigned int mode, dpuint64 permutation)
{
int i;
shadermodeinfo_t *modeinfo = &shadermodeinfo[SHADERLANGUAGE_HLSL][mode];
{
int i;
shadermodeinfo_t *modeinfo = &shadermodeinfo[SHADERLANGUAGE_HLSL][mode];
// now add all the permutation pretexts
for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
{
// now add all the permutation pretexts
for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
{
- if (permutation & (1<<i))
+ if (permutation & (1ll<<i))
{
vertstrings_list[vertstrings_count++] = shaderpermutationinfo[i].pretext;
geomstrings_list[geomstrings_count++] = shaderpermutationinfo[i].pretext;
{
vertstrings_list[vertstrings_count++] = shaderpermutationinfo[i].pretext;
geomstrings_list[geomstrings_count++] = shaderpermutationinfo[i].pretext;
static inline void hlslPSSetParameter2f(D3DPSREGISTER_t r, float x, float y) {float temp[4];Vector4Set(temp, x, y, 0, 0);IDirect3DDevice9_SetPixelShaderConstantF(vid_d3d9dev, r, temp, 1);}
static inline void hlslPSSetParameter1f(D3DPSREGISTER_t r, float x) {float temp[4];Vector4Set(temp, x, 0, 0, 0);IDirect3DDevice9_SetPixelShaderConstantF(vid_d3d9dev, r, temp, 1);}
static inline void hlslPSSetParameter2f(D3DPSREGISTER_t r, float x, float y) {float temp[4];Vector4Set(temp, x, y, 0, 0);IDirect3DDevice9_SetPixelShaderConstantF(vid_d3d9dev, r, temp, 1);}
static inline void hlslPSSetParameter1f(D3DPSREGISTER_t r, float x) {float temp[4];Vector4Set(temp, x, 0, 0, 0);IDirect3DDevice9_SetPixelShaderConstantF(vid_d3d9dev, r, temp, 1);}
-void R_SetupShader_SetPermutationHLSL(unsigned int mode, unsigned int permutation)
+void R_SetupShader_SetPermutationHLSL(unsigned int mode, dpuint64 permutation)
{
r_hlsl_permutation_t *perm = R_HLSL_FindPermutation(mode, permutation);
if (r_hlsl_permutation != perm)
{
r_hlsl_permutation_t *perm = R_HLSL_FindPermutation(mode, permutation);
if (r_hlsl_permutation != perm)
for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
{
// reduce i more quickly whenever it would not remove any bits
for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
{
// reduce i more quickly whenever it would not remove any bits
- int j = 1<<(SHADERPERMUTATION_COUNT-1-i);
+ dpuint64 j = 1ll<<(SHADERPERMUTATION_COUNT-1-i);
if (!(permutation & j))
continue;
permutation -= j;
if (!(permutation & j))
continue;
permutation -= j;
-static void R_SetupShader_SetPermutationSoft(unsigned int mode, unsigned int permutation)
+static void R_SetupShader_SetPermutationSoft(unsigned int mode, dpuint64 permutation)
{
DPSOFTRAST_SetShader(mode, permutation, r_shadow_glossexact.integer);
DPSOFTRAST_UniformMatrix4fv(DPSOFTRAST_UNIFORM_ModelViewProjectionMatrixM1, 1, false, gl_modelviewprojection16f);
{
DPSOFTRAST_SetShader(mode, permutation, r_shadow_glossexact.integer);
DPSOFTRAST_UniformMatrix4fv(DPSOFTRAST_UNIFORM_ModelViewProjectionMatrixM1, 1, false, gl_modelviewprojection16f);
void R_SetupShader_Generic(rtexture_t *first, rtexture_t *second, int texturemode, int rgbscale, qboolean usegamma, qboolean notrippy, qboolean suppresstexalpha)
{
void R_SetupShader_Generic(rtexture_t *first, rtexture_t *second, int texturemode, int rgbscale, qboolean usegamma, qboolean notrippy, qboolean suppresstexalpha)
{
- unsigned int permutation = 0;
+ dpuint64 permutation = 0;
if (r_trippy.integer && !notrippy)
permutation |= SHADERPERMUTATION_TRIPPY;
permutation |= SHADERPERMUTATION_VIEWTINT;
if (r_trippy.integer && !notrippy)
permutation |= SHADERPERMUTATION_TRIPPY;
permutation |= SHADERPERMUTATION_VIEWTINT;
void R_SetupShader_DepthOrShadow(qboolean notrippy, qboolean depthrgb, qboolean skeletal)
{
void R_SetupShader_DepthOrShadow(qboolean notrippy, qboolean depthrgb, qboolean skeletal)
{
- unsigned int permutation = 0;
+ dpuint64 permutation = 0;
if (r_trippy.integer && !notrippy)
permutation |= SHADERPERMUTATION_TRIPPY;
if (depthrgb)
if (r_trippy.integer && !notrippy)
permutation |= SHADERPERMUTATION_TRIPPY;
if (depthrgb)
// combination of texture, entity, light source, and fogging, only use the
// minimum features necessary to avoid wasting rendering time in the
// fragment shader on features that are not being used
// combination of texture, entity, light source, and fogging, only use the
// minimum features necessary to avoid wasting rendering time in the
// fragment shader on features that are not being used
- unsigned int permutation = 0;
+ dpuint64 permutation = 0;
unsigned int mode = 0;
int blendfuncflags;
static float dummy_colormod[3] = {1, 1, 1};
unsigned int mode = 0;
int blendfuncflags;
static float dummy_colormod[3] = {1, 1, 1};
// combination of texture, entity, light source, and fogging, only use the
// minimum features necessary to avoid wasting rendering time in the
// fragment shader on features that are not being used
// combination of texture, entity, light source, and fogging, only use the
// minimum features necessary to avoid wasting rendering time in the
// fragment shader on features that are not being used
- unsigned int permutation = 0;
+ dpuint64 permutation = 0;
unsigned int mode = 0;
const float *lightcolorbase = rtlight->currentcolor;
float ambientscale = rtlight->ambientscale;
unsigned int mode = 0;
const float *lightcolorbase = rtlight->currentcolor;
float ambientscale = rtlight->ambientscale;
static void R_BlendView(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture)
{
static void R_BlendView(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture)
{
- unsigned int permutation;
float uservecs[4][4];
R_EntityMatrix(&identitymatrix);
float uservecs[4][4];
R_EntityMatrix(&identitymatrix);
+typedef long long dpint64;
+typedef unsigned long long dpuint64;
+
// LordHavoc: upgrade the prvm to double precision for better time values
// LordHavoc: to be enabled when bugs are worked out...
//#define PRVM_64
// LordHavoc: upgrade the prvm to double precision for better time values
// LordHavoc: to be enabled when bugs are worked out...
//#define PRVM_64