Subversion Repositories eduke32

Rev

Rev 8614 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8614 Rev 8710
Line 264... Line 264...
264
    "Unknown",  // renderer
264
    "Unknown",  // renderer
265
    "0.0.0",    // version
265
    "0.0.0",    // version
266
    "",         // extensions
266
    "",         // extensions
267
267
268
    1.0,        // max anisotropy
268
    1.0,        // max anisotropy
269
    0,          // brga texture format
269
    0,          // structure filled
270
    0,          // clamp-to-edge support
-
 
271
    0,          // texture compression
-
 
272
    0,          // non-power-of-two textures
-
 
273
    0,          // ARBfp
-
 
274
    0,          // depth textures
-
 
275
    0,          // shadow comparison
-
 
276
    0,          // Frame Buffer Objects
-
 
277
    0,          // rectangle textures
-
 
278
    0,          // multitexturing
270
    0,          // supported extensions
279
    0,          // env_combine
-
 
280
    0,          // Vertex Buffer Objects
-
 
281
    0,          // VSync support
-
 
282
    0,          // Shader Model 4 support
-
 
283
    0,          // Occlusion Queries
-
 
284
    0,          // GLSL
-
 
285
    0,          // Debug Output
-
 
286
    0,          // Buffer storage
-
 
287
    0,          // Sync
-
 
288
    0,          // Depth Clamp
-
 
289
    0,          // Clip Control
-
 
290
    0,          // GL info dumped
-
 
291
};
271
};
292
272
-
 
273
void fill_glinfo(void)
-
 
274
{
-
 
275
    glinfo.extensions = (const char *)glGetString(GL_EXTENSIONS);
-
 
276
    glinfo.renderer   = (const char *)glGetString(GL_RENDERER);
-
 
277
    glinfo.vendor     = (const char *)glGetString(GL_VENDOR);
-
 
278
    glinfo.version    = (const char *)glGetString(GL_VERSION);
-
 
279
-
 
280
#ifdef POLYMER
-
 
281
    if (!Bstrcmp(glinfo.vendor, "ATI Technologies Inc."))
-
 
282
    {
-
 
283
        pr_ati_fboworkaround = 1;
-
 
284
        initprintf("Enabling ATI FBO color attachment workaround.\n");
-
 
285
-
 
286
        if (Bstrstr(glinfo.renderer, "Radeon X1"))
-
 
287
        {
-
 
288
            pr_ati_nodepthoffset = 1;
-
 
289
            initprintf("Enabling ATI R520 polygon offset workaround.\n");
-
 
290
        }
-
 
291
# ifdef __APPLE__
-
 
292
        // See bug description at http://lists.apple.com/archives/mac-opengl/2005/Oct/msg00169.html
-
 
293
        if (!Bstrncmp(glinfo.renderer, "ATI Radeon 9600", 15))
-
 
294
        {
-
 
295
            pr_ati_textureformat_one = 1;
-
 
296
            initprintf("Enabling ATI Radeon 9600 texture format workaround.\n");
-
 
297
        }
-
 
298
# endif
-
 
299
    }
-
 
300
#endif  // defined POLYMER
-
 
301
-
 
302
    // process the extensions string and flag stuff we recognize
-
 
303
    glinfo.depthtex = !!Bstrstr(glinfo.extensions, "GL_ARB_depth_texture");
-
 
304
    glinfo.fbos     = !!Bstrstr(glinfo.extensions, "GL_EXT_framebuffer_object") || !!Bstrstr(glinfo.extensions, "GL_OES_framebuffer_object");
-
 
305
    glinfo.shadow   = !!Bstrstr(glinfo.extensions, "GL_ARB_shadow");
-
 
306
    glinfo.texnpot  = !!Bstrstr(glinfo.extensions, "GL_ARB_texture_non_power_of_two") || !!Bstrstr(glinfo.extensions, "GL_OES_texture_npot");
-
 
307
-
 
308
#if !defined EDUKE32_GLES
-
 
309
    glinfo.bgra             = !!Bstrstr(glinfo.extensions, "GL_EXT_bgra");
-
 
310
    glinfo.bufferstorage    = !!Bstrstr(glinfo.extensions, "GL_ARB_buffer_storage");
-
 
311
    glinfo.clamptoedge      = !!Bstrstr(glinfo.extensions, "GL_EXT_texture_edge_clamp") || !!Bstrstr(glinfo.extensions, "GL_SGIS_texture_edge_clamp");
-
 
312
    glinfo.debugoutput      = !!Bstrstr(glinfo.extensions, "GL_ARB_debug_output");
-
 
313
    glinfo.depthclamp       = !!Bstrstr(glinfo.extensions, "GL_ARB_depth_clamp");
-
 
314
    glinfo.glsl             = !!Bstrstr(glinfo.extensions, "GL_ARB_shader_objects");
-
 
315
    glinfo.multitex         = !!Bstrstr(glinfo.extensions, "GL_ARB_multitexture");
-
 
316
    glinfo.occlusionqueries = !!Bstrstr(glinfo.extensions, "GL_ARB_occlusion_query");
-
 
317
    glinfo.rect             = !!Bstrstr(glinfo.extensions, "GL_NV_texture_rectangle") || !!Bstrstr(glinfo.extensions, "GL_EXT_texture_rectangle");
-
 
318
    glinfo.sync             = !!Bstrstr(glinfo.extensions, "GL_ARB_sync");
-
 
319
    glinfo.texcompr         = !!Bstrstr(glinfo.extensions, "GL_ARB_texture_compression") && Bstrcmp(glinfo.vendor, "ATI Technologies Inc.");
-
 
320
    glinfo.vbos             = !!Bstrstr(glinfo.extensions, "GL_ARB_vertex_buffer_object");
-
 
321
    glinfo.vsync            = !!Bstrstr(glinfo.extensions, "WGL_EXT_swap_control") || !!Bstrstr(glinfo.extensions, "GLX_EXT_swap_control");
-
 
322
-
 
323
# ifdef DYNAMIC_GLEXT
-
 
324
    if (glinfo.texcompr && (!glCompressedTexImage2D || !glGetCompressedTexImage))
-
 
325
    {
-
 
326
        // lacking the necessary extensions to do this
-
 
327
        initprintf("Warning: the GL driver lacks necessary functions to use caching\n");
-
 
328
        glinfo.texcompr = 0;
-
 
329
    }
-
 
330
# endif
-
 
331
#else
-
 
332
    // don't bother checking because ETC2 et al. are not listed in extensions anyway
-
 
333
    glinfo.texcompr = 1; // !!Bstrstr(glinfo.extensions, "GL_OES_compressed_ETC1_RGB8_texture");
-
 
334
#endif
-
 
335
-
 
336
    glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glinfo.maxanisotropy);
