TextureDefinition.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. namespace Ryujinx.Graphics.Shader
  2. {
  3. readonly struct TextureDefinition
  4. {
  5. public int Set { get; }
  6. public int Binding { get; }
  7. public int ArrayLength { get; }
  8. public bool Separate { get; }
  9. public string Name { get; }
  10. public SamplerType Type { get; }
  11. public TextureFormat Format { get; }
  12. public TextureUsageFlags Flags { get; }
  13. public TextureDefinition(
  14. int set,
  15. int binding,
  16. int arrayLength,
  17. bool separate,
  18. string name,
  19. SamplerType type,
  20. TextureFormat format,
  21. TextureUsageFlags flags)
  22. {
  23. Set = set;
  24. Binding = binding;
  25. ArrayLength = arrayLength;
  26. Separate = separate;
  27. Name = name;
  28. Type = type;
  29. Format = format;
  30. Flags = flags;
  31. }
  32. public TextureDefinition(int set, int binding, string name, SamplerType type) : this(set, binding, 1, false, name, type, TextureFormat.Unknown, TextureUsageFlags.None)
  33. {
  34. }
  35. public TextureDefinition SetFlag(TextureUsageFlags flag)
  36. {
  37. return new TextureDefinition(Set, Binding, ArrayLength, Separate, Name, Type, Format, Flags | flag);
  38. }
  39. }
  40. }