IGalRenderer.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.Graphics.Gal
  4. {
  5. public unsafe interface IGalRenderer
  6. {
  7. void QueueAction(Action ActionMthd);
  8. void RunActions();
  9. void Render();
  10. void SetWindowSize(int Width, int Height);
  11. //Blend
  12. void SetBlendEnable(bool Enable);
  13. void SetBlend(
  14. GalBlendEquation Equation,
  15. GalBlendFactor FuncSrc,
  16. GalBlendFactor FuncDst);
  17. void SetBlendSeparate(
  18. GalBlendEquation EquationRgb,
  19. GalBlendEquation EquationAlpha,
  20. GalBlendFactor FuncSrcRgb,
  21. GalBlendFactor FuncDstRgb,
  22. GalBlendFactor FuncSrcAlpha,
  23. GalBlendFactor FuncDstAlpha);
  24. //Frame Buffer
  25. void CreateFrameBuffer(long Tag, int Width, int Height);
  26. void BindFrameBuffer(long Tag);
  27. void BindFrameBufferTexture(long Tag, int Index, GalTextureSampler Sampler);
  28. void SetFrameBuffer(long Tag);
  29. void SetFrameBuffer(byte[] Data, int Width, int Height);
  30. void SetFrameBufferTransform(float SX, float SY, float Rotate, float TX, float TY);
  31. void SetViewport(int X, int Y, int Width, int Height);
  32. void GetFrameBufferData(long Tag, Action<byte[]> Callback);
  33. //Rasterizer
  34. void ClearBuffers(int RtIndex, GalClearBufferFlags Flags);
  35. bool IsVboCached(long Tag, long DataSize);
  36. bool IsIboCached(long Tag, long DataSize);
  37. void CreateVbo(long Tag, byte[] Buffer);
  38. void CreateIbo(long Tag, byte[] Buffer);
  39. void SetVertexArray(int VbIndex, int Stride, long VboTag, GalVertexAttrib[] Attribs);
  40. void SetIndexArray(long Tag, int Size, GalIndexFormat Format);
  41. void DrawArrays(int First, int PrimCount, GalPrimitiveType PrimType);
  42. void DrawElements(long IboTag, int First, GalPrimitiveType PrimType);
  43. //Shader
  44. void CreateShader(IGalMemory Memory, long Tag, GalShaderType Type);
  45. IEnumerable<ShaderDeclInfo> GetTextureUsage(long Tag);
  46. void SetConstBuffer(long Tag, int Cbuf, byte[] Data);
  47. void SetUniform1(string UniformName, int Value);
  48. void SetUniform2F(string UniformName, float X, float Y);
  49. void BindShader(long Tag);
  50. void BindProgram();
  51. //Texture
  52. void SetTextureAndSampler(long Tag, byte[] Data, GalTexture Texture, GalTextureSampler Sampler);
  53. bool TryGetCachedTexture(long Tag, long DataSize, out GalTexture Texture);
  54. void BindTexture(long Tag, int Index);
  55. }
  56. }