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

    <tr>
        <th>Summary</th>
        <td>
            [HLSL][DXC Driver] Add preprocessor definition when `-metal` is passed
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            HLSL
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          llvm-beanz
      </td>
    </tr>
</table>

<pre>
    **Is your feature request related to a problem? Please describe.**

We recently added a `-metal` flag to DXC to aid with cross-platform development workflows. When that flag is passed we should set a new preprocessor define in InitPreprocessor (something like `__metal__`) to denote that we're targeting Metal. That will allow for code portability to work around differences in behavior between DX, VK and MTL.

We should ensure this implementation aligns with https://github.com/microsoft/DirectXShaderCompiler/issues/7553.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8k09r20AQxT_N6jJYrFd_bB90cGJMQxMIJDS5mZV2JG2z2lV3Rxbupy8rp2kKpSDQYTRv3rz5SYagO4tYseKGFYdETtQ7XxlzHlY1SvszqZ26VEzsmdjfBbi4yUOLkiaP4PHHhIHAo5GECsiBhNG72uDAsiM8GpQBQWFovK4xvaowHp-X2N6gJXMBqRQqkMBKvhqQpGElh9bILioeXm8XYa1g1tRD410Iq9FIap0fQOEZjRsHtASz82-tcXNI4aVHC9RLuuroAKMMARXMCKF3k1EQkECCxRlGj6N3DYbgPChstUXQFu6spsfPJSa2wQ1IvbYdGP2G0fHptFg-nVjJmdhFrwqtI7yOn5GJjUcg6Tuk2PgQP0_healqY0Aa42ZonYfGKYTReZK1NpouUSwuBdK7ySpQum3Ro20wRIM19vKsnYcaaUa0cHhl4ha-fQVpFTw836cfWb_vjDbEw1GvA-hhNBhzk6SdBWl0Z8M1455oDCzbM3Fk4thp6qc6bdzAxHHQ8QCuJSaOB-2xodenXir0t24YtUHPxFGHMGFg4rgpiixNVJWpXbaTCVbrTcFFKQQvk77KZZbzPMuz7U7UDeZr1eZKqKzeqTLjYpfoSnBR8HK9XRdFmZfpWnHZtLt6U_I1V7lkOcdBapNGXlPnu2QZXa3zfJNtEyNrNGFBW4gv90_3TIgI-W--py6wnBsdKPxRIE1m-R2WhuLAipuI4MHrM3pWHGCv1D-I0UuIc8TuL4w_yEsmb6r_BBsNvL9Wo3ffsaHPUb6vdK7ErwAAAP__6289rw">