aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL/OGLShaderProgram.cs
diff options
context:
space:
mode:
authorAlex Barney <thealexbarney@gmail.com>2019-03-03 19:45:25 -0600
committerjduncanator <1518948+jduncanator@users.noreply.github.com>2019-03-04 12:45:25 +1100
commit1f554c1093dde6a4d3ed80fae2675abfb6c12fac (patch)
treebbbdfb87999168288777ac404081f3e49c7440ae /Ryujinx.Graphics/Gal/OpenGL/OGLShaderProgram.cs
parent8e71ea0812f6b56ff819dbda951b463bcb5eb8dc (diff)
Do naming refactoring on Ryujinx.Graphics (#611)
* Renaming part 1 * Renaming part 2 * Renaming part 3 * Renaming part 4 * Renaming part 5 * Renaming part 6 * Renaming part 7 * Renaming part 8 * Renaming part 9 * Renaming part 10 * General cleanup * Thought I got all of these * Apply #595 * Additional renaming * Tweaks from feedback * Rename files
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLShaderProgram.cs')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLShaderProgram.cs86
1 files changed, 0 insertions, 86 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLShaderProgram.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLShaderProgram.cs
deleted file mode 100644
index c87b0d40..00000000
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLShaderProgram.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-using OpenTK.Graphics.OpenGL;
-using System;
-using System.Collections.Generic;
-
-namespace Ryujinx.Graphics.Gal.OpenGL
-{
- struct OGLShaderProgram
- {
- public OGLShaderStage Vertex;
- public OGLShaderStage TessControl;
- public OGLShaderStage TessEvaluation;
- public OGLShaderStage Geometry;
- public OGLShaderStage Fragment;
- }
-
- class OGLShaderStage : IDisposable
- {
- public int Handle { get; private set; }
-
- public bool IsCompiled { get; private set; }
-
- public GalShaderType Type { get; private set; }
-
- public string Code { get; private set; }
-
- public IEnumerable<ShaderDeclInfo> ConstBufferUsage { get; private set; }
- public IEnumerable<ShaderDeclInfo> TextureUsage { get; private set; }
-
- public OGLShaderStage(
- GalShaderType Type,
- string Code,
- IEnumerable<ShaderDeclInfo> ConstBufferUsage,
- IEnumerable<ShaderDeclInfo> TextureUsage)
- {
- this.Type = Type;
- this.Code = Code;
- this.ConstBufferUsage = ConstBufferUsage;
- this.TextureUsage = TextureUsage;
- }
-
- public void Compile()
- {
- if (Handle == 0)
- {
- Handle = GL.CreateShader(OGLEnumConverter.GetShaderType(Type));
-
- CompileAndCheck(Handle, Code);
- }
- }
-
- public void Dispose()
- {
- Dispose(true);
- }
-
- protected virtual void Dispose(bool Disposing)
- {
- if (Disposing && Handle != 0)
- {
- GL.DeleteShader(Handle);
-
- Handle = 0;
- }
- }
-
- public static void CompileAndCheck(int Handle, string Code)
- {
- GL.ShaderSource(Handle, Code);
- GL.CompileShader(Handle);
-
- CheckCompilation(Handle);
- }
-
- private static void CheckCompilation(int Handle)
- {
- int Status = 0;
-
- GL.GetShader(Handle, ShaderParameter.CompileStatus, out Status);
-
- if (Status == 0)
- {
- throw new ShaderException(GL.GetShaderInfoLog(Handle));
- }
- }
- }
-} \ No newline at end of file