<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57925>57925</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [DirectX backend] Build shader flag which saved into DXIL entry metadata
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:DirectX
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          python3kgae
      </td>
    </tr>
</table>

<pre>
    
The layout is 64bit unsigned integer union with

    unsigned m_bDisableOptimizations :1;   // D3D11_1_SB_GLOBAL_FLAG_SKIP_OPTIMIZATION
    unsigned m_bDisableMathRefactoring :1; //~D3D10_SB_GLOBAL_FLAG_REFACTORING_ALLOWED
    unsigned m_bEnableDoublePrecision :1; // D3D11_SB_GLOBAL_FLAG_ENABLE_DOUBLE_PRECISION_FLOAT_OPS
    unsigned m_bForceEarlyDepthStencil :1; // D3D11_SB_GLOBAL_FLAG_FORCE_EARLY_DEPTH_STENCIL
    unsigned m_bEnableRawAndStructuredBuffers :1; // D3D11_SB_GLOBAL_FLAG_ENABLE_RAW_AND_STRUCTURED_BUFFERS
    unsigned m_bLowPrecisionPresent :1; // D3D11_1_SB_GLOBAL_FLAG_ENABLE_MINIMUM_PRECISION
    unsigned m_bEnableDoubleExtensions :1; // D3D11_1_SB_GLOBAL_FLAG_ENABLE_DOUBLE_EXTENSIONS
    unsigned m_bEnableMSAD :1;        // D3D11_1_SB_GLOBAL_FLAG_ENABLE_SHADER_EXTENSIONS
    unsigned m_bAllResourcesBound :1; // D3D12_SB_GLOBAL_FLAG_ALL_RESOURCES_BOUND

    unsigned m_bViewportAndRTArrayIndex :1;   // SHADER_FEATURE_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER
    unsigned m_bInnerCoverage :1;             // SHADER_FEATURE_INNER_COVERAGE
    unsigned m_bStencilRef  :1;               // SHADER_FEATURE_STENCIL_REF
    unsigned m_bTiledResources  :1;           // SHADER_FEATURE_TILED_RESOURCES
    unsigned m_bUAVLoadAdditionalFormats :1;  // SHADER_FEATURE_TYPED_UAV_LOAD_ADDITIONAL_FORMATS
    unsigned m_bLevel9ComparisonFiltering :1; // SHADER_FEATURE_LEVEL_9_COMPARISON_FILTERING
                                              // SHADER_FEATURE_11_1_SHADER_EXTENSIONS shared with EnableMSAD
    unsigned m_b64UAVs :1;                    // SHADER_FEATURE_64_UAVS
    unsigned m_UAVsAtEveryStage :1;           // SHADER_FEATURE_UAVS_AT_EVERY_STAGE
    unsigned m_bCSRawAndStructuredViaShader4X : 1; // SHADER_FEATURE_COMPUTE_SHADERS_PLUS_RAW_AND_STRUCTURED_BUFFERS_VIA_SHADER_4_X
    
    // SHADER_FEATURE_COMPUTE_SHADERS_PLUS_RAW_AND_STRUCTURED_BUFFERS_VIA_SHADER_4_X is specifically
    // about shader model 4.x.

    unsigned m_bROVS :1;              // SHADER_FEATURE_ROVS
    unsigned m_bWaveOps :1;           // SHADER_FEATURE_WAVE_OPS
    unsigned m_bInt64Ops :1;          // SHADER_FEATURE_INT64_OPS
    unsigned m_bViewID : 1;           // SHADER_FEATURE_VIEWID
    unsigned m_bBarycentrics : 1;     // SHADER_FEATURE_BARYCENTRICS

    unsigned m_bUseNativeLowPrecision : 1;

    unsigned m_bShadingRate : 1;      // SHADER_FEATURE_SHADINGRATE

    unsigned m_bRaytracingTier1_1 : 1; // SHADER_FEATURE_RAYTRACING_TIER_1_1
    unsigned m_bSamplerFeedback : 1; // SHADER_FEATURE_SAMPLER_FEEDBACK

    unsigned m_bAtomicInt64OnTypedResource : 1; // SHADER_FEATURE_ATOMIC_INT64_ON_TYPED_RESOURCE
    unsigned m_bAtomicInt64OnGroupShared : 1; // SHADER_FEATURE_ATOMIC_INT64_ON_GROUP_SHARED

    unsigned m_bDerivativesInMeshAndAmpShaders : 1; //SHADER_FEATURE_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS

    unsigned m_bResourceDescriptorHeapIndexing : 1;  // SHADER_FEATURE_RESOURCE_DESCRIPTOR_HEAP_INDEXING
    unsigned m_bSamplerDescriptorHeapIndexing : 1;  // SHADER_FEATURE_SAMPLER_DESCRIPTOR_HEAP_INDEXING

    unsigned m_bAtomicInt64OnHeapResource : 1; // SHADER_FEATURE_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE

    // Global flag indicating that any UAV may not alias any other UAV.
    // Set if UAVs are used, unless -res-may-alias was specified.
    // For modules compiled against validator version < 1.7, this flag will be
    // cleared, and it must be assumed that UAV resources may alias.
    unsigned m_bResMayNotAlias : 1;

    unsigned m_bAdvancedTextureOps : 1;     // SHADER_FEATURE_ADVANCED_TEXTURE_OPS
    unsigned m_bWriteableMSAATextures : 1;  // SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES

    uint32_t m_align1 : 28;            // align to 64 bit.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1WFtv4joQ_jXwYi2i3FoeeDCJaa0NCXICbfclMokLPhsSFDttOb_-jMOlLU1od6WDKkJu83lmvvlm3GUW70aNtt1o42AtUMJ3WaGRVGjQW0qNilTJVSpiJFMtViKHCzJL0YvU6_1L-28En9Ojm3BpS8WXifC2Wm7kv1zDOwo1uviq0R3Do43OBP6Q3bWvrsKr0B-Ht443xk44cfBt6P-ks9CbBXRKf-GAeu5FjCnXayaeeKSzXKarE8oeo3FNDEr7HIORCbYCj1H3NsSO490TuxqFpAbEzgr4nuUiksr4_xHk4MgZBHHx2CGh7c3NYcaIRX1wBm56OAD__GrASZZHgvA82dliq9e-Fmkkk28hTjxmkZBg5jyGNpkFd6EfENeiziXXGH_BaezrvIh0kYt4XDw9iVz9iYsM34fYtQGNza1gzogdjueTCWE1LjrZyymU8EOJVFfD1QFOqUun8-lbUL_OHXmFQKoPPPwW1CF95AEiaZBqXNpDTX1sv6N5-fkWin-HbcK-RMFJwoTKCmCIGmdFGlf50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