diff --git a/engine/client/image.c b/engine/client/image.c index 7a4b8d873..f90dafbb0 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -8446,6 +8446,66 @@ void Image_List_f(void) Con_Printf("%i images failed\n", failed); } +void Image_Formats_f(void) +{ + size_t i; + +#ifdef GLQUAKE + if (qrenderer == QR_OPENGL) + { + Con_Printf("OpenGL info:\n"); + Con_Printf("OpenGL Version: %s%g\n", gl_config.gles?"ES ":"", gl_config.glversion); + Con_Printf("OpenGLSL Version: %i\n", gl_config.maxglslversion); + Con_Printf("OpenGLSL Attributes: %u\n", gl_config.maxattribs); + + Con_Printf("arb_texture_env_combine: %u\n", gl_config.arb_texture_env_combine); + Con_Printf("arb_texture_env_dot3: %u\n", gl_config.arb_texture_env_dot3); + Con_Printf("arb_texture_compression: %u\n", gl_config.arb_texture_compression); + Con_Printf("geometryshaders: %u\n", gl_config.geometryshaders); + Con_Printf("ext_framebuffer_objects: %u\n", gl_config.ext_framebuffer_objects); + Con_Printf("arb_framebuffer_srgb: %u\n", gl_config.arb_framebuffer_srgb); + Con_Printf("arb_shader_objects: %u\n", gl_config.arb_shader_objects); + Con_Printf("arb_shadow: %u\n", gl_config.arb_shadow); + Con_Printf("arb_depth_texture: %u\n", gl_config.arb_depth_texture); + Con_Printf("ext_stencil_wrap: %u\n", gl_config.ext_stencil_wrap); + Con_Printf("ext_packed_depth_stencil: %u\n", gl_config.ext_packed_depth_stencil); + Con_Printf("arb_depth_clamp: %u\n", gl_config.arb_depth_clamp); + Con_Printf("ext_texture_filter_anisotropic: %u\n", gl_config.ext_texture_filter_anisotropic); + } +#endif + + Con_Printf( " Programs: "S_COLOR_GREEN"%s\n", sh_config.progs_supported?va(sh_config.progpath, "*"):S_COLOR_RED"Unsupported"); + if (sh_config.progs_supported) + { + Con_Printf( " Shader versions: %u - %u\n", sh_config.minver, sh_config.maxver); + Con_Printf( " Max GPU Bones: %s%u\n", sh_config.max_gpu_bones?S_COLOR_GREEN:S_COLOR_RED, sh_config.max_gpu_bones); + } + Con_Printf( " Legacy Pipeline: %s\n", sh_config.progs_required?S_COLOR_RED"Unsupported":S_COLOR_GREEN"Supported"); + if (!sh_config.progs_required) + { + Con_Printf( " Env_Combiners: %s\n", sh_config.nv_tex_env_combine4?S_COLOR_GREEN"Extended":sh_config.tex_env_combine?S_COLOR_GREEN"Supported":S_COLOR_RED"Unsupported"); + Con_Printf( " Env_Add: %s\n", sh_config.env_add?S_COLOR_GREEN"Supported":S_COLOR_RED"Unsupported"); + } + Con_Printf( " Max Texture2d Size: %s%u*%u\n", S_COLOR_GREEN, sh_config.texture2d_maxsize, sh_config.texture2d_maxsize); + Con_Printf( "Max Texture2d Layers: %s%u\n", sh_config.texture2darray_maxlayers?S_COLOR_GREEN:S_COLOR_RED, sh_config.texture2darray_maxlayers); + Con_Printf( " Max Texture3d Size: %s%u*%u*%u\n", sh_config.texture3d_maxsize?S_COLOR_GREEN:S_COLOR_RED, sh_config.texture3d_maxsize, sh_config.texture3d_maxsize, sh_config.texture3d_maxsize); + Con_Printf( "Max TextureCube Size: %s%u*%u\n", sh_config.havecubemaps?S_COLOR_GREEN:S_COLOR_RED, sh_config.texturecube_maxsize, sh_config.texturecube_maxsize); + Con_Printf( " Non-Power-Of-Two: %s%s\n", sh_config.texture_non_power_of_two?S_COLOR_GREEN"Supported":(sh_config.texture_non_power_of_two_pic?S_COLOR_YELLOW"Limited":S_COLOR_RED"Unsupported"), sh_config.npot_rounddown?" (rounded down)":""); + Con_Printf( " Block Size Padding: %s\n", sh_config.texture_allow_block_padding?S_COLOR_GREEN"Supported":S_COLOR_RED"Unsupported"); + Con_Printf( " Mipcap: %s\n", sh_config.can_mipcap?S_COLOR_GREEN"Supported":S_COLOR_RED"Unsupported"); + for (i = 0; i < PTI_MAX; i++) + { + switch(i) + { + case PTI_EMULATED: + continue; + default: + break; + } + Con_Printf("%20s: %s\n", Image_FormatName(i), sh_config.texfmt[i]?S_COLOR_GREEN"Enabled":S_COLOR_RED"Disabled"); + } +} + //may not create any images yet. void Image_Init(void) { @@ -8454,6 +8514,7 @@ void Image_Init(void) Hash_InitTable(&imagetable, sizeof(imagetablebuckets)/sizeof(imagetablebuckets[0]), imagetablebuckets); Cmd_AddCommandD("r_imagelist", Image_List_f, "Prints out a list of the currently-known textures."); + Cmd_AddCommandD("r_imageformats", Image_Formats_f, "Prints out a list of the usable texture formats."); } //destroys all textures void Image_Shutdown(void) diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 308ac3d06..20fd1efde 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -2088,7 +2088,7 @@ static int QDECL R_SortRenderers(const void *av, const void *bv) void R_RestartRenderer (rendererstate_t *newr) { -#ifndef CLIENTONLY +#if !defined(CLIENTONLY) && (defined(Q2BSPS) || defined(Q3BSPS)) void *portalblob = NULL; size_t portalsize = 0; #endif diff --git a/engine/d3d/d3d_backend.c b/engine/d3d/d3d_backend.c index b98bab43c..e5175c4c5 100644 --- a/engine/d3d/d3d_backend.c +++ b/engine/d3d/d3d_backend.c @@ -2070,7 +2070,8 @@ static void BE_ApplyUniforms(program_t *prog, struct programpermu_s *perm) IDirect3DDevice9_SetPixelShaderConstantF(pD3DDev9, h, r_refdef.userdata[0], countof(r_refdef.userdata)); break; - case SP_M_ENTBONES: + case SP_M_ENTBONES_MAT3X4: + case SP_M_ENTBONES_PACKED: case SP_E_VLSCALE: case SP_E_ORIGIN: case SP_E_GLOWMOD: diff --git a/engine/gl/gl_backend.c b/engine/gl/gl_backend.c index 592994a9d..c8224906a 100644 --- a/engine/gl/gl_backend.c +++ b/engine/gl/gl_backend.c @@ -4275,7 +4275,7 @@ static void BE_LegacyLighting(void) } } - if (TEXLOADED(shaderstate.curtexnums->bump) && gl_config.arb_texture_cube_map && gl_config.arb_texture_env_dot3 && gl_config.arb_texture_env_combine && be_maxpasses >= 4) + if (TEXLOADED(shaderstate.curtexnums->bump) && sh_config.havecubemaps && gl_config.arb_texture_env_dot3 && gl_config.arb_texture_env_combine && be_maxpasses >= 4) { //we could get this down to 2 tmus by arranging for the dot3 result to be written the alpha buffer. But then we'd need to have an alpha buffer too. if (!shaderstate.normalisationcubemap) diff --git a/engine/gl/gl_draw.c b/engine/gl/gl_draw.c index 1a53d7957..59a241d10 100644 --- a/engine/gl/gl_draw.c +++ b/engine/gl/gl_draw.c @@ -115,7 +115,7 @@ void GL_SetupFormats(void) // tc_srgba1 = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; bc1 |= GL_CheckExtension("GL_EXT_texture_compression_dxt1"); - bc2 |= GL_CheckExtension("GL_ANGLE_texture_compression_dxt3"); + bc2 |= GL_CheckExtension("GL_ANGLE_texture_compression_dxt3"); //WARNING: can only use these if mip0 is a multiple of 4 bc3 |= GL_CheckExtension("GL_ANGLE_texture_compression_dxt5"); /*else if (sh_config.texfmt[PTI_ETC2_RGB8A8]) diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index 862a9c249..d696d5bf7 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -5050,14 +5050,14 @@ done:; if (!s->sort) { - if (pass->shaderbits & SBITS_ATEST_BITS) + if (i < s->numpasses && (s->passes[i].shaderbits & SBITS_ATEST_BITS)) s->sort = SHADER_SORT_SEETHROUGH; } if (!( s->flags & SHADER_DEPTHWRITE) && !(s->flags & SHADER_SKY)) { - pass->shaderbits |= SBITS_MISC_DEPTHWRITE; + s->passes->shaderbits |= SBITS_MISC_DEPTHWRITE; s->flags |= SHADER_DEPTHWRITE; } } diff --git a/engine/gl/gl_vidcommon.c b/engine/gl/gl_vidcommon.c index 19d8e0732..22dd62dff 100644 --- a/engine/gl/gl_vidcommon.c +++ b/engine/gl/gl_vidcommon.c @@ -845,10 +845,21 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name)) qglPNTrianglesfATI = (void *)getglext("glPNTrianglesfATI"); qglPNTrianglesiATI = (void *)getglext("glPNTrianglesiATI"); } - if (!gl_config.gles && gl_config.glversion >= 4.0) + if ((!gl_config.gles && gl_config.glversion >= 4.0) || (gl_config.gles && gl_config.glversion >= 3.2)) + { + gl_config.arb_tessellation_shader = true; qglPatchParameteriARB = getglext("glPatchParameteri"); + } else if (GL_CheckExtension("GL_ARB_tessellation_shader")) + { + gl_config.arb_tessellation_shader = true; qglPatchParameteriARB = getglext("glPatchParameteriARB"); + } + else if (GL_CheckExtension("GL_OES_tessellation_shader")) + { + gl_config.arb_tessellation_shader = true; + qglPatchParameteriARB = getglext("glPatchParameteriOES"); + } else qglPatchParameteriARB = NULL; @@ -880,8 +891,6 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name)) gl_config.arb_texture_env_combine = GL_CheckExtension("GL_ARB_texture_env_combine"); gl_config.arb_texture_env_dot3 = GL_CheckExtension("GL_ARB_texture_env_dot3"); - gl_config.arb_texture_cube_map = GL_CheckExtension("GL_ARB_texture_cube_map"); - qglBufferStorage = NULL; #if !defined(GL_STATIC) /*vbos, were made core in gl1.5 or gles2.0*/ @@ -1139,10 +1148,10 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name)) if (GL_CheckExtension("GL_ARB_seamless_cube_map")) qglEnable(0x884F); //TEXTURE_CUBE_MAP_SEAMLESS 0x884F - if (!gl_config.gles && gl_config.glversion >= 3.2) - gl_config.geometryshaders = true; + if (gl_config.gles) + gl_config.geometryshaders = (gl_config.glversion >= 3.2) || GL_CheckExtension("GL_OES_geometry_shader"); else - gl_config.geometryshaders = false; + gl_config.geometryshaders = (gl_config.glversion >= 3.2); qglTexStorage2D = NULL; qglTexStorage3D = NULL; @@ -2378,9 +2387,9 @@ static GLhandleARB GLSlang_FinishShader(GLhandleARB shader, const char *name, GL eol = strchr(start, '\n'); if (eol) *eol=0; -// if (filename) -// Con_Printf("%s:%u:%u: %s\n", filename, line, rawline, start); -// else + if (filename) + Con_Printf("%s:%u:%u: %s\n", filename, line, rawline, start); + else Con_Printf("%u:%u:%u: %s\n", filenum, line, rawline, start); if (!strncmp(start, "#line ", 6)) { @@ -2537,7 +2546,7 @@ union programhandle_u GLSlang_CreateProgram(program_t *prog, const char *name, i if (!gl_config.arb_shader_objects) return ret; - if ((cont || eval) && !qglPatchParameteriARB) + if ((cont || eval) && !gl_config.arb_tessellation_shader) { Con_Printf("GLSlang_CreateProgram: %s requires tesselation support, but your gl drivers do not appear to support this (gl4.0 feature)\n", name); return ret; @@ -3320,7 +3329,7 @@ qboolean GL_Init(rendererstate_t *info, void *(*getglfunction) (char *name)) { sh_config.can_mipcap = gl_config.glversion >= 1.2; - sh_config.havecubemaps = gl_config.glversion >= 1.3; //cubemaps AND clamp-to-edge. + sh_config.havecubemaps = gl_config.glversion >= 1.3||GL_CheckExtension("GL_ARB_texture_cube_map");; //cubemaps AND clamp-to-edge. if (gl_config.nofixedfunc) { //core contexts don't normally support glsl < 140 (such glsl versions have lots of compat syntax still, which will not function on core. drivers might accept it anyway, but yeah, lots of crap that shouldn't work) @@ -3347,6 +3356,10 @@ qboolean GL_Init(rendererstate_t *info, void *(*getglfunction) (char *name)) sh_config.texturecube_maxsize = 0; if (sh_config.havecubemaps) qglGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB, &sh_config.texturecube_maxsize); + if (!gl_config_gles || gl_config.glversion >= 3) + qglGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &sh_config.texture3d_maxsize); + if (gl_config.glversion >= 3) + qglGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &sh_config.texture2darray_maxlayers); sh_config.progs_supported = gl_config.arb_shader_objects; sh_config.progs_required = gl_config_nofixedfunc; diff --git a/engine/gl/glquake.h b/engine/gl/glquake.h index 9e12e33d5..9caf476c5 100644 --- a/engine/gl/glquake.h +++ b/engine/gl/glquake.h @@ -229,15 +229,15 @@ typedef struct { qboolean nv_tex_env_combine4; qboolean env_add; - qboolean sgis_generate_mipmap; +// qboolean sgis_generate_mipmap; qboolean arb_texture_env_combine; qboolean arb_texture_env_dot3; - qboolean arb_texture_cube_map; qboolean arb_texture_compression; //means we support dynamic compression, rather than any specific compressed texture formats qboolean geometryshaders; + qboolean arb_tessellation_shader; qboolean ext_framebuffer_objects; qboolean arb_framebuffer_srgb; diff --git a/engine/gl/shader.h b/engine/gl/shader.h index db84ddcb1..4ca644326 100644 --- a/engine/gl/shader.h +++ b/engine/gl/shader.h @@ -781,6 +781,8 @@ typedef struct qboolean texfmt[PTI_MAX]; //which texture formats are supported (renderable not implied) unsigned int texture2d_maxsize; //max size of a 2d texture + unsigned int texture3d_maxsize; //max size of a 3d texture + unsigned int texture2darray_maxlayers; //max layers of a 2darray texture unsigned int texturecube_maxsize; qboolean texture_non_power_of_two; //full support for npot qboolean texture_non_power_of_two_pic; //npot only works with clamp-to-edge mipless images. diff --git a/engine/server/world.c b/engine/server/world.c index dfd644886..c53bdea56 100644 --- a/engine/server/world.c +++ b/engine/server/world.c @@ -2178,9 +2178,9 @@ static void World_ClipToLinks (world_t *w, areanode_t *node, moveclip_t *clip) } if ((int)touch->v->flags & FL_MONSTER) - trace = World_ClipMoveToEntity (w, touch, touch->v->origin, clip->start, clip->mins2, clip->maxs2, clip->end, clip->hullnum, clip->type & MOVE_HITMODEL, clip->capsule, clip->hitcontentsmask); + trace = World_ClipMoveToEntity (w, touch, touch->v->origin, touch->v->angles, clip->start, clip->mins2, clip->maxs2, clip->end, clip->hullnum, clip->type & MOVE_HITMODEL, clip->capsule, clip->hitcontentsmask); else - trace = World_ClipMoveToEntity (w, touch, touch->v->origin, clip->start, clip->mins, clip->maxs, clip->end, clip->hullnum, clip->type & MOVE_HITMODEL, clip->capsule, clip->hitcontentsmask); + trace = World_ClipMoveToEntity (w, touch, touch->v->origin, touch->v->angles, clip->start, clip->mins, clip->maxs, clip->end, clip->hullnum, clip->type & MOVE_HITMODEL, clip->capsule, clip->hitcontentsmask); if (trace.fraction < clip->trace.fraction) {