fix bugs in retroshader sampler0 discovery

This commit is contained in:
zeromus 2015-10-18 21:12:58 -05:00
parent 32a1101713
commit 01f1be126e
4 changed files with 4 additions and 4 deletions

View File

@ -318,7 +318,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
if (type == ActiveUniformType.Sampler2D) if (type == ActiveUniformType.Sampler2D)
{ {
ui.IsSampler = true; ui.IsSampler = true;
ui.Index = loc; ui.SamplerIndex = samplers.Count;
ui.Opaque = loc | (samplers.Count << 24); ui.Opaque = loc | (samplers.Count << 24);
samplers.Add(loc); samplers.Add(loc);
} }

View File

@ -478,7 +478,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX
if (descr.Type == ParameterType.Sampler2D) if (descr.Type == ParameterType.Sampler2D)
{ {
ui.IsSampler = true; ui.IsSampler = true;
ui.Index = descr.RegisterIndex; ui.SamplerIndex = descr.RegisterIndex;
uw.SamplerIndex = descr.RegisterIndex; uw.SamplerIndex = descr.RegisterIndex;
} }
uniforms.Add(ui); uniforms.Add(ui);

View File

@ -46,7 +46,7 @@ namespace BizHawk.Bizware.BizwareGL
//sampler wasn't named correctly. this can happen on some retroarch shaders //sampler wasn't named correctly. this can happen on some retroarch shaders
foreach (var u in Pipeline.GetUniforms()) foreach (var u in Pipeline.GetUniforms())
{ {
if (u.Sole.IsSampler && u.Sole.Index == 0) if (u.Sole.IsSampler && u.Sole.SamplerIndex == 0)
{ {
sampler0 = u; sampler0 = u;
break; break;

View File

@ -7,7 +7,7 @@ namespace BizHawk.Bizware.BizwareGL
{ {
public object Opaque; public object Opaque;
public string Name; public string Name;
public int Index; public int SamplerIndex;
public bool IsSampler; public bool IsSampler;
} }
} }