TextureSamplerBinding now stores IntPtrs
parent
4756fe2b14
commit
9862bfd0a0
|
@ -1,14 +1,22 @@
|
||||||
namespace MoonWorks.Graphics
|
using System;
|
||||||
|
|
||||||
|
namespace MoonWorks.Graphics
|
||||||
{
|
{
|
||||||
public struct TextureSamplerBinding
|
public struct TextureSamplerBinding
|
||||||
{
|
{
|
||||||
public Texture Texture;
|
public IntPtr TextureHandle;
|
||||||
public Sampler Sampler;
|
public IntPtr SamplerHandle;
|
||||||
|
|
||||||
public TextureSamplerBinding(Texture texture, Sampler sampler)
|
public TextureSamplerBinding(Texture texture, Sampler sampler)
|
||||||
{
|
{
|
||||||
Texture = texture;
|
TextureHandle = texture.Handle;
|
||||||
Sampler = sampler;
|
SamplerHandle = sampler.Handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextureSamplerBinding(IntPtr textureHandle, IntPtr samplerHandle)
|
||||||
|
{
|
||||||
|
TextureHandle = textureHandle;
|
||||||
|
SamplerHandle = samplerHandle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -425,8 +425,8 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
for (var i = 0; i < length; i += 1)
|
for (var i = 0; i < length; i += 1)
|
||||||
{
|
{
|
||||||
texturePtrs[i] = textureSamplerBindings[i].Texture.Handle;
|
texturePtrs[i] = textureSamplerBindings[i].TextureHandle;
|
||||||
samplerPtrs[i] = textureSamplerBindings[i].Sampler.Handle;
|
samplerPtrs[i] = textureSamplerBindings[i].SamplerHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
Refresh.Refresh_BindVertexSamplers(
|
Refresh.Refresh_BindVertexSamplers(
|
||||||
|
@ -464,18 +464,18 @@ namespace MoonWorks.Graphics
|
||||||
for (var i = 0; i < length; i += 1)
|
for (var i = 0; i < length; i += 1)
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if (textureSamplerBindings[i].Texture == null)
|
if (textureSamplerBindings[i].TextureHandle == IntPtr.Zero)
|
||||||
{
|
{
|
||||||
throw new NullReferenceException("Texture binding must not be null!");
|
throw new NullReferenceException("Texture binding must not be null!");
|
||||||
}
|
}
|
||||||
if (textureSamplerBindings[i].Texture == null)
|
if (textureSamplerBindings[i].TextureHandle == IntPtr.Zero)
|
||||||
{
|
{
|
||||||
throw new NullReferenceException("Sampler binding must not be null!");
|
throw new NullReferenceException("Sampler binding must not be null!");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
texturePtrs[i] = textureSamplerBindings[i].Texture.Handle;
|
texturePtrs[i] = textureSamplerBindings[i].TextureHandle;
|
||||||
samplerPtrs[i] = textureSamplerBindings[i].Sampler.Handle;
|
samplerPtrs[i] = textureSamplerBindings[i].SamplerHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
Refresh.Refresh_BindFragmentSamplers(
|
Refresh.Refresh_BindFragmentSamplers(
|
||||||
|
|
Loading…
Reference in New Issue