Permalink
Browse files

video-gliden64: Update to commit 3dcee1c.

gonetz/GLideN64@3dcee1c

* 3dcee1c Revert "Implement special case when 8bit auxiliary I buffer is used as 8bit IA texture."
* b7917ed Allow building with GLES on windows
* b897c44 Fix shader texture uniforms update for GLES2.
* 12bc0c9 Add blend mode for explosions in Vigilante 8.
* d5a0f20 Implement special case when 8bit auxiliary I buffer is used as 8bit IA texture.
  • Loading branch information...
Gillou68310 committed Jun 23, 2015
1 parent a9b9e1e commit 3b47078526a06f2864fe545f39d2c914f4e3950a
@@ -295,8 +295,8 @@ void CombinerInfo::updateLightParameters()
gSP.changed &= ~CHANGED_LIGHT;
}
-void CombinerInfo::updateParameters()
+void CombinerInfo::updateParameters(OGLRender::RENDER_STATE _renderState)
{
if (m_pUniformCollection != NULL)
- m_pUniformCollection->updateUniforms(m_pCurrent);
+ m_pUniformCollection->updateUniforms(m_pCurrent, _renderState);
}
@@ -138,7 +138,7 @@ class CombinerInfo
void updateTextureParameters();
void updateLightParameters();
// Update uniforms for GL without UniformBlock support
- void updateParameters();
+ void updateParameters(OGLRender::RENDER_STATE _renderState);
private:
CombinerInfo() : m_bChanged(false), m_pCurrent(NULL) {}
@@ -763,7 +763,7 @@ void FrameBufferList::renderBuffer(u32 _address)
textureCache().activateTexture(0, pBuffer->m_pTexture);
gSP.textureTile[0]->fuls = gSP.textureTile[0]->fult = 0.0f;
currentCombiner()->updateTextureInfo(true);
- CombinerInfo::get().updateParameters();
+ CombinerInfo::get().updateParameters(OGLRender::rsTexRect);
glScissor(0, 0, ogl.getScreenWidth(), ogl.getScreenHeight() + ogl.getHeightOffset());
@@ -126,14 +126,13 @@ void UniformSet::_updateLightUniforms(UniformSetLocation & _location, bool _bFor
}
}
-void UniformSet::updateUniforms(ShaderCombiner * _pCombiner)
+void UniformSet::updateUniforms(ShaderCombiner * _pCombiner, OGLRender::RENDER_STATE _renderState)
{
UniformSetLocation & location = m_uniforms.at(_pCombiner->getMux());
_updateColorUniforms(location, false);
- OGLRender::RENDER_STATE rs = video().getRender().getRenderState();
- if ((rs == OGLRender::rsTriangle || rs == OGLRender::rsLine) && _pCombiner->usesTexture())
+ if ((_renderState == OGLRender::rsTriangle || _renderState == OGLRender::rsLine) && _pCombiner->usesTexture())
_updateTextureUniforms(location, _pCombiner->usesTile(0), _pCombiner->usesTile(1), false);
if (_pCombiner->usesTexture())
@@ -14,7 +14,7 @@ class UniformSet : public UniformCollection
virtual void setColorData(ColorUniforms _index, u32 _dataSize, const void * _data) {}
virtual void updateTextureParameters() {}
virtual void updateLightParameters() {}
- virtual void updateUniforms(ShaderCombiner * _pCombiner);
+ virtual void updateUniforms(ShaderCombiner * _pCombiner, OGLRender::RENDER_STATE _renderState);
private:
struct fv3Uniform {
@@ -13,7 +13,7 @@ class UniformBlock : public UniformCollection
virtual void setColorData(ColorUniforms _index, u32 _dataSize, const void * _data);
virtual void updateTextureParameters();
virtual void updateLightParameters();
- virtual void updateUniforms(ShaderCombiner * _pCombiner) {}
+ virtual void updateUniforms(ShaderCombiner * /*_pCombiner*/, OGLRender::RENDER_STATE /*_renderState*/) {}
private:
void _initTextureBuffer(GLuint _program);
@@ -425,6 +425,9 @@ void OGLRender::_setBlendMode() const
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
break;
+ case 0x5000: // V8 explosions
+ glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA);
+ break;
default:
//LOG(LOG_VERBOSE, "Unhandled blend mode=%x", gDP.otherMode.l >> 16);
@@ -631,7 +634,7 @@ void OGLRender::_updateStates(RENDER_STATE _renderState) const
gDP.changed &= ~(CHANGED_RENDERMODE | CHANGED_CYCLETYPE);
}
- cmbInfo.updateParameters();
+ cmbInfo.updateParameters(_renderState);
}
void OGLRender::_setColorArray() const
@@ -2,16 +2,13 @@
#define OPENGL_H
#include <vector>
+
#ifdef OS_WINDOWS
#include <windows.h>
-#include <GL/gl.h>
-#include "glext.h"
-#include "windows/GLFunctions.h"
-#define GL_IMAGE_TEXTURES_SUPPORT
-#define GL_MULTISAMPLING_SUPPORT
-#define GL_UNIFORMBLOCK_SUPPORT
#else
#include "winlnxdefs.h"
+#endif
+
#ifdef GLES2
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
@@ -34,23 +31,32 @@ typedef char GLchar;
#define GL_MULTISAMPLING_SUPPORT
#define GL_UNIFORMBLOCK_SUPPORT
#else
-#define GL_GLEXT_PROTOTYPES
#if defined(OS_MAC_OS_X)
+#define GL_GLEXT_PROTOTYPES
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#elif defined(OS_LINUX)
+#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>
#define GL_IMAGE_TEXTURES_SUPPORT
#define GL_MULTISAMPLING_SUPPORT
#define GL_UNIFORMBLOCK_SUPPORT
+#elif defined(OS_WINDOWS)
+#include <GL/gl.h>
+#include "glext.h"
+#include "windows/GLFunctions.h"
+#define GL_IMAGE_TEXTURES_SUPPORT
+#define GL_MULTISAMPLING_SUPPORT
+#define GL_UNIFORMBLOCK_SUPPORT
#endif // OS_MAC_OS_X
#endif // GLES2
+
#ifdef USE_SDL
#include <SDL.h>
#endif // USE_SDL
-#endif // OS_WINDOWS
+
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
@@ -1 +1 @@
-#define PLUGIN_REVISION "3f7d868"
+#define PLUGIN_REVISION "3dcee1c"
@@ -39,7 +39,7 @@ class UniformCollection {
virtual void setColorData(ColorUniforms _index, u32 _dataSize, const void * _data) = 0;
virtual void updateTextureParameters() = 0;
virtual void updateLightParameters() = 0;
- virtual void updateUniforms(ShaderCombiner * _pCombiner) = 0;
+ virtual void updateUniforms(ShaderCombiner * _pCombiner, OGLRender::RENDER_STATE _renderState) = 0;
};
UniformCollection * createUniformCollection();
@@ -8,7 +8,7 @@
#include "../Revision.h"
#include "../Log.h"
-#ifndef OS_WINDOWS
+#if !defined(OS_WINDOWS) || defined(GLES2) || defined(GLES3) || defined(GLES3_1)
void initGLFunctions()
{

0 comments on commit 3b47078

Please sign in to comment.