ogl display method: dont crash when disposing if user's system can't compile shaders. also print some diagnostics for cgc failures to console
This commit is contained in:
parent
7880cbabb3
commit
fd63acd644
|
@ -346,6 +346,11 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
|||
public void FreePipeline(Pipeline pipeline)
|
||||
{
|
||||
var pw = pipeline.Opaque as PipelineWrapper;
|
||||
|
||||
//unavailable pipelines will have no opaque
|
||||
if (pw == null)
|
||||
return;
|
||||
|
||||
GL.DeleteProgram(pw.pid);
|
||||
|
||||
pw.FragmentShader.Release();
|
||||
|
@ -686,9 +691,13 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
|||
{
|
||||
var cgc = new CGC();
|
||||
var results = cgc.Run(source, entry, type == ShaderType.FragmentShader ? "glslf" : "glslv", false);
|
||||
|
||||
|
||||
if (!results.Succeeded)
|
||||
{
|
||||
Console.WriteLine("CGC failed");
|
||||
Console.WriteLine(results.Errors);
|
||||
return new Shader(this, null, false);
|
||||
}
|
||||
|
||||
source = results.Code;
|
||||
sw.MapCodeToNative = results.MapCodeToNative;
|
||||
|
|
Loading…
Reference in New Issue