-
 
337
-
 
338
    if (!glinfo.filled)
-
 
339
    {
-
 
340
        int32_t oldbpp = bpp;
-
 
341
        bpp = 32;
-
 
342
        osdcmd_glinfo(NULL);
-
 
343
        glinfo.filled = 1;
-
 
344
        bpp = oldbpp;
-
 
345
    }
-
 
346
}
-
 
347
293
// Used to register the game's / editor's osdcmd_vidmode() functions here.
348
// Used to register the game's / editor's osdcmd_vidmode() functions here.
294
int32_t (*baselayer_osdcmd_vidmode_func)(osdcmdptr_t parm);
349
int32_t (*baselayer_osdcmd_vidmode_func)(osdcmdptr_t parm);
295
350
296
static int osdfunc_setrendermode(osdcmdptr_t parm)
351
static int osdfunc_setrendermode(osdcmdptr_t parm)
297
{
352
{
Line 386... Line 441...
386
    }
441
    }
387
442
388
    initprintf("OpenGL information\n %s %s %s\n",
443
    initprintf("OpenGL information\n %s %s %s\n",
389
               glinfo.vendor, glinfo.renderer, glinfo.version);
444
               glinfo.vendor, glinfo.renderer, glinfo.version);
390
445
391
    if (!glinfo.dumped)
446
    if (!glinfo.filled)
392
        return OSDCMD_OK;
447
        return OSDCMD_OK;
393
448
394
    char const *s[] = { "supported", "not supported" };
449
    char const *s[] = { "supported", "not supported" };
