2018-02-04 23:08:20 +00:00
|
|
|
using System;
|
2018-04-08 20:17:35 +01:00
|
|
|
using System.Collections.Generic;
|
2018-02-04 23:08:20 +00:00
|
|
|
|
2018-02-20 20:09:23 +00:00
|
|
|
namespace Ryujinx.Graphics.Gal
|
2018-02-04 23:08:20 +00:00
|
|
|
{
|
2018-02-23 21:48:27 +00:00
|
|
|
public unsafe interface IGalRenderer
|
2018-02-04 23:08:20 +00:00
|
|
|
{
|
|
|
|
void QueueAction(Action ActionMthd);
|
2018-04-13 19:12:58 +01:00
|
|
|
|
2018-02-04 23:08:20 +00:00
|
|
|
void RunActions();
|
|
|
|
|
|
|
|
void Render();
|
2018-04-13 19:12:58 +01:00
|
|
|
|
2018-02-23 21:48:27 +00:00
|
|
|
void SetWindowSize(int Width, int Height);
|
2018-03-01 02:37:40 +00:00
|
|
|
|
2018-04-08 20:17:35 +01:00
|
|
|
//Blend
|
|
|
|
void SetBlendEnable(bool Enable);
|
2018-03-01 02:37:40 +00:00
|
|
|
|
2018-04-08 20:17:35 +01:00
|
|
|
void SetBlend(
|
|
|
|
GalBlendEquation Equation,
|
|
|
|
GalBlendFactor FuncSrc,
|
|
|
|
GalBlendFactor FuncDst);
|
2018-03-01 02:37:40 +00:00
|
|
|
|
2018-04-08 20:17:35 +01:00
|
|
|
void SetBlendSeparate(
|
|
|
|
GalBlendEquation EquationRgb,
|
|
|
|
GalBlendEquation EquationAlpha,
|
|
|
|
GalBlendFactor FuncSrcRgb,
|
|
|
|
GalBlendFactor FuncDstRgb,
|
|
|
|
GalBlendFactor FuncSrcAlpha,
|
|
|
|
GalBlendFactor FuncDstAlpha);
|
|
|
|
|
|
|
|
//Frame Buffer
|
2018-04-13 19:12:58 +01:00
|
|
|
void CreateFrameBuffer(long Tag, int Width, int Height);
|
|
|
|
|
|
|
|
void BindFrameBuffer(long Tag);
|
|
|
|
|
|
|
|
void BindFrameBufferTexture(long Tag, int Index, GalTextureSampler Sampler);
|
|
|
|
|
|
|
|
void SetFrameBuffer(long Tag);
|
2018-04-08 20:17:35 +01:00
|
|
|
|
2018-04-13 19:12:58 +01:00
|
|
|
void SetFrameBuffer(byte[] Data, int Width, int Height);
|
2018-04-08 20:17:35 +01:00
|
|
|
|
2018-04-13 19:12:58 +01:00
|
|
|
void SetFrameBufferTransform(float SX, float SY, float Rotate, float TX, float TY);
|
2018-04-08 20:17:35 +01:00
|
|
|
|
2018-04-14 04:39:24 +01:00
|
|
|
void SetViewport(int X, int Y, int Width, int Height);
|
|
|
|
|
2018-04-26 03:11:26 +01:00
|
|
|
void GetFrameBufferData(long Tag, Action<byte[]> Callback);
|
|
|
|
|
2018-04-08 20:17:35 +01:00
|
|
|
//Rasterizer
|
|
|
|
void ClearBuffers(int RtIndex, GalClearBufferFlags Flags);
|
|
|
|
|
2018-06-09 01:15:56 +01:00
|
|
|
bool IsVboCached(long Tag, long DataSize);
|
2018-04-08 20:17:35 +01:00
|
|
|
|
2018-06-09 01:15:56 +01:00
|
|
|
bool IsIboCached(long Tag, long DataSize);
|
2018-04-08 20:17:35 +01:00
|
|
|
|
2018-06-09 01:15:56 +01:00
|
|
|
void CreateVbo(long Tag, byte[] Buffer);
|
2018-04-08 20:17:35 +01:00
|
|
|
|
2018-06-09 01:15:56 +01:00
|
|
|
void CreateIbo(long Tag, byte[] Buffer);
|
|
|
|
|
|
|
|
void SetVertexArray(int VbIndex, int Stride, long VboTag, GalVertexAttrib[] Attribs);
|
|
|
|
|
|
|
|
void SetIndexArray(long Tag, int Size, GalIndexFormat Format);
|
|
|
|
|
|
|
|
void DrawArrays(int First, int PrimCount, GalPrimitiveType PrimType);
|
|
|
|
|
|
|
|
void DrawElements(long IboTag, int First, GalPrimitiveType PrimType);
|
2018-04-08 20:17:35 +01:00
|
|
|
|
|
|
|
//Shader
|
2018-05-23 02:43:31 +01:00
|
|
|
void CreateShader(IGalMemory Memory, long Tag, GalShaderType Type);
|
2018-04-08 20:17:35 +01:00
|
|
|
|
|
|
|
IEnumerable<ShaderDeclInfo> GetTextureUsage(long Tag);
|
|
|
|
|
|
|
|
void SetConstBuffer(long Tag, int Cbuf, byte[] Data);
|
|
|
|
|
|
|
|
void SetUniform1(string UniformName, int Value);
|
|
|
|
|
2018-04-14 04:39:24 +01:00
|
|
|
void SetUniform2F(string UniformName, float X, float Y);
|
|
|
|
|
2018-04-08 20:17:35 +01:00
|
|
|
void BindShader(long Tag);
|
|
|
|
|
|
|
|
void BindProgram();
|
|
|
|
|
|
|
|
//Texture
|
2018-06-09 01:15:56 +01:00
|
|
|
void SetTextureAndSampler(long Tag, byte[] Data, GalTexture Texture, GalTextureSampler Sampler);
|
|
|
|
|
|
|
|
bool TryGetCachedTexture(long Tag, long DataSize, out GalTexture Texture);
|
2018-04-08 20:17:35 +01:00
|
|
|
|
2018-06-09 01:15:56 +01:00
|
|
|
void BindTexture(long Tag, int Index);
|
2018-02-04 23:08:20 +00:00
|
|
|
}
|
|
|
|
}
|