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