395
450
396
#define SUPPORTED(x) (x ? s[0] : s[1])
451
#define SUPPORTED(x) (x ? s[0] : s[1])
397
452
398
    initprintf(" BGRA textures:           %s\n", SUPPORTED(glinfo.bgra));
453
    initprintf(" BGRA textures:           %s\n", SUPPORTED(glinfo.bgra));
399
    initprintf(" Non-power-of-2 textures: %s\n", SUPPORTED(glinfo.texnpot));
-
 
400
    initprintf(" Clamp-to-edge:           %s\n", SUPPORTED(glinfo.clamptoedge));
454
    initprintf(" Clamp-to-edge:           %s\n", SUPPORTED(glinfo.clamptoedge));
401
    initprintf(" Multi-texturing:         %s\n", SUPPORTED(glinfo.multitex));
-
 
402
    initprintf(" Framebuffer objects:     %s\n", SUPPORTED(glinfo.fbos));
455
    initprintf(" Framebuffer objects:     %s\n", SUPPORTED(glinfo.fbos));
-
 
456
    initprintf(" Multi-texturing:         %s\n", SUPPORTED(glinfo.multitex));
-
 
457
    initprintf(" Non-power-of-2 textures: %s\n", SUPPORTED(glinfo.texnpot));
403
#ifndef EDUKE32_GLES
458
#ifndef EDUKE32_GLES
404
    initprintf(" Texture compression:     %s\n", SUPPORTED(glinfo.texcompr));
459
    initprintf(" Buffer storage:          %s\n", SUPPORTED(glinfo.bufferstorage));
405
    initprintf(" ARBfp fragment programs: %s\n", SUPPORTED(glinfo.arbfp));
460
    initprintf(" Debug output:            %s\n", SUPPORTED(glinfo.debugoutput));
406
    initprintf(" Depth textures:          %s\n", SUPPORTED(glinfo.depthtex));
461
    initprintf(" Depth textures:          %s\n", SUPPORTED(glinfo.depthtex));
407
    initprintf(" Shadow textures:         %s\n", SUPPORTED(glinfo.shadow));
-
 
408
    initprintf(" Rectangle textures:      %s\n", SUPPORTED(glinfo.rect));
-
 
409
    initprintf(" env_combine:             %s\n", SUPPORTED(glinfo.envcombine));
-
 
410
    initprintf(" Vertex buffer objects:   %s\n", SUPPORTED(glinfo.vbos));
-
 
411
    initprintf(" Shader model 4:          %s\n", SUPPORTED(glinfo.sm4));
-
 
412
    initprintf(" Occlusion queries:       %s\n", SUPPORTED(glinfo.occlusionqueries));
-
 
413
    initprintf(" GLSL:                    %s\n", SUPPORTED(glinfo.glsl));
462
    initprintf(" GLSL:                    %s\n", SUPPORTED(glinfo.glsl));
-
 
463
    initprintf(" Occlusion queries:       %s\n", SUPPORTED(glinfo.occlusionqueries));
414
    initprintf(" Debug output:            %s\n", SUPPORTED(glinfo.debugoutput));
464
    initprintf(" Rectangle textures:      %s\n", SUPPORTED(glinfo.rect));
415
    initprintf(" Buffer storage:          %s\n", SUPPORTED(glinfo.bufferstorage));
465
    initprintf(" Shadow textures:         %s\n", SUPPORTED(glinfo.shadow));
416
    initprintf(" Sync:                    %s\n", SUPPORTED(glinfo.sync));
466
    initprintf(" Sync:                    %s\n", SUPPORTED(glinfo.sync));
-
 
467
    initprintf(" Texture compression:     %s\n", SUPPORTED(glinfo.texcompr));
-
 
468
    initprintf(" Vertex buffer objects:   %s\n", SUPPORTED(glinfo.vbos));
417
#endif
469
#endif
418
    initprintf(" Maximum anisotropy:      %.1f%s\n", glinfo.maxanisotropy, glinfo.maxanisotropy > 1.0 ? "" : " (no anisotropic filtering)");
470
    initprintf(" Maximum anisotropy:      %.1f%s\n", glinfo.maxanisotropy, glinfo.maxanisotropy > 1.0 ? "" : " (no anisotropic filtering)");
419
471
420
#undef SUPPORTED
472
#undef SUPPORTED
421
473