forked from MoonsideGames/MoonWorks
rework sampler binding API call
parent
44cd77eecb
commit
e6fa95b823
|
@ -213,12 +213,13 @@ namespace MoonWorks.Graphics
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe void BindVertexSamplers(
|
public unsafe void BindVertexSamplers(
|
||||||
params TextureSamplerBinding[] textureSamplerBindings
|
TextureSamplerBinding[] textureSamplerBindings,
|
||||||
|
int length
|
||||||
) {
|
) {
|
||||||
var texturePtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
var texturePtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
||||||
var samplerPtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
var samplerPtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
||||||
|
|
||||||
for (var i = 0; i < textureSamplerBindings.Length; i += 1)
|
for (var i = 0; i < length; i += 1)
|
||||||
{
|
{
|
||||||
texturePtrs[i] = textureSamplerBindings[i].Texture.Handle;
|
texturePtrs[i] = textureSamplerBindings[i].Texture.Handle;
|
||||||
samplerPtrs[i] = textureSamplerBindings[i].Sampler.Handle;
|
samplerPtrs[i] = textureSamplerBindings[i].Sampler.Handle;
|
||||||
|
@ -232,13 +233,20 @@ namespace MoonWorks.Graphics
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe void BindFragmentSamplers(
|
public unsafe void BindVertexSamplers(
|
||||||
params TextureSamplerBinding[] textureSamplerBindings
|
params TextureSamplerBinding[] textureSamplerBindings
|
||||||
|
) {
|
||||||
|
BindVertexSamplers(textureSamplerBindings, textureSamplerBindings.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
public unsafe void BindFragmentSamplers(
|
||||||
|
TextureSamplerBinding[] textureSamplerBindings,
|
||||||
|
int length
|
||||||
) {
|
) {
|
||||||
var texturePtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
var texturePtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
||||||
var samplerPtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
var samplerPtrs = stackalloc IntPtr[textureSamplerBindings.Length];
|
||||||
|
|
||||||
for (var i = 0; i < textureSamplerBindings.Length; i += 1)
|
for (var i = 0; i < length; i += 1)
|
||||||
{
|
{
|
||||||
texturePtrs[i] = textureSamplerBindings[i].Texture.Handle;
|
texturePtrs[i] = textureSamplerBindings[i].Texture.Handle;
|
||||||
samplerPtrs[i] = textureSamplerBindings[i].Sampler.Handle;
|
samplerPtrs[i] = textureSamplerBindings[i].Sampler.Handle;
|
||||||
|
@ -252,6 +260,12 @@ namespace MoonWorks.Graphics
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public unsafe void BindFragmentSamplers(
|
||||||
|
params TextureSamplerBinding[] textureSamplerBindings
|
||||||
|
) {
|
||||||
|
BindFragmentSamplers(textureSamplerBindings, textureSamplerBindings.Length);
|
||||||
|
}
|
||||||
|
|
||||||
public unsafe void Clear(
|
public unsafe void Clear(
|
||||||
in Rect clearRect,
|
in Rect clearRect,
|
||||||
ClearOptionsFlags clearOptions,
|
ClearOptionsFlags clearOptions,
|
||||||
|
|
Loading…
Reference in New Issue