TextureOperation.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
  2. {
  3. class TextureOperation : Operation
  4. {
  5. public SamplerType Type { get; private set; }
  6. public TextureFlags Flags { get; private set; }
  7. public int Handle { get; private set; }
  8. public TextureFormat Format { get; set; }
  9. public TextureOperation(
  10. Instruction inst,
  11. SamplerType type,
  12. TextureFlags flags,
  13. int handle,
  14. int compIndex,
  15. Operand dest,
  16. params Operand[] sources) : base(inst, compIndex, dest, sources)
  17. {
  18. Type = type;
  19. Flags = flags;
  20. Handle = handle;
  21. }
  22. public void TurnIntoIndexed(int handle)
  23. {
  24. Type |= SamplerType.Indexed;
  25. Flags &= ~TextureFlags.Bindless;
  26. Handle = handle;
  27. }
  28. public void SetHandle(int handle)
  29. {
  30. if ((Flags & TextureFlags.Bindless) != 0)
  31. {
  32. Flags &= ~TextureFlags.Bindless;
  33. RemoveSource(0);
  34. }
  35. Handle = handle;
  36. }
  37. }
  38. }