Some code cleanup

This commit is contained in:
gdkchan 2019-12-29 14:41:50 -03:00 committed by Thog
parent af8498d679
commit 654e617fe7
60 changed files with 432 additions and 591 deletions

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Sampler
namespace Ryujinx.Graphics.GAL
{
public enum AddressMode
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Blend
namespace Ryujinx.Graphics.GAL
{
public struct BlendDescriptor
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Blend
namespace Ryujinx.Graphics.GAL
{
public enum BlendFactor
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Blend
namespace Ryujinx.Graphics.GAL
{
public enum BlendOp
{

View file

@ -1,18 +0,0 @@
namespace Ryujinx.Graphics.GAL.Color
{
public struct ColorSI
{
public int Red { get; }
public int Green { get; }
public int Blue { get; }
public int Alpha { get; }
public ColorSI(int red, int green, int blue, int alpha)
{
Red = red;
Green = green;
Blue = blue;
Alpha = alpha;
}
}
}

View file

@ -1,18 +0,0 @@
namespace Ryujinx.Graphics.GAL.Color
{
public struct ColorUI
{
public uint Red { get; }
public uint Green { get; }
public uint Blue { get; }
public uint Alpha { get; }
public ColorUI(uint red, uint green, uint blue, uint alpha)
{
Red = red;
Green = green;
Blue = blue;
Alpha = alpha;
}
}
}

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Color
namespace Ryujinx.Graphics.GAL
{
public struct ColorF
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Sampler
namespace Ryujinx.Graphics.GAL
{
public enum CompareMode
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Texture
namespace Ryujinx.Graphics.GAL
{
public enum DepthStencilMode
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.DepthStencil
namespace Ryujinx.Graphics.GAL
{
public struct DepthStencilState
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.DepthStencil
namespace Ryujinx.Graphics.GAL
{
public struct DepthTestDescriptor
{

View file

@ -1,33 +1,10 @@
using Ryujinx.Graphics.GAL.Blend;
using Ryujinx.Graphics.GAL.Color;
using Ryujinx.Graphics.GAL.DepthStencil;
using Ryujinx.Graphics.GAL.InputAssembler;
using Ryujinx.Graphics.Shader;
namespace Ryujinx.Graphics.GAL
{
public interface IPipeline
{
void BindBlendState(int index, BlendDescriptor blend);
void BindIndexBuffer(BufferRange buffer, IndexType type);
void BindImage(int index, ShaderStage stage, ITexture texture);
void BindProgram(IProgram program);
void BindSampler(int index, ShaderStage stage, ISampler sampler);
void BindTexture(int index, ShaderStage stage, ITexture texture);
void BindStorageBuffer(int index, ShaderStage stage, BufferRange buffer);
void BindUniformBuffer(int index, ShaderStage stage, BufferRange buffer);
void BindVertexAttribs(VertexAttribDescriptor[] vertexAttribs);
void BindVertexBuffers(VertexBufferDescriptor[] vertexBuffers);
void ClearRenderTargetColor(int index, uint componentMask, ColorF color);
void ClearRenderTargetColor(int index, uint componentMask, ColorSI color);
void ClearRenderTargetColor(int index, uint componentMask, ColorUI color);
void ClearRenderTargetDepthStencil(
float depthValue,
@ -35,7 +12,7 @@ namespace Ryujinx.Graphics.GAL
int stencilValue,
int stencilMask);
void Dispatch(int groupsX, int groupsY, int groupsZ);
void DispatchCompute(int groupsX, int groupsY, int groupsZ);
void Draw(int vertexCount, int instanceCount, int firstVertex, int firstInstance);
void DrawIndexed(
@ -45,6 +22,8 @@ namespace Ryujinx.Graphics.GAL
int firstVertex,
int firstInstance);
void SetBlendState(int index, BlendDescriptor blend);
void SetBlendColor(ColorF color);
void SetDepthBias(PolygonModeMask enables, float factor, float units, float clamp);
@ -57,16 +36,33 @@ namespace Ryujinx.Graphics.GAL
void SetFrontFace(FrontFace frontFace);
void SetIndexBuffer(BufferRange buffer, IndexType type);
void SetImage(int index, ShaderStage stage, ITexture texture);
void SetPrimitiveRestart(bool enable, int index);
void SetPrimitiveTopology(PrimitiveTopology topology);
void SetProgram(IProgram program);
void SetRenderTargetColorMasks(uint[] componentMask);
void SetRenderTargets(ITexture[] colors, ITexture depthStencil);
void SetSampler(int index, ShaderStage stage, ISampler sampler);
void SetStencilTest(StencilTestDescriptor stencilTest);
void SetStorageBuffer(int index, ShaderStage stage, BufferRange buffer);
void SetTexture(int index, ShaderStage stage, ITexture texture);
void SetUniformBuffer(int index, ShaderStage stage, BufferRange buffer);
void SetVertexAttribs(VertexAttribDescriptor[] vertexAttribs);
void SetVertexBuffers(VertexBufferDescriptor[] vertexBuffers);
void SetViewports(int first, Viewport[] viewports);
void TextureBarrier();

View file

@ -1,5 +1,3 @@
using Ryujinx.Graphics.GAL.Sampler;
using Ryujinx.Graphics.GAL.Texture;
using Ryujinx.Graphics.Shader;
namespace Ryujinx.Graphics.GAL

View file

@ -1,4 +1,3 @@
using Ryujinx.Graphics.GAL.Texture;
using System;
namespace Ryujinx.Graphics.GAL

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Sampler
namespace Ryujinx.Graphics.GAL
{
public enum MagFilter
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Sampler
namespace Ryujinx.Graphics.GAL
{
public enum MinFilter
{

View file

@ -1,6 +1,4 @@
using Ryujinx.Graphics.GAL.Color;
namespace Ryujinx.Graphics.GAL.Sampler
namespace Ryujinx.Graphics.GAL
{
public struct SamplerCreateInfo
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.DepthStencil
namespace Ryujinx.Graphics.GAL
{
public enum StencilOp
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.DepthStencil
namespace Ryujinx.Graphics.GAL
{
public struct StencilTestDescriptor
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Texture
namespace Ryujinx.Graphics.GAL
{
public enum SwizzleComponent
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.Texture
namespace Ryujinx.Graphics.GAL
{
public enum Target
{

View file

@ -1,7 +1,7 @@
using Ryujinx.Common;
using System;
namespace Ryujinx.Graphics.GAL.Texture
namespace Ryujinx.Graphics.GAL
{
public struct TextureCreateInfo
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.InputAssembler
namespace Ryujinx.Graphics.GAL
{
public struct VertexAttribDescriptor
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.Graphics.GAL.InputAssembler
namespace Ryujinx.Graphics.GAL
{
public struct VertexBufferDescriptor
{