no_specialization-attribute.azsl 803 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. [[no_specialization]]
  9. option bool UseGI = true;
  10. ShaderResourceGroupSemantic ExampleBinding
  11. {
  12. FrequencyId = 0;
  13. ShaderVariantFallback = 64;
  14. };
  15. ShaderResourceGroup ExampleSRG : ExampleBinding
  16. {
  17. float4 exampleColor;
  18. };
  19. struct VertexInput { float3 m_position : POSITION; };
  20. struct VertexOutput { float4 m_position : SV_Position; };
  21. VertexOutput MainVS(VertexInput input)
  22. {
  23. VertexOutput output;
  24. output.m_position = float4(input.m_position, 1.0);
  25. return output;
  26. }
  27. float4 MainPS() : SV_Target0
  28. {
  29. if (UseGI)
  30. return ExampleSRG::exampleColor;
  31. }