VirtualBox

Ignore:
Timestamp:
Jun 12, 2013 10:47:50 PM (12 years ago)
Author:
vboxsync
Message:

crOpenGL: more debugging/dumping

Location:
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h

    r46454 r46515  
    395395void crServerDumpProgram(GLint id);
    396396void crServerDumpCurrentProgram();
     397void crServerDumpRecompileDumpCurrentProgram();
     398void crServerRecompileCurrentProgram();
    397399void crServerDumpCurrentProgramUniforms();
     400void crServerDumpCurrentProgramAttribs();
    398401void crServerDumpFramesCheck();
    399402void crServerDumpState();
     
    456459#define CR_SERVER_DUMP_F_DRAW_BUFF_ENTER        0x00000001
    457460#define CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE        0x00000002
     461#define CR_SERVER_DUMP_F_DRAW_STATE_ENTER       0x00000004
     462#define CR_SERVER_DUMP_F_DRAW_STATE_LEAVE       0x00000008
    458463#define CR_SERVER_DUMP_F_DRAW_TEX_ENTER         0x00000010
    459464#define CR_SERVER_DUMP_F_DRAW_TEX_LEAVE         0x00000020
    460 #define CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER     0x00000100
    461 #define CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE     0x00000200
    462 #define CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER     0x00000400
    463 #define CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_LEAVE     0x00000800
    464 #define CR_SERVER_DUMP_F_DRAW_STATE_ENTER                0x00000004
    465 #define CR_SERVER_DUMP_F_DRAW_STATE_LEAVE                0x00000008
     465#define CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER     0x00000040
     466#define CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE     0x00000080
     467#define CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER     0x00000100
     468#define CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_LEAVE     0x00000200
     469#define CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER      0x00000400
     470#define CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_LEAVE      0x00000800
     471
    466472#define CR_SERVER_DUMP_F_DRAW_ENTER_ALL (CR_SERVER_DUMP_F_DRAW_BUFF_ENTER \
    467473        | CR_SERVER_DUMP_F_DRAW_TEX_ENTER \
    468474        | CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER \
    469475        | CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER \
    470         | CR_SERVER_DUMP_F_DRAW_STATE_ENTER)
     476        | CR_SERVER_DUMP_F_DRAW_STATE_ENTER \
     477        | CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER)
    471478
    472479#define CR_SERVER_DUMP_F_DRAW_LEAVE_ALL (CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE \
     
    474481        | CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE \
    475482        | CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_LEAVE \
    476         | CR_SERVER_DUMP_F_DRAW_STATE_LEAVE)
     483        | CR_SERVER_DUMP_F_DRAW_STATE_LEAVE \
     484        | CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_LEAVE)
    477485
    478486#define CR_SERVER_DUMP_F_DRAW_ALL (CR_SERVER_DUMP_F_DRAW_ENTER_ALL | CR_SERVER_DUMP_F_DRAW_LEAVE_ALL)
    479487
    480 #define CR_SERVER_DUMP_F_COMPILE_SHADER         0x00001000
    481 #define CR_SERVER_DUMP_F_SHADER_SOURCE          0x00002000
    482 #define CR_SERVER_DUMP_F_LINK_PROGRAM           0x00004000
    483488#define CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER      0x00010000
    484489#define CR_SERVER_DUMP_F_SWAPBUFFERS_LEAVE      0x00020000
    485490#define CR_SERVER_DUMP_F_DRAWEL                 0x00100000
     491#define CR_SERVER_DUMP_F_COMPILE_SHADER         0x01000000
     492#define CR_SERVER_DUMP_F_SHADER_SOURCE          0x02000000
     493#define CR_SERVER_DUMP_F_LINK_PROGRAM           0x04000000
    486494
    487495
     
    497505            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAW_ENTER_ALL, cr_server.Recorder.pDumper)) break; \
    498506            crServerDumpCheckInit(); \
    499             crDmpStrF(cr_server.Recorder.pDumper, "==> %s", __FUNCTION__); \
     507            crDmpStrF(cr_server.Recorder.pDumper, "==ENTER %s==", __FUNCTION__); \
    500508            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_STATE_ENTER, cr_server.Recorder.pDumper)) { crServerDumpState(); } \
    501509            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgram(); } \
    502510            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramUniforms(); } \
     511            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramAttribs(); } \
    503512            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_TEX_ENTER, cr_server.Recorder.pDumper)) { crServerDumpTextures(); } \
    504513            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_BUFF_ENTER, cr_server.Recorder.pDumper)) { crServerDumpBuffer(-1); } \
    505             crDmpStrF(cr_server.Recorder.pDumper, "=================="); \
     514            crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER %s==", __FUNCTION__); \
    506515        } while (0)
    507516
     
    509518            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAW_LEAVE_ALL, cr_server.Recorder.pDumper)) break; \
    510519            crServerDumpCheckInit(); \
    511             crDmpStrF(cr_server.Recorder.pDumper, "<== %s", __FUNCTION__); \
     520            crDmpStrF(cr_server.Recorder.pDumper, "==LEAVE %s==", __FUNCTION__); \
    512521            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_TEX_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpTextures(); } \
    513522            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpBuffer(-1); } \
    514523            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramUniforms(); } \
     524            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgramAttribs(); } \
    515525            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgram(); } \
    516526            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_STATE_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpState(); } \
    517             crDmpStrF(cr_server.Recorder.pDumper, "=================="); \
     527            crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE %s==", __FUNCTION__); \
    518528        } while (0)
    519529
     
    529539            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SHADER_SOURCE, cr_server.Recorder.pDumper)) break; \
    530540            crServerDumpCheckInit(); \
    531             crDmpStrF(cr_server.Recorder.pDumper, "== %s", __FUNCTION__); \
     541            crDmpStrF(cr_server.Recorder.pDumper, "==%s==", __FUNCTION__); \
    532542            crServerDumpShader((_id)); \
    533             crDmpStrF(cr_server.Recorder.pDumper, "====="); \
     543            crDmpStrF(cr_server.Recorder.pDumper, "==Done %s==", __FUNCTION__); \
    534544        } while (0)
    535545
     
    537547            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_LINK_PROGRAM, cr_server.Recorder.pDumper)) break; \
    538548            crServerDumpCheckInit(); \
    539             crDmpStrF(cr_server.Recorder.pDumper, "== %s", __FUNCTION__); \
     549            crDmpStrF(cr_server.Recorder.pDumper, "==%s==", __FUNCTION__); \
    540550            crServerDumpProgram((_id)); \
    541             crDmpStrF(cr_server.Recorder.pDumper, "====="); \
     551            crDmpStrF(cr_server.Recorder.pDumper, "==Done %s==", __FUNCTION__); \
    542552        } while (0)
    543553
     
    545555            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER, cr_server.Recorder.pDumper)) break; \
    546556            crServerDumpCheckInit(); \
    547             crDmpStrF(cr_server.Recorder.pDumper, "== %s", __FUNCTION__); \
     557            crDmpStrF(cr_server.Recorder.pDumper, "==ENTER %s==", __FUNCTION__); \
    548558            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER, cr_server.Recorder.pDumper)) { crServerDumpBuffer(CR_SERVER_FBO_BB_IDX(cr_server.currentMural)); } \
    549559            if (g_CrDbgDumpDrawFramesCount) { crServerDumpFramesCheck(); } \
     560            crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER %s==", __FUNCTION__); \
    550561        } while (0)
    551562
    552563#define CR_SERVER_DUMP_SWAPBUFFERS_LEAVE() do { \
    553564            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SWAPBUFFERS_LEAVE, cr_server.Recorder.pDumper)) break; \
    554             crServerDumpCheckInit(); \
    555             crDmpStrF(cr_server.Recorder.pDumper, "== %s", __FUNCTION__); \
     565            crDmpStrF(cr_server.Recorder.pDumper, "==LEAVE %s==", __FUNCTION__); \
     566            crServerDumpCheckInit(); \
     567            crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE %s==", __FUNCTION__); \
    556568        } while (0)
    557569
     
    559571        if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper)) break; \
    560572        crServerDumpCheckInit(); \
    561         crDmpStrF(cr_server.Recorder.pDumper, "== %s", __FUNCTION__); \
     573        crDmpStrF(cr_server.Recorder.pDumper, "==%s==", __FUNCTION__); \
    562574        crServerDumpDrawel _msg; \
    563575    } while (0)
     
    566578        if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper)) break; \
    567579        crServerDumpCheckInit(); \
    568         crDmpStrF(cr_server.Recorder.pDumper, "== %s", __FUNCTION__); \
     580        crDmpStrF(cr_server.Recorder.pDumper, "==%s==", __FUNCTION__); \
    569581        crServerDumpDrawelv((_index), (_pszElFormat), (_cbEl), (_pvVal), (_cVal)); \
    570582    } while (0)
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c

    r46453 r46515  
    13961396unsigned long g_CrDbgDumpDraw = CR_SERVER_DUMP_F_COMPILE_SHADER
    13971397        | CR_SERVER_DUMP_F_LINK_PROGRAM
     1398        | CR_SERVER_DUMP_F_DRAW_BUFF_ENTER
    13981399        | CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE
    13991400        | CR_SERVER_DUMP_F_DRAW_PROGRAM_UNIFORMS_ENTER
    1400         | CR_SERVER_DUMP_F_DRAW_TEX_LEAVE
     1401        | CR_SERVER_DUMP_F_DRAW_PROGRAM_ATTRIBS_ENTER
     1402        | CR_SERVER_DUMP_F_DRAW_TEX_ENTER
    14011403        | CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER
    14021404        | CR_SERVER_DUMP_F_DRAW_STATE_ENTER
    14031405        | CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER
    14041406        | CR_SERVER_DUMP_F_DRAWEL
     1407        | CR_SERVER_DUMP_F_SHADER_SOURCE
    14051408        ; //CR_SERVER_DUMP_F_DRAW_BUFF_ENTER | CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE;
    14061409unsigned long g_CrDbgDumpDrawFramesSettings = CR_SERVER_DUMP_F_DRAW_BUFF_ENTER
     
    14871490}
    14881491
     1492void crServerDumpRecompileDumpCurrentProgram()
     1493{
     1494    crDmpStrF(cr_server.Recorder.pDumper, "==Dump(1)==");
     1495    crServerRecompileCurrentProgram();
     1496    crServerDumpCurrentProgramUniforms();
     1497    crServerDumpCurrentProgramAttribs();
     1498    crDmpStrF(cr_server.Recorder.pDumper, "Done Dump(1)");
     1499    crServerRecompileCurrentProgram();
     1500    crDmpStrF(cr_server.Recorder.pDumper, "Dump(2)");
     1501    crServerRecompileCurrentProgram();
     1502    crServerDumpCurrentProgramUniforms();
     1503    crServerDumpCurrentProgramAttribs();
     1504    crDmpStrF(cr_server.Recorder.pDumper, "Done Dump(2)");
     1505}
     1506
     1507void crServerRecompileCurrentProgram()
     1508{
     1509    CRContext *ctx = crStateGetCurrent();
     1510    crRecRecompileCurrentProgram(&cr_server.Recorder, ctx);
     1511}
     1512
    14891513void crServerDumpCurrentProgramUniforms()
    14901514{
    14911515    CRContext *ctx = crStateGetCurrent();
     1516    crDmpStrF(cr_server.Recorder.pDumper, "==Uniforms==");
    14921517    crRecDumpCurrentProgramUniforms(&cr_server.Recorder, ctx);
     1518    crDmpStrF(cr_server.Recorder.pDumper, "==Done Uniforms==");
     1519}
     1520
     1521void crServerDumpCurrentProgramAttribs()
     1522{
     1523    CRContext *ctx = crStateGetCurrent();
     1524    crDmpStrF(cr_server.Recorder.pDumper, "==Attribs==");
     1525    crRecDumpCurrentProgramAttribs(&cr_server.Recorder, ctx);
     1526    crDmpStrF(cr_server.Recorder.pDumper, "==Done Attribs==");
    14931527}
    14941528
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette