Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS (DX12) Kernel - Debug.c
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/*   -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
      following conditions are met:
        Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
        Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
          provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/* == Kernel ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Private Functions                                                                                                                                                     */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

/* ---- tgKN_GPU_PM_Output__Adapter ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
#if TgS_STAT_KERNEL || TgS_DEBUG_KERNEL
TgVOID tgKN_GPU_DXGI_Output__Adapter( CPCU_STg2_KN_GPU_DXGI_Adapter psAdapter )
{
    TgSINT32                            iOutput;
    CP_STg2_KN_GPU_DXGI_Output          psOutput;
    TgCHAR                              szData[128];
    TgUINT32                            uiChannel_Mask;

    uiChannel_Mask = KTgCN_CHANEL_INITIALIZE | KTgCN_SEVERITY_9;
    tgSZ_FromWideChar( szData, TgARRAY_COUNT( szData ), psAdapter->m_sAdapter.Description, TgARRAY_COUNT( psAdapter->m_sAdapter.Description ) );
    tgCN_PrintF( uiChannel_Mask, TgT( "%-16.16s(%-48.48s):     - Adapter[ %s ]\n" ), TgT( "Kernel" ), TgT( "tgKN_GPU_PM_Output__Adapter" ), szData );

    for (iOutput=0; iOutput < psAdapter->m_niOutput; ++iOutput)
    {
        TgSINT32                            iMode;

        psOutput = psAdapter->m_asOutput + iOutput;

        tgSZ_FromWideChar( szData, TgARRAY_COUNT( szData ), psOutput->m_sDXGI_Output.DeviceName, TgARRAY_COUNT( psOutput->m_sDXGI_Output.DeviceName ) );
        tgCN_PrintF( uiChannel_Mask, TgT( "%-16.16s(%-48.48s):     - Output[ %s ]\n" ), TgT( "Kernel" ), TgT( "tgKN_GPU_PM_Output__Adapter" ), szData );

        for (iMode = 0; iMode < psOutput->m_niMode; ++iMode)
        {
            tgCN_PrintF( uiChannel_Mask, TgT("%-16.16s(%-48.48s):     - Mode[% 4d]: W[% 5d] H[% 5d] R[% 3d] F[%s]\n"), TgT("Kernel"), TgT("tgKN_GPU_PM_Output__Adapter"),
                         iMode, psOutput->m_psMode[iMode].Width, psOutput->m_psMode[iMode].Height,
                         psOutput->m_psMode[iMode].RefreshRate.Numerator / psOutput->m_psMode[iMode].RefreshRate.Denominator,
                         tgKN_GPU_DXGI_FMT_To_String( psOutput->m_psMode[iMode].Format ) );
        };
        tgCN_PrintF( uiChannel_Mask, TgT("%-16.16s(%-48.48s):   - Mode Count: %d\n"), TgT("Kernel"), TgT("tgKN_GPU_PM_Output__Adapter"), psOutput->m_niMode );

        tgCN_PrintF( uiChannel_Mask, TgT( "%-16.16s(%-48.48s):     - Device Scan Outs\n" ), TgT( "Kernel" ), TgT( "tgKN_GPU_PM_Output__Adapter" ) );
        for (iMode = 0; iMode < ETgKN_GPU_TARGET__MAX; ++iMode)
        {
            if (0 >= psOutput->m_niMode_Target_Format[iMode])
                continue;

            tgCN_PrintF( uiChannel_Mask, TgT( "%-16.16s(%-48.48s):     - F[%s]\n" ), TgT( "Kernel" ), TgT( "tgKN_GPU_PM_Output__Adapter" ),
                         tgKN_GPU_DXGI_FMT_To_String( KTgKN_DX_FORMAT_LIST[iMode] ) );
        };
        tgCN_PrintF( uiChannel_Mask, TgT("%-16.16s(%-48.48s):   - Mode Count: %d\n"), TgT("Kernel"), TgT("tgKN_GPU_PM_Output__Adapter"), psOutput->m_niMode );
    };
}


/* ---- tgKN_GPU_DXGI_FMT_To_String ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
CLANG_WARN_SUPPRESS(switch-enum)
CP_TgCHAR tgKN_GPU_DXGI_FMT_To_String( DXGI_FORMAT enFormat )
{
    switch (enFormat)
    {
    case DXGI_FORMAT_R32G32B32A32_TYPELESS:
        return (TgT("DXGI_FORMAT_R32G32B32A32_TYPELESS"));
    case DXGI_FORMAT_R32G32B32A32_FLOAT:
        return (TgT("DXGI_FORMAT_R32G32B32A32_FLOAT"));
    case DXGI_FORMAT_R32G32B32A32_UINT:
        return (TgT("DXGI_FORMAT_R32G32B32A32_UINT"));
    case DXGI_FORMAT_R32G32B32A32_SINT:
        return (TgT("DXGI_FORMAT_R32G32B32A32_SINT"));
    case DXGI_FORMAT_R32G32B32_TYPELESS:
        return (TgT("DXGI_FORMAT_R32G32B32_TYPELESS"));
    case DXGI_FORMAT_R32G32B32_FLOAT:
        return (TgT("DXGI_FORMAT_R32G32B32_FLOAT"));
    case DXGI_FORMAT_R32G32B32_UINT:
        return (TgT("DXGI_FORMAT_R32G32B32_UINT"));
    case DXGI_FORMAT_R32G32B32_SINT:
        return (TgT("DXGI_FORMAT_R32G32B32_SINT"));
    case DXGI_FORMAT_R16G16B16A16_TYPELESS:
        return (TgT("DXGI_FORMAT_R16G16B16A16_TYPELESS"));
    case DXGI_FORMAT_R16G16B16A16_FLOAT:
        return (TgT("DXGI_FORMAT_R16G16B16A16_FLOAT"));
    case DXGI_FORMAT_R16G16B16A16_UNORM:
        return (TgT("DXGI_FORMAT_R16G16B16A16_UNORM"));
    case DXGI_FORMAT_R16G16B16A16_UINT:
        return (TgT("DXGI_FORMAT_R16G16B16A16_UINT"));
    case DXGI_FORMAT_R16G16B16A16_SNORM:
        return (TgT("DXGI_FORMAT_R16G16B16A16_SNORM"));
    case DXGI_FORMAT_R16G16B16A16_SINT:
        return (TgT("DXGI_FORMAT_R16G16B16A16_SINT"));
    case DXGI_FORMAT_R32G32_TYPELESS:
        return (TgT("DXGI_FORMAT_R32G32_TYPELESS"));
    case DXGI_FORMAT_R32G32_FLOAT:
        return (TgT("DXGI_FORMAT_R32G32_FLOAT"));
    case DXGI_FORMAT_R32G32_UINT:
        return (TgT("DXGI_FORMAT_R32G32_UINT"));
    case DXGI_FORMAT_R32G32_SINT:
        return (TgT("DXGI_FORMAT_R32G32_SINT"));
    case DXGI_FORMAT_R32G8X24_TYPELESS:
        return (TgT("DXGI_FORMAT_R32G8X24_TYPELESS"));
    case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
        return (TgT("DXGI_FORMAT_D32_FLOAT_S8X24_UINT"));
    case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
        return (TgT("DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS"));
    case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
        return (TgT("DXGI_FORMAT_X32_TYPELESS_G8X24_UINT"));
    case DXGI_FORMAT_R10G10B10A2_TYPELESS:
        return (TgT("DXGI_FORMAT_R10G10B10A2_TYPELESS"));
    case DXGI_FORMAT_R10G10B10A2_UNORM:
        return (TgT("DXGI_FORMAT_R10G10B10A2_UNORM"));
    case DXGI_FORMAT_R10G10B10A2_UINT:
        return (TgT("DXGI_FORMAT_R10G10B10A2_UINT"));
    case DXGI_FORMAT_R11G11B10_FLOAT:
        return (TgT("DXGI_FORMAT_R11G11B10_FLOAT"));
    case DXGI_FORMAT_R8G8B8A8_TYPELESS:
        return (TgT("DXGI_FORMAT_R8G8B8A8_TYPELESS"));
    case DXGI_FORMAT_R8G8B8A8_UNORM:
        return (TgT("DXGI_FORMAT_R8G8B8A8_UNORM"));
    case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
        return (TgT("DXGI_FORMAT_R8G8B8A8_UNORM_SRGB"));
    case DXGI_FORMAT_R8G8B8A8_UINT:
        return (TgT("DXGI_FORMAT_R8G8B8A8_UINT"));
    case DXGI_FORMAT_R8G8B8A8_SNORM:
        return (TgT("DXGI_FORMAT_R8G8B8A8_SNORM"));
    case DXGI_FORMAT_R8G8B8A8_SINT:
        return (TgT("DXGI_FORMAT_R8G8B8A8_SINT"));
    case DXGI_FORMAT_R16G16_TYPELESS:
        return (TgT("DXGI_FORMAT_R16G16_TYPELESS"));
    case DXGI_FORMAT_R16G16_FLOAT:
        return (TgT("DXGI_FORMAT_R16G16_FLOAT"));
    case DXGI_FORMAT_R16G16_UNORM:
        return (TgT("DXGI_FORMAT_R16G16_UNORM"));
    case DXGI_FORMAT_R16G16_UINT:
        return (TgT("DXGI_FORMAT_R16G16_UINT"));
    case DXGI_FORMAT_R16G16_SNORM:
        return (TgT("DXGI_FORMAT_R16G16_SNORM"));
    case DXGI_FORMAT_R16G16_SINT:
        return (TgT("DXGI_FORMAT_R16G16_SINT"));
    case DXGI_FORMAT_R32_TYPELESS:
        return (TgT("DXGI_FORMAT_R32_TYPELESS"));
    case DXGI_FORMAT_D32_FLOAT:
        return (TgT("DXGI_FORMAT_D32_FLOAT"));
    case DXGI_FORMAT_R32_FLOAT:
        return (TgT("DXGI_FORMAT_R32_FLOAT"));
    case DXGI_FORMAT_R32_UINT:
        return (TgT("DXGI_FORMAT_R32_UINT"));
    case DXGI_FORMAT_R32_SINT:
        return (TgT("DXGI_FORMAT_R32_SINT"));
    case DXGI_FORMAT_R24G8_TYPELESS:
        return (TgT("DXGI_FORMAT_R24G8_TYPELESS"));
    case DXGI_FORMAT_D24_UNORM_S8_UINT:
        return (TgT("DXGI_FORMAT_D24_UNORM_S8_UINT"));
    case DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
        return (TgT("DXGI_FORMAT_R24_UNORM_X8_TYPELESS"));
    case DXGI_FORMAT_X24_TYPELESS_G8_UINT:
        return (TgT("DXGI_FORMAT_X24_TYPELESS_G8_UINT"));
    case DXGI_FORMAT_R8G8_TYPELESS:
        return (TgT("DXGI_FORMAT_R8G8_TYPELESS"));
    case DXGI_FORMAT_R8G8_UNORM:
        return (TgT("DXGI_FORMAT_R8G8_UNORM"));
    case DXGI_FORMAT_R8G8_UINT:
        return (TgT("DXGI_FORMAT_R8G8_UINT"));
    case DXGI_FORMAT_R8G8_SNORM:
        return (TgT("DXGI_FORMAT_R8G8_SNORM"));
    case DXGI_FORMAT_R8G8_SINT:
        return (TgT("DXGI_FORMAT_R8G8_SINT"));
    case DXGI_FORMAT_R16_TYPELESS:
        return (TgT("DXGI_FORMAT_R16_TYPELESS"));
    case DXGI_FORMAT_R16_FLOAT:
        return (TgT("DXGI_FORMAT_R16_FLOAT"));
    case DXGI_FORMAT_D16_UNORM:
        return (TgT("DXGI_FORMAT_D16_UNORM"));
    case DXGI_FORMAT_R16_UNORM:
        return (TgT("DXGI_FORMAT_R16_UNORM"));
    case DXGI_FORMAT_R16_UINT:
        return (TgT("DXGI_FORMAT_R16_UINT"));
    case DXGI_FORMAT_R16_SNORM:
        return (TgT("DXGI_FORMAT_R16_SNORM"));
    case DXGI_FORMAT_R16_SINT:
        return (TgT("DXGI_FORMAT_R16_SINT"));
    case DXGI_FORMAT_R8_TYPELESS:
        return (TgT("DXGI_FORMAT_R8_TYPELESS"));
    case DXGI_FORMAT_R8_UNORM:
        return (TgT("DXGI_FORMAT_R8_UNORM"));
    case DXGI_FORMAT_R8_UINT:
        return (TgT("DXGI_FORMAT_R8_UINT"));
    case DXGI_FORMAT_R8_SNORM:
        return (TgT("DXGI_FORMAT_R8_SNORM"));
    case DXGI_FORMAT_R8_SINT:
        return (TgT("DXGI_FORMAT_R8_SINT"));
    case DXGI_FORMAT_A8_UNORM:
        return (TgT("DXGI_FORMAT_A8_UNORM"));
    case DXGI_FORMAT_R1_UNORM:
        return (TgT("DXGI_FORMAT_R1_UNORM"));
    case DXGI_FORMAT_R9G9B9E5_SHAREDEXP:
        return (TgT("DXGI_FORMAT_R9G9B9E5_SHAREDEXP"));
    case DXGI_FORMAT_R8G8_B8G8_UNORM:
        return (TgT("DXGI_FORMAT_R8G8_B8G8_UNORM"));
    case DXGI_FORMAT_G8R8_G8B8_UNORM:
        return (TgT("DXGI_FORMAT_G8R8_G8B8_UNORM"));
    case DXGI_FORMAT_BC1_TYPELESS:
        return (TgT("DXGI_FORMAT_BC1_TYPELESS"));
    case DXGI_FORMAT_BC1_UNORM:
        return (TgT("DXGI_FORMAT_BC1_UNORM"));
    case DXGI_FORMAT_BC1_UNORM_SRGB:
        return (TgT("DXGI_FORMAT_BC1_UNORM_SRGB"));
    case DXGI_FORMAT_BC2_TYPELESS:
        return (TgT("DXGI_FORMAT_BC2_TYPELESS"));
    case DXGI_FORMAT_BC2_UNORM:
        return (TgT("DXGI_FORMAT_BC2_UNORM"));
    case DXGI_FORMAT_BC2_UNORM_SRGB:
        return (TgT("DXGI_FORMAT_BC2_UNORM_SRGB"));
    case DXGI_FORMAT_BC3_TYPELESS:
        return (TgT("DXGI_FORMAT_BC3_TYPELESS"));
    case DXGI_FORMAT_BC3_UNORM:
        return (TgT("DXGI_FORMAT_BC3_UNORM"));
    case DXGI_FORMAT_BC3_UNORM_SRGB:
        return (TgT("DXGI_FORMAT_BC3_UNORM_SRGB"));
    case DXGI_FORMAT_BC4_TYPELESS:
        return (TgT("DXGI_FORMAT_BC4_TYPELESS"));
    case DXGI_FORMAT_BC4_UNORM:
        return (TgT("DXGI_FORMAT_BC4_UNORM"));
    case DXGI_FORMAT_BC4_SNORM:
        return (TgT("DXGI_FORMAT_BC4_SNORM"));
    case DXGI_FORMAT_BC5_TYPELESS:
        return (TgT("DXGI_FORMAT_BC5_TYPELESS"));
    case DXGI_FORMAT_BC5_UNORM:
        return (TgT("DXGI_FORMAT_BC5_UNORM"));
    case DXGI_FORMAT_BC5_SNORM:
        return (TgT("DXGI_FORMAT_BC5_SNORM"));
    case DXGI_FORMAT_B5G6R5_UNORM:
        return (TgT("DXGI_FORMAT_B5G6R5_UNORM"));
    case DXGI_FORMAT_B5G5R5A1_UNORM:
        return (TgT("DXGI_FORMAT_B5G5R5A1_UNORM"));
    case DXGI_FORMAT_B8G8R8A8_UNORM:
        return (TgT("DXGI_FORMAT_B8G8R8A8_UNORM"));
    case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
        return (TgT( "DXGI_FORMAT_B8G8R8A8_UNORM_SRGB" ));
    default:
        return (TgT("Unknown format"));
    };
}


/*# TgS_STAT_KERNEL || TgS_DEBUG_KERNEL */
#endif