name-collision-avoidance.azsl 914 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ShaderResourceGroupSemantic UpdateSrgOne
  2. {
  3. FrequencyId = 1;
  4. };
  5. ShaderResourceGroup MySRGOne : UpdateSrgOne
  6. {
  7. struct InnerStruct
  8. {
  9. float4 m_diffuseColor;
  10. };
  11. ConstantBuffer<InnerStruct> m_materialConstants;
  12. // meta attack -> repeat a translation with a risk of colliding with the renamed translation of the previous symbol.
  13. struct InnerStruct3
  14. {
  15. half4 m_specularColor;
  16. };
  17. };
  18. // vector of attack
  19. struct MySRGOne_InnerStruct
  20. {
  21. float4 clr;
  22. };
  23. // waiting at the corner !
  24. struct MySRGOne_InnerStruct1{};
  25. struct MySRGOne_InnerStruct2
  26. {
  27. float2 uv;
  28. };
  29. float4 main(float2 uv) : SV_Target0
  30. {
  31. MySRGOne::InnerStruct mystruct = MySRGOne::m_materialConstants;
  32. float4 d1 = mystruct.clr;
  33. float4 d2 = MySRGOne::m_materialConstants.m_diffuseColor;
  34. MySRGOne::InnerStruct3 meta;
  35. MySRGOne_InnerStruct2 myuv;
  36. myuv.uv = uv;
  37. return (float4)0;
  38. }