}
DPSOFTRAST_TEXTURE_FILTER;
+#ifdef HAVE_DPSOFTRAST
int DPSOFTRAST_Init(int width, int height, int numthreads, int interlace, unsigned int *colorpixels, unsigned int *depthpixels);
void DPSOFTRAST_Shutdown(void);
void DPSOFTRAST_Flush(void);
void DPSOFTRAST_SetColorPointer(const float *color4f, size_t stride);
void DPSOFTRAST_SetColorPointer4ub(const unsigned char *color4ub, size_t stride);
void DPSOFTRAST_SetTexCoordPointer(int unitnum, int numcomponents, size_t stride, const float *texcoordf);
+#endif
typedef enum gl20_texunit_e
{
}
DPSOFTRAST_UNIFORM;
+#ifdef HAVE_DPSOFTRAST
void DPSOFTRAST_SetShader(int mode, int 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)
void DPSOFTRAST_Uniform1i(DPSOFTRAST_UNIFORM index, int i0);
void DPSOFTRAST_DrawTriangles(int firstvertex, int numvertices, int numtriangles, const int *element3i, const unsigned short *element3s);
+#endif
#endif // DPSOFTRAST_H
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_Finish();
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_Viewport(v->x, v->y, v->width, v->height);
+#endif
break;
case RENDERPATH_GL20:
case RENDERPATH_GLES2:
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
if (fbo)
{
int width, height;
}
else
DPSOFTRAST_SetRenderTargets(vid.width, vid.height, vid.softdepthpixels, vid.softpixels, NULL, NULL, NULL);
+#endif
break;
}
}
#endif
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_ColorMask(1,1,1,1);
DPSOFTRAST_BlendFunc(gl_state.blendfunc1, gl_state.blendfunc2);
DPSOFTRAST_CullFace(gl_state.cullface);
DPSOFTRAST_PolygonOffset(gl_state.polygonoffset[0], gl_state.polygonoffset[1]);
DPSOFTRAST_SetRenderTargets(vid.width, vid.height, vid.softdepthpixels, vid.softpixels, NULL, NULL, NULL);
DPSOFTRAST_Viewport(0, 0, vid.width, vid.height);
+#endif
break;
case RENDERPATH_GL20:
case RENDERPATH_GLES2:
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_BlendFunc(gl_state.blendfunc1, gl_state.blendfunc2);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_DepthMask(gl_state.depthmask);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_DepthTest(gl_state.depthtest);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_DepthFunc(gl_state.depthfunc);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_DepthRange(gl_state.depthrange[0], gl_state.depthrange[1]);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_PolygonOffset(gl_state.polygonoffset[0], gl_state.polygonoffset[1]);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_CullFace(gl_state.cullface);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
if (gl_state.cullface != state)
{
gl_state.cullface = state;
gl_state.cullfaceenable = state != GL_NONE ? true : false;
DPSOFTRAST_CullFace(gl_state.cullface);
}
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_ColorMask(r, g, b, a);
+#endif
break;
}
}
// no equivalent in D3D
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_Color4f(cr, cg, cb, ca);
+#endif
break;
case RENDERPATH_GL20:
case RENDERPATH_GLES2:
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_Scissor(x, y, width, height);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_ScissorTest(gl_state.scissortest);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
if (mask & GL_COLOR_BUFFER_BIT)
DPSOFTRAST_ClearColor(colorvalue[0], colorvalue[1], colorvalue[2], colorvalue[3]);
if (mask & GL_DEPTH_BUFFER_BIT)
DPSOFTRAST_ClearDepth(depthvalue);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_GetPixelsBGRA(x, y, width, height, outpixels);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_DrawTriangles(firstvertex, numvertices, numtriangles, element3i, element3s);
+#endif
break;
case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_CopyRectangleToTexture(tex->texnum, 0, tx, ty, sx, sy, width, height);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
if (!tex)
{
tex = r_texture_white;
return;
unit->texture = tex;
DPSOFTRAST_SetTexture(unitnum, texnum);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_SetVertexPointer(vertex3f, sizeof(float[3]));
DPSOFTRAST_SetColorPointer(NULL, 0);
DPSOFTRAST_SetTexCoordPointer(0, 2, sizeof(float[2]), NULL);
DPSOFTRAST_SetTexCoordPointer(2, 2, sizeof(float[2]), NULL);
DPSOFTRAST_SetTexCoordPointer(3, 2, sizeof(float[2]), NULL);
DPSOFTRAST_SetTexCoordPointer(4, 2, sizeof(float[2]), NULL);
+#endif
break;
}
}
case RENDERPATH_D3D11:
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_SetVertexPointer(vertex3f, sizeof(float[3]));
DPSOFTRAST_SetColorPointer(color4f, sizeof(float[4]));
DPSOFTRAST_SetTexCoordPointer(0, 2, sizeof(float[2]), texcoord2f);
DPSOFTRAST_SetTexCoordPointer(2, 2, sizeof(float[2]), NULL);
DPSOFTRAST_SetTexCoordPointer(3, 2, sizeof(float[2]), NULL);
DPSOFTRAST_SetTexCoordPointer(4, 2, sizeof(float[2]), NULL);
+#endif
return;
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_SetVertexPointer(vertex->vertex3f, sizeof(*vertex));
DPSOFTRAST_SetColorPointer(vertex->color4f, sizeof(*vertex));
DPSOFTRAST_SetTexCoordPointer(0, 2, sizeof(*vertex), vertex->texcoord2f);
DPSOFTRAST_SetTexCoordPointer(2, 2, sizeof(*vertex), NULL);
DPSOFTRAST_SetTexCoordPointer(3, 2, sizeof(*vertex), NULL);
DPSOFTRAST_SetTexCoordPointer(4, 2, sizeof(*vertex), NULL);
+#endif
break;
}
}
case RENDERPATH_D3D11:
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_SetVertexPointer(vertex3f, sizeof(float[3]));
DPSOFTRAST_SetColorPointer(color4f, sizeof(float[4]));
DPSOFTRAST_SetTexCoordPointer(0, 2, sizeof(float[2]), texcoordtexture2f);
DPSOFTRAST_SetTexCoordPointer(2, 3, sizeof(float[3]), tvector3f);
DPSOFTRAST_SetTexCoordPointer(3, 3, sizeof(float[3]), normal3f);
DPSOFTRAST_SetTexCoordPointer(4, 2, sizeof(float[2]), texcoordlightmap2f);
+#endif
return;
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_SetVertexPointer(vertex->vertex3f, sizeof(*vertex));
DPSOFTRAST_SetColorPointer(vertex->color4f, sizeof(*vertex));
DPSOFTRAST_SetTexCoordPointer(0, 2, sizeof(*vertex), vertex->texcoordtexture2f);
DPSOFTRAST_SetTexCoordPointer(2, 3, sizeof(*vertex), vertex->tvector3f);
DPSOFTRAST_SetTexCoordPointer(3, 3, sizeof(*vertex), vertex->normal3f);
DPSOFTRAST_SetTexCoordPointer(4, 2, sizeof(*vertex), vertex->texcoordlightmap2f);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_BlendSubtract(true);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_BlendSubtract(false);
+#endif
break;
}
}
}
#endif
+#ifdef HAVE_DPSOFTRAST
static void R_SetupShader_SetPermutationSoft(unsigned int mode, unsigned int permutation)
{
DPSOFTRAST_SetShader(mode, permutation, r_shadow_glossexact.integer);
DPSOFTRAST_UniformMatrix4fv(DPSOFTRAST_UNIFORM_ModelViewMatrixM1, 1, false, gl_modelview16f);
DPSOFTRAST_Uniform1f(DPSOFTRAST_UNIFORM_ClientTime, cl.time);
}
+#endif
void R_GLSL_Restart_f(void)
{
R_Mesh_TexMatrix(0, NULL);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
R_SetupShader_SetPermutationSoft(SHADERMODE_GENERIC, permutation);
R_Mesh_TexBind(GL20TU_FIRST , first );
R_Mesh_TexBind(GL20TU_SECOND, second);
+#endif
break;
}
}
R_Mesh_TexBind(0, 0);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
R_SetupShader_SetPermutationSoft(SHADERMODE_DEPTH_OR_SHADOW, permutation);
+#endif
break;
}
}
case RENDERPATH_GLES1:
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
RSurf_PrepareVerticesForBatch(BATCHNEED_ARRAY_VERTEX | BATCHNEED_ARRAY_NORMAL | BATCHNEED_ARRAY_VECTOR | (rsurface.modellightmapcolor4f ? BATCHNEED_ARRAY_VERTEXCOLOR : 0) | BATCHNEED_ARRAY_TEXCOORD | (rsurface.uselightmaptexture ? BATCHNEED_ARRAY_LIGHTMAP : 0) | BATCHNEED_ALLOWMULTIDRAW, texturenumsurfaces, texturesurfacelist);
R_Mesh_PrepareVertices_Mesh_Arrays(rsurface.batchnumvertices, rsurface.batchvertex3f, rsurface.batchsvector3f, rsurface.batchtvector3f, rsurface.batchnormal3f, rsurface.batchlightmapcolor4f, rsurface.batchtexcoordtexture2f, rsurface.batchtexcoordlightmap2f);
R_SetupShader_SetPermutationSoft(mode, permutation);
if (permutation & SHADERPERMUTATION_SHADOWMAPVSDCT ) R_Mesh_TexBind(GL20TU_CUBEPROJECTION , r_shadow_shadowmapvsdcttexture );
}
}
+#endif
break;
}
}
case RENDERPATH_GLES1:
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
R_SetupShader_SetPermutationGLSL(mode, permutation);
DPSOFTRAST_Uniform3f( DPSOFTRAST_UNIFORM_LightPosition , viewlightorigin[0], viewlightorigin[1], viewlightorigin[2]);
DPSOFTRAST_UniformMatrix4fv(DPSOFTRAST_UNIFORM_ViewToLightM1 , 1, false, viewtolight16f);
R_Mesh_TexBind(GL20TU_CUBE , rsurface.rtlight->currentcubemap );
R_Mesh_TexBind(GL20TU_SHADOWMAP2D , r_shadow_shadowmap2ddepthtexture );
R_Mesh_TexBind(GL20TU_CUBEPROJECTION , r_shadow_shadowmapvsdcttexture );
+#endif
break;
}
}
R_Viewport_InitPerspective(&r_refdef.view.viewport, &r_refdef.view.matrix, r_refdef.view.x, rtheight - scaledheight - r_refdef.view.y, scaledwidth, scaledheight, r_refdef.view.frustum_x, r_refdef.view.frustum_y, r_refdef.nearclip, r_refdef.farclip, customclipplane);
R_Mesh_SetRenderTargets(fbo, depthtexture, colortexture, NULL, NULL, NULL);
R_SetViewport(&r_refdef.view.viewport);
+
+#ifdef HAVE_DPSOFTRAST
if (r_refdef.view.useclipplane && allowwaterclippingplane && vid.renderpath == RENDERPATH_SOFT)
{
matrix4x4_t mvpmatrix, invmvpmatrix, invtransmvpmatrix;
Matrix4x4_Transform4(&invtransmvpmatrix, plane, screenplane);
DPSOFTRAST_ClipPlane(screenplane[0], screenplane[1], screenplane[2], screenplane[3]);
}
+#endif
}
void R_EntityMatrix(const matrix4x4_t *matrix)
qglLoadMatrixf(gl_modelview16f);CHECKGLERROR
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_UniformMatrix4fv(DPSOFTRAST_UNIFORM_ModelViewProjectionMatrixM1, 1, false, gl_modelviewprojection16f);
DPSOFTRAST_UniformMatrix4fv(DPSOFTRAST_UNIFORM_ModelViewMatrixM1, 1, false, gl_modelview16f);
+#endif
break;
case RENDERPATH_GL20:
case RENDERPATH_GLES2:
}
}
+#ifdef HAVE_DPSOFTRAST
if(vid.renderpath==RENDERPATH_SOFT) DPSOFTRAST_ClipPlane(0, 0, 0, 1);
+#endif
r_fb.water.renderingscene = false;
r_refdef.view = originalview;
R_ResetViewRendering3D(fbo, depthtexture, colortexture);
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
R_Mesh_PrepareVertices_Mesh_Arrays(4, r_screenvertex3f, NULL, NULL, NULL, NULL, r_fb.screentexcoord2f, r_fb.bloomtexcoord2f);
R_SetupShader_SetPermutationSoft(SHADERMODE_POSTPROCESS, permutation);
R_Mesh_TexBind(GL20TU_FIRST , r_fb.colortexture);
DPSOFTRAST_Uniform1f(DPSOFTRAST_UNIFORM_Saturation , r_glsl_saturation.value);
DPSOFTRAST_Uniform2f(DPSOFTRAST_UNIFORM_PixelToScreenTexCoord, 1.0f/vid.width, 1.0f/vid.height);
DPSOFTRAST_Uniform4f(DPSOFTRAST_UNIFORM_BloomColorSubtract , r_bloom_colorsubtract.value, r_bloom_colorsubtract.value, r_bloom_colorsubtract.value, 0.0f);
+#endif
break;
default:
break;
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
if (glt->texnum)
DPSOFTRAST_Texture_Free(glt->texnum);
+#endif
break;
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
// change all the existing texture objects
for (pool = gltexturepoolchain;pool;pool = pool->next)
for (glt = pool->gltchain;glt;glt = glt->chain)
if (glt->texnum && (gl_filter_force || !(glt->flags & (TEXF_FORCENEAREST | TEXF_FORCELINEAR))))
DPSOFTRAST_Texture_Filter(glt->texnum, (glt->flags & TEXF_MIPMAP) ? dpsoftrast_filter_mipmap : dpsoftrast_filter_nomipmap);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_Texture_UpdatePartial(glt->texnum, 0, data, fragx, fragy, fragwidth, fragheight);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
switch(glt->texturetype)
{
case GLTEXTURETYPE_2D:
DPSOFTRAST_Texture_Filter(glt->texnum, dpsoftrast_filter_mipmap);
else
DPSOFTRAST_Texture_Filter(glt->texnum, dpsoftrast_filter_nomipmap);
+#endif
break;
}
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
{
int tflags = 0;
switch(textype)
if (glt->flags & TEXF_CLAMP) tflags |= DPSOFTRAST_TEXTURE_FLAG_CLAMPTOEDGE;
glt->texnum = DPSOFTRAST_Texture_New(tflags, glt->tilewidth, glt->tileheight, glt->tiledepth);
}
+#endif
break;
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
{
int tflags = 0;
switch(textype)
}
glt->texnum = DPSOFTRAST_Texture_New(tflags, glt->tilewidth, glt->tileheight, glt->tiledepth);
}
+#endif
break;
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
glt->texnum = DPSOFTRAST_Texture_New(((glt->flags & TEXF_CLAMP) ? DPSOFTRAST_TEXTURE_FLAG_CLAMPTOEDGE : 0) | (dds_miplevels > 1 ? DPSOFTRAST_TEXTURE_FLAG_MIPMAP : 0), glt->tilewidth, glt->tileheight, glt->tiledepth);
+#endif
break;
}
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
if (bytesperblock)
Con_DPrintf("FIXME SOFT %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
else
DPSOFTRAST_Texture_UpdateFull(glt->texnum, upload_mippixels);
// DPSOFTRAST calculates its own mipmaps
mip = dds_miplevels;
+#endif
break;
}
if(upload_mippixels != mippixels)
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
if (glt->flags & TEXF_FORCELINEAR)
DPSOFTRAST_Texture_Filter(glt->texnum, DPSOFTRAST_TEXTURE_FILTER_LINEAR);
else if (glt->flags & TEXF_FORCENEAREST)
DPSOFTRAST_Texture_Filter(glt->texnum, dpsoftrast_filter_mipmap);
else
DPSOFTRAST_Texture_Filter(glt->texnum, dpsoftrast_filter_nomipmap);
+#endif
break;
}
CMD_RM=$(CMD_UNIXRM)
endif
+# CPU-specifics
+OBJ_CPU =
+
+ifeq ($(DP_MAKE_TARGET),mingw)
+ # MinGW is always x86
+ OBJ_CPU += $(OBJ_X86)
+else
+ifneq (,$(filter i%86 x86_64,$(DP_MACHINE)))
+ OBJ_CPU += $(OBJ_X86)
+endif
+endif
+
# 64bits AMD CPUs use another lib directory
ifeq ($(DP_MACHINE),x86_64)
UNIX_X11LIBPATH:=/usr/X11R6/lib64
csprogs.o \
curves.o \
cvar.o \
- dpsoftrast.o \
dpvsimpledecode.o \
filematch.o \
fractalnoise.o \
mdfour.o \
menu.o \
meshqueue.o \
- mod_skeletal_animatevertices_sse.o \
mod_skeletal_animatevertices_generic.o \
model_alias.o \
model_brush.o \
world.o \
zone.o
+OBJ_X86 = \
+ dpsoftrast.o \
+ mod_skeletal_animatevertices_sse.o
+
# note that builddate.c is very intentionally not compiled to a .o before
# being linked, because it should be recompiled every time an executable is
# built to give the executable a proper date string
-OBJ_SV= builddate.c sys_linux.o vid_null.o thread_null.o $(OBJ_SND_NULL) $(OBJ_NOCD) $(OBJ_COMMON)
-OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_SND_COMMON) snd_sdl.o cd_sdl.o $(OBJ_COMMON)
+OBJ_SV= builddate.c sys_linux.o vid_null.o thread_null.o $(OBJ_SND_NULL) $(OBJ_NOCD) $(OBJ_COMMON) $(OBJ_CPU)
+OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_SND_COMMON) snd_sdl.o cd_sdl.o $(OBJ_COMMON) $(OBJ_CPU)
# Compilation
##### UNIX specific variables #####
-OBJ_GLX= builddate.c sys_linux.o vid_glx.o thread_pthread.o keysym2ucs.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
+OBJ_GLX= builddate.c sys_linux.o vid_glx.o thread_pthread.o keysym2ucs.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON) $(OBJ_CPU)
LDFLAGS_UNIXCOMMON=\
-lm \
LDFLAGS_MACOSXSV=$(LDFLAGS_UNIXCOMMON) -ldl
LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit $(SDLCONFIG_STATICLIBS) SDLMain.m
-OBJ_AGL= builddate.c sys_linux.o vid_agl.o thread_null.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
+OBJ_AGL= builddate.c sys_linux.o vid_agl.o thread_null.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON) $(OBJ_CPU)
EXE_MACOSXCL=darkplaces-agl
EXE_MACOSXCLNEXUIZ=nexuiz-agl
#if you want no CD audio
#OBJ_WINCD=$(OBJ_NOCD)
-OBJ_WGL= builddate.c sys_win.o vid_wgl.o thread_null.o $(OBJ_SND_WIN) $(OBJ_WINCD) $(OBJ_COMMON)
+OBJ_WGL= builddate.c sys_win.o vid_wgl.o thread_null.o $(OBJ_SND_WIN) $(OBJ_WINCD) $(OBJ_COMMON) $(OBJ_CPU)
# Link
# see LDFLAGS_WINCOMMON in makefile
#include "palette.h"
+#ifdef SSE_POSSIBLE
+/* The software rasterizer requires SSE */
+# define HAVE_DPSOFTRAST
+#endif
+
/// incremented every frame, never reset
extern int host_framecount;
/// not bounded in any way, changed at start of every frame, never reset
else
Con_DPrintf("Updating to ConfigureNotify resolution %dx%d\n", vid.width, vid.height);
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_Flush();
+#endif
if(vid.softdepthpixels)
free(vid.softdepthpixels);
switch(vid.renderpath)
{
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
if(vidx11_shmevent >= 0) {
vidx11_ximage_pos = !vidx11_ximage_pos;
vid.softpixels = (unsigned int *) vidx11_ximage[vidx11_ximage_pos]->data;
DPSOFTRAST_Finish();
XPutImage(vidx11_display, win, vidx11_gc, vidx11_ximage[vidx11_ximage_pos], 0, 0, 0, 0, vid.width, vid.height);
}
+#endif
break;
case RENDERPATH_GL11:
*attrib++ = None;
}
+#ifdef HAVE_DPSOFTRAST
static qboolean VID_InitModeSoft(viddef_mode_t *mode)
{
int i, j;
return true;
}
+#endif
static qboolean VID_InitModeGL(viddef_mode_t *mode)
{
qboolean VID_InitMode(viddef_mode_t *mode)
{
-#ifdef SSE_POSSIBLE
+#ifdef HAVE_DPSOFTRAST
if (vid_soft.integer)
return VID_InitModeSoft(mode);
else
extern cvar_t gl_info_platform;
extern cvar_t gl_info_driver;
+#ifdef HAVE_DPSOFTRAST
static qboolean VID_InitModeSoft(viddef_mode_t *mode)
{
#if SDL_MAJOR_VERSION == 1
#endif
return true;
}
+#endif
qboolean VID_InitMode(viddef_mode_t *mode)
{
if (!SDL_WasInit(SDL_INIT_VIDEO) && SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
Sys_Error ("Failed to init SDL video subsystem: %s", SDL_GetError());
-#ifdef SSE_POSSIBLE
+#ifdef HAVE_DPSOFTRAST
if (vid_soft.integer)
return VID_InitModeSoft(mode);
else
#endif
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_Finish();
#if SDL_MAJOR_VERSION == 1
// if (!r_test.integer)
SDL_BlitSurface(vid_softsurface, NULL, screen, NULL);
SDL_UpdateWindowSurface(window);
}
+#endif
#endif
break;
case RENDERPATH_D3D9:
void VID_Shared_Init(void)
{
-#ifdef SSE_POSSIBLE
+#ifdef HAVE_DPSOFTRAST
if (Sys_HaveSSE2())
{
Con_Printf("DPSOFTRAST available (SSE2 instructions detected)\n");
return count;
}
+#ifdef HAVE_DPSOFTRAST
void VID_Soft_SharedSetup(void)
{
gl_platform = "DPSOFTRAST";
// clear to black (loading plaque will be seen over this)
GL_Clear(GL_COLOR_BUFFER_BIT, NULL, 1.0f, 128);
}
+#endif
case RENDERPATH_D3D11:
break;
case RENDERPATH_SOFT:
+#ifdef HAVE_DPSOFTRAST
DPSOFTRAST_Finish();
// baseDC = GetDC(mainwindow);
BitBlt(baseDC, 0, 0, vid.width, vid.height, vid_softhdc, 0, 0, SRCCOPY);
// ReleaseDC(mainwindow, baseDC);
// baseDC = NULL;
+#endif
break;
}
}
}
#endif
+#ifdef HAVE_DPSOFTRAST
qboolean VID_InitModeSOFT(viddef_mode_t *mode)
{
int i;
return true;
}
+#endif
qboolean VID_InitMode(viddef_mode_t *mode)
{
-#ifdef SSE_POSSIBLE
+#ifdef HAVE_DPSOFTRAST
if (vid_soft.integer)
return VID_InitModeSOFT(mode);
#endif