mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-06 13:11:53 +00:00
Fixed memory leak when deleting Effect
This commit is contained in:
@@ -8,18 +8,17 @@ namespace GlitchyEngine.Renderer
|
||||
{
|
||||
extension BufferCollection
|
||||
{
|
||||
public static override int MaxBufferSlotCount => DirectX.D3D11.D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT;
|
||||
|
||||
internal ID3D11Buffer*[DirectX.D3D11.D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT] nativeBuffers;
|
||||
|
||||
internal void PlatformFetchNativeBuffers()
|
||||
{
|
||||
Debug.Profiler.ProfileRendererFunction!();
|
||||
|
||||
// Clear
|
||||
nativeBuffers = .();
|
||||
|
||||
for(let buffer in _buffers)
|
||||
{
|
||||
nativeBuffers[buffer.Index] = buffer.Buffer.nativeBuffer;
|
||||
nativeBuffers[@buffer] = buffer.Buffer?.nativeBuffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,10 +334,7 @@ namespace GlitchyEngine.Renderer
|
||||
_ps_FirstTexture = _firstTexture;
|
||||
_ps_BoundTextures = _textureCount;
|
||||
|
||||
for (var buffer in shader?.Buffers)
|
||||
{
|
||||
_psBuffers[buffer.Index] = buffer.Buffer.nativeBuffer;
|
||||
}
|
||||
_psBuffers = shader.Buffers.nativeBuffers;
|
||||
|
||||
//NativeContext.PixelShader.SetConstantBuffers(0, shader.Buffers.nativeBuffers.Count, &shader.Buffers.nativeBuffers);
|
||||
|
||||
@@ -351,11 +348,8 @@ namespace GlitchyEngine.Renderer
|
||||
NativeContext.VertexShader.SetShaderResources(_firstTexture, _textureCount, &_textures[_firstTexture]);
|
||||
NativeContext.VertexShader.SetSamplers(_firstTexture, _textureCount, &_samplers[_firstTexture]);
|
||||
}
|
||||
|
||||
for (var buffer in shader?.Buffers)
|
||||
{
|
||||
_vsBuffers[buffer.Index] = buffer.Buffer.nativeBuffer;
|
||||
}
|
||||
|
||||
_vsBuffers = shader.Buffers.nativeBuffers;
|
||||
|
||||
//NativeContext.VertexShader.SetConstantBuffers(0, shader.Buffers.nativeBuffers.Count, &shader.Buffers.nativeBuffers);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user