attribute-specifiers-standard.azsl 953 B

123456789101112131415161718192021222324252627282930
  1. // Attribute specifier sequences are supported as defined by the C++11 standard:
  2. // https://en.cppreference.com/w/cpp/language/attributes
  3. // C++17, C++20 standard features (using, contracts) are not yet supported
  4. [[global::ps::output_format(0, "FMT_32_R")]]
  5. [[global::ps::output_format(1, "FMT_32_GR")]]
  6. [[global::ps::output_format(2, "FMT_32_AR")]]
  7. [[global::ps::output_format(3, "FMT_32_ABGR")]]
  8. [[attribute]]
  9. [[scope::attribute]]
  10. [[scope::attribute(2, "string", true, false, 1.0f)]]
  11. [[ps::output_format, single(5)]]
  12. [[scope::attribute]]
  13. // Attribute sequences should be supported for all type qualifiers
  14. struct VSInput {
  15. [[vk::location(0)]] float4 pos : POSITION;
  16. [[vk::location(1)]] float3 norm : NORMAL;
  17. };
  18. [[vk::location(1)]]
  19. float4 VSMain(in VSInput input,
  20. [[vk::location(2)]]
  21. in float4 tex : TEXCOORD,
  22. out float4 pos : SV_Position) : TEXCOORD {
  23. pos = input.pos;
  24. return tex;
  25. }