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

    <tr>
        <th>Summary</th>
        <td>
            [HLSL][SPIR-V] Push constants in HLSL
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            HLSL,
            backend:SPIR-V
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            s-perron
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          s-perron
      </td>
    </tr>
</table>

<pre>
    Vulkan/SPIR-V has the concept of a push constant. It is a small block of data that can be accessed without a descriptor. In DirectX, this would be a root constant. If a cbuffer is a root constant is determined by the root signature, and it not strictly part of the shader. In Vulkan it is part of the shader. The push constant must be marked as a root constant.

This is done in DXC by using the `vk::push_constant` attribute. The variable to which it is applied will not be added to the `$Global` cbuffer. Instead it will be its own variable in the push constant storage class. This attribute needs to be implemented in clang.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsU82K4zgQfhr5UsQ48k86Bx8yHbLbMIdhZxj6tpSkSqyNLBmpnNBvv8hx093sngTFV9-fKEzJXjxRL9pvQsq0mSjG4IWUoj0WOPMQYv8-LVQwb_3v2V3RC3n6-ePlr81vGDABDwQ6eE0TQzgDwjSnIU8So-cSXhhsAoQ0onOgXNDXjDPICDwgg0YPigC1ppTIwN3yEGYGBENJRztxiCW8eDjaSJpfhXwGHmyCe5idWVYhhsCfNbMPrebzmeJD_QsgjwwxxdF6MqDelhALJFeCPEfKKugNWAaf5xytZvcGE8YlZ95IAxp6eHs0k9E2_S_m10Bfm4FxTpzdjxivZAD_Y7MU1UFUh185a3YcPIH1cHx9zpbnZP1lkRBddbuK-iDqQ1b4-31fdBUgc7RqZno4uGG0qBwBB7gPVg-rY5wmZ5funVvy5laNIZOBq4aQzR8uKHSZdy03Z09MuPS0LCsCywnC3X-IWb9wfI2fOES8EGiHKWV32ca7W_BEJmXxzDdOjkbyTCZTaYf-Uhamr82-3mNB_XZX7_b7tpJdMfSqw65TT02tcdc2Endn2rV1dW5lZfaVkoXtZSXbait3207WTVdK3ejt01Yrfda67faiqWhE60rnbmMZ4qWwKc3Ub2XTPm0Lh4pcWq_mz-8_v-eLkc9CSoX6St6I-vC4j_WUYp-JNmq-JNFUziZOH9Rs2S0nuDC1R9F-W5fbI_z43FjK4TOqmKPrB-Yp5U-XJyFPF8vDrEodRiFPmXt9NlMM_5BmIU9LhiTkaY1x6-W_AQAA__-1q1k6">