Created
November 29, 2015 18:46
-
-
Save 0x0ade/428847768e6681eac633 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Graphics/OpenGLDevice.cs b/src/Graphics/OpenGLDevice.cs | |
index f2451ec..d830a73 100644 | |
--- a/src/Graphics/OpenGLDevice.cs | |
+++ b/src/Graphics/OpenGLDevice.cs | |
@@ -8,7 +8,7 @@ | |
#endregion | |
#region DISABLE_FAUXBACKBUFFER Option | |
-#define DISABLE_FAUXBACKBUFFER | |
+// #define DISABLE_FAUXBACKBUFFER | |
/* If you want to debug GL without the extra FBO in your way, you can use this. | |
* Note that we only enable a faux-backbuffer when the window size is not equal | |
* to the backbuffer size! | |
@@ -1292,15 +1296,15 @@ namespace Microsoft.Xna.Framework.Graphics | |
blendState.AlphaSourceBlend == Blend.One && | |
blendState.AlphaDestinationBlend == Blend.Zero ) | |
); | |
- if (newEnable != alphaBlendEnable) | |
+ //if (newEnable != alphaBlendEnable) | |
{ | |
alphaBlendEnable = newEnable; | |
ToggleGLState(GLenum.GL_BLEND, alphaBlendEnable); | |
} | |
- if (alphaBlendEnable) | |
+ //if (alphaBlendEnable) | |
{ | |
- if (blendState.BlendFactor != blendColor) | |
+ //if (blendState.BlendFactor != blendColor) | |
{ | |
blendColor = blendState.BlendFactor; | |
glBlendColor( | |
@@ -1311,10 +1315,10 @@ namespace Microsoft.Xna.Framework.Graphics | |
); | |
} | |
- if ( blendState.ColorSourceBlend != srcBlend || | |
- blendState.ColorDestinationBlend != dstBlend || | |
- blendState.AlphaSourceBlend != srcBlendAlpha || | |
- blendState.AlphaDestinationBlend != dstBlendAlpha ) | |
+ //if ( blendState.ColorSourceBlend != srcBlend || | |
+ // blendState.ColorDestinationBlend != dstBlend || | |
+ // blendState.AlphaSourceBlend != srcBlendAlpha || | |
+ // blendState.AlphaDestinationBlend != dstBlendAlpha ) | |
{ | |
srcBlend = blendState.ColorSourceBlend; | |
dstBlend = blendState.ColorDestinationBlend; | |
@@ -1328,8 +1332,8 @@ namespace Microsoft.Xna.Framework.Graphics | |
); | |
} | |
- if ( blendState.ColorBlendFunction != blendOp || | |
- blendState.AlphaBlendFunction != blendOpAlpha ) | |
+ //if ( blendState.ColorBlendFunction != blendOp || | |
+ // blendState.AlphaBlendFunction != blendOpAlpha ) | |
{ | |
blendOp = blendState.ColorBlendFunction; | |
blendOpAlpha = blendState.AlphaBlendFunction; | |
@@ -1340,7 +1344,7 @@ namespace Microsoft.Xna.Framework.Graphics | |
} | |
} | |
- if (blendState.ColorWriteChannels != colorWriteEnable) | |
+ //if (blendState.ColorWriteChannels != colorWriteEnable) | |
{ | |
colorWriteEnable = blendState.ColorWriteChannels; | |
glColorMask( | |
@@ -1403,34 +1407,34 @@ namespace Microsoft.Xna.Framework.Graphics | |
public void SetDepthStencilState(DepthStencilState depthStencilState) | |
{ | |
- if (depthStencilState.DepthBufferEnable != zEnable) | |
+ //if (depthStencilState.DepthBufferEnable != zEnable) | |
{ | |
zEnable = depthStencilState.DepthBufferEnable; | |
ToggleGLState(GLenum.GL_DEPTH_TEST, zEnable); | |
} | |
- if (zEnable) | |
+ //if (zEnable) | |
{ | |
- if (depthStencilState.DepthBufferWriteEnable != zWriteEnable) | |
+ //if (depthStencilState.DepthBufferWriteEnable != zWriteEnable) | |
{ | |
zWriteEnable = depthStencilState.DepthBufferWriteEnable; | |
glDepthMask(zWriteEnable); | |
} | |
- if (depthStencilState.DepthBufferFunction != depthFunc) | |
+ //if (depthStencilState.DepthBufferFunction != depthFunc) | |
{ | |
depthFunc = depthStencilState.DepthBufferFunction; | |
glDepthFunc(XNAToGL.CompareFunc[(int) depthFunc]); | |
} | |
} | |
- if (depthStencilState.StencilEnable != stencilEnable) | |
+ //if (depthStencilState.StencilEnable != stencilEnable) | |
{ | |
stencilEnable = depthStencilState.StencilEnable; | |
ToggleGLState(GLenum.GL_STENCIL_TEST, stencilEnable); | |
} | |
- if (stencilEnable) | |
+ //if (stencilEnable) | |
{ | |
if (depthStencilState.StencilWriteMask != stencilWriteMask) | |
{ | |
@@ -1439,7 +1443,7 @@ namespace Microsoft.Xna.Framework.Graphics | |
} | |
// TODO: Can we split StencilFunc/StencilOp up nicely? -flibit | |
- if ( depthStencilState.TwoSidedStencilMode != separateStencilEnable || | |
+ /*if ( depthStencilState.TwoSidedStencilMode != separateStencilEnable || | |
depthStencilState.ReferenceStencil != stencilRef || | |
depthStencilState.StencilMask != stencilMask || | |
depthStencilState.StencilFunction != stencilFunc || | |
@@ -1449,7 +1453,7 @@ namespace Microsoft.Xna.Framework.Graphics | |
depthStencilState.StencilPass != stencilPass || | |
depthStencilState.CounterClockwiseStencilFail != ccwStencilFail || | |
depthStencilState.CounterClockwiseStencilDepthBufferFail != ccwStencilZFail || | |
- depthStencilState.CounterClockwiseStencilPass != ccwStencilPass ) | |
+ depthStencilState.CounterClockwiseStencilPass != ccwStencilPass )*/ | |
{ | |
separateStencilEnable = depthStencilState.TwoSidedStencilMode; | |
stencilRef = depthStencilState.ReferenceStencil; | |
@@ -1510,7 +1514,7 @@ namespace Microsoft.Xna.Framework.Graphics | |
RasterizerState rasterizerState, | |
bool renderTargetBound | |
) { | |
- if (rasterizerState.ScissorTestEnable != scissorTestEnable) | |
+ //if (rasterizerState.ScissorTestEnable != scissorTestEnable) | |
{ | |
scissorTestEnable = rasterizerState.ScissorTestEnable; | |
ToggleGLState(GLenum.GL_SCISSOR_TEST, scissorTestEnable); | |
@@ -1537,7 +1541,7 @@ namespace Microsoft.Xna.Framework.Graphics | |
); | |
} | |
} | |
- if (actualMode != cullFrontFace) | |
+ //if (actualMode != cullFrontFace) | |
{ | |
if ((actualMode == CullMode.None) != (cullFrontFace == CullMode.None)) | |
{ | |
@@ -1633,7 +1637,7 @@ namespace Microsoft.Xna.Framework.Graphics | |
} | |
// Set the active texture slot | |
- if (index != 0) | |
+ //if (index != 0) | |
{ | |
glActiveTexture(GLenum.GL_TEXTURE0 + index); | |
} | |
@@ -1651,7 +1655,7 @@ namespace Microsoft.Xna.Framework.Graphics | |
} | |
// Apply the sampler states to the GL texture | |
- if (sampler.AddressU != tex.WrapS) | |
+ /*if (sampler.AddressU != tex.WrapS) | |
{ | |
tex.WrapS = sampler.AddressU; | |
glTexParameteri( | |
@@ -1721,9 +1725,9 @@ namespace Microsoft.Xna.Framework.Graphics | |
GLenum.GL_TEXTURE_LOD_BIAS, | |
tex.LODBias | |
); | |
- } | |
+ }*/ | |
- if (index != 0) | |
+ //if (index != 0) | |
{ | |
// Keep this state sane. -flibit | |
glActiveTexture(GLenum.GL_TEXTURE0); | |
@@ -2360,7 +2364,7 @@ namespace Microsoft.Xna.Framework.Graphics | |
levelCount | |
); | |
BindTexture(result); | |
- glTexParameteri( | |
+ /*glTexParameteri( | |
result.Target, | |
GLenum.GL_TEXTURE_WRAP_S, | |
XNAToGL.Wrap[(int) result.WrapS] | |
@@ -2396,7 +2400,7 @@ namespace Microsoft.Xna.Framework.Graphics | |
result.Target, | |
GLenum.GL_TEXTURE_BASE_LEVEL, | |
result.MaxMipmapLevel | |
- ); | |
+ );*/ | |
if (!useES2) | |
{ | |
glTexParameterf( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment