Permalink
Browse files

Ignore unused hints

ES 2.0+ does not have these hints
  • Loading branch information...
1 parent 60d5f5f commit 17ecc5e85c6966604ac7f0bf509ed610707870f3 @greggman greggman committed Sep 12, 2012
Showing with 63 additions and 0 deletions.
  1. +4 −0 scripts/EmuIff.py
  2. +43 −0 src/regal/RegalDispatchEmu.cpp
  3. +16 −0 src/regal/RegalIff.h
View
@@ -220,5 +220,9 @@
'entries' : [ 'glCreateShader', ],
'impl' : [ 'return _context->iff->CreateShader( _context, ${arg0} );', ],
},
+ 'Hint' : {
+ 'entries' : [ 'glHint', ],
+ 'impl' : [ 'return _context->iff->Hint( _context, ${arg0plus} );', ],
+ },
}
@@ -2809,6 +2809,48 @@ static void REGAL_CALL emu_glGetTexParameteriv(GLenum target, GLenum pname, GLin
_context->dispatcher.call(&_context->dispatcher.table().glGetTexParameteriv)(target, pname, params);
}
+static void REGAL_CALL emu_glHint(GLenum target, GLenum mode)
+{
+ RegalContext *_context = GET_REGAL_CONTEXT();
+ RegalAssert(_context);
+
+ // prefix
+ switch( _context->emuLevel ) {
+ case 6 :
+ case 5 :
+ case 4 :
+ case 3 :
+ case 2 :
+ #if REGAL_EMU_IFF
+ if (_context->iff) break;
+ #endif
+ default:
+ break;
+ }
+
+ // impl
+ switch( _context->emuLevel ) {
+ case 6 :
+ case 5 :
+ case 4 :
+ case 3 :
+ case 2 :
+ #if REGAL_EMU_IFF
+ if (_context->iff) {
+ RegalEmuScopedActivate activate( _context, _context->iff );
+ return _context->iff->Hint( _context, target, mode );
+ }
+ #endif
+ default: {
+ Dispatcher::ScopedStep stepDown(_context->dispatcher);
+ _context->dispatcher.call(&_context->dispatcher.table().glHint)(target, mode);
+ break;
+ }
+
+ }
+
+}
+
static GLboolean REGAL_CALL emu_glIsEnabled(GLenum cap)
{
RegalContext *_context = GET_REGAL_CONTEXT();
@@ -28927,6 +28969,7 @@ void InitDispatchTableEmu(DispatchTable &tbl)
tbl.glGetTexGeniv = emu_glGetTexGeniv;
tbl.glGetTexParameterfv = emu_glGetTexParameterfv;
tbl.glGetTexParameteriv = emu_glGetTexParameteriv;
+ tbl.glHint = emu_glHint;
tbl.glIsEnabled = emu_glIsEnabled;
tbl.glLightModelf = emu_glLightModelf;
tbl.glLightModelfv = emu_glLightModelfv;
View
@@ -775,6 +775,22 @@ struct RegalIff : public RegalEmu {
}
}
+ void Hint( RegalContext * ctx, GLenum target, GLenum mode) {
+ if ( ctx->info->gles && ctx->info->gles_version_major >= 2 ) {
+ switch ( target ) {
+ case GL_PERSPECTIVE_CORRECTION_HINT:
+ case GL_POINT_SMOOTH_HINT:
+ case GL_LINE_SMOOTH_HINT:
+ case GL_FOG_HINT:
+ // ignore these unused hints in ES 2.0
+ return;
+ }
+ }
+ DispatchTable &tbl = ctx->dispatcher.emulation;
+ tbl.glHint( target, mode );
+ }
+
+
void Provoke( RegalContext * ctx ) {
memcpy( immArray + immCurrent * maxVertexAttribs * 16, &immVab.attr[0].x, maxVertexAttribs * 16 );
immCurrent++;

0 comments on commit 17ecc5e

Please sign in to comment.