make display methods more resilient to uncompilable shaders

This commit is contained in:
zeromus 2015-10-17 19:27:58 -05:00
parent aa01b725a6
commit 0d5470a713
2 changed files with 13 additions and 1 deletions

View File

@ -179,6 +179,12 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
public Pipeline CreatePipeline(VertexLayout vertexLayout, Shader vertexShader, Shader fragmentShader, bool required, string memo)
{
//if the shaders arent available, the pipeline isn't either
if (!vertexShader.Available || !fragmentShader.Available)
{
return new Pipeline(this, null, false, null, null, null);
}
bool success = true;
var vsw = vertexShader.Opaque as ShaderWrapper;

View File

@ -29,7 +29,13 @@ namespace BizHawk.Bizware.BizwareGL
string psSource = "#define FRAGMENT\r\n" + defines + source;
var vs = owner.CreateVertexShader(true, vsSource, "main_vertex", debug);
var ps = owner.CreateFragmentShader(true, psSource, "main_fragment", debug);
Pipeline = Owner.CreatePipeline(VertexLayout, vs, ps, debug, "retro");
Pipeline = Owner.CreatePipeline(VertexLayout, vs, ps, debug, "retro");
if (!Pipeline.Available)
{
Available = false;
return;
}
//retroarch shaders will sometimes not have the right sampler name
//it's unclear whether we should bind to s_p or sampler0