diff --git a/MonoGame.Framework/Graphics/GraphicsDevice.cs b/MonoGame.Framework/Graphics/GraphicsDevice.cs index b87d0350303..34135fa1201 100644 --- a/MonoGame.Framework/Graphics/GraphicsDevice.cs +++ b/MonoGame.Framework/Graphics/GraphicsDevice.cs @@ -738,7 +738,7 @@ public void SetVertexBuffers(params VertexBufferBinding[] vertexBuffers) int primitiveCount ) { // Flush the GL state before moving on! - ApplyState(true); + ApplyState(); // Unsigned short or unsigned int? bool shortIndices = Indices.IndexElementSize == IndexElementSize.SixteenBits; @@ -791,7 +791,7 @@ int instanceCount } // Flush the GL state before moving on! - ApplyState(true); + ApplyState(); // Unsigned short or unsigned int? bool shortIndices = Indices.IndexElementSize == IndexElementSize.SixteenBits; @@ -853,7 +853,7 @@ int primitiveCount VertexDeclaration vertexDeclaration ) where T : struct { // Flush the GL state before moving on! - ApplyState(true); + ApplyState(); // Unbind current VBOs. OpenGLDevice.Instance.BindVertexBuffer(0); @@ -886,8 +886,7 @@ VertexDeclaration vertexDeclaration public void DrawPrimitives(PrimitiveType primitiveType, int vertexStart, int primitiveCount) { // Flush the GL state before moving on! - ApplyState(true); - OpenGLDevice.Instance.FlushGLState(); + ApplyState(); // Set up the vertex buffers foreach (VertexBufferBinding vertBuffer in vertexBufferBindings) @@ -949,7 +948,7 @@ int primitiveCount VertexDeclaration vertexDeclaration ) where T : struct { // Flush the GL state before moving on! - ApplyState(true); + ApplyState(); // Unbind current buffer objects. OpenGLDevice.Instance.BindVertexBuffer(0); @@ -1016,7 +1015,7 @@ int primitiveCount VertexDeclaration vertexDeclaration ) where T : struct, IVertexType { // Flush the GL state before moving on! - ApplyState(true); + ApplyState(); // Unbind current buffer objects. OpenGLDevice.Instance.BindVertexBuffer(0); @@ -1093,7 +1092,7 @@ private static BeginMode PrimitiveTypeGL(PrimitiveType primitiveType) #region Private State Flush Methods - private void ApplyState(bool applyShaders) + private void ApplyState() { // Apply BlendState OpenGLDevice.Instance.AlphaBlendEnable.Set( @@ -1157,12 +1156,6 @@ private void ApplyState(bool applyShaders) // TODO: MSAA? - // If we're not applying shaders then drop out now. - if (!applyShaders) - { - return; - } - if (VertexShader == null) { throw new InvalidOperationException("A vertex shader must be set!");