most everything I normally use seems to be working now
This commit is contained in:
parent
195e8c0792
commit
0744766a97
24 changed files with 3298 additions and 3269 deletions
|
|
@ -370,9 +370,26 @@ ${MEMBER_INIT}
|
|||
log.Init( this );
|
||||
#endif
|
||||
|
||||
#if REGAL_EMULATION
|
||||
|
||||
emu.Init( this );
|
||||
|
||||
#if REGAL_STATISTICS // todo
|
||||
#endif
|
||||
|
||||
#if REGAL_CODE // todo
|
||||
#endif
|
||||
|
||||
#if REGAL_CACHE // todo
|
||||
#endif
|
||||
|
||||
#if REGAL_ERROR_POST_EMU
|
||||
#if REGAL_ERROR
|
||||
if( Config::enableError ) {
|
||||
err.Init( this );
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if REGAL_EMULATION
|
||||
|
||||
${EMULATION_ENABLED}
|
||||
|
||||
|
|
@ -380,30 +397,19 @@ ${EMULATION_ENABLED}
|
|||
if (Config::enableEmulation || Config::forceEmulation)
|
||||
#endif
|
||||
{
|
||||
emu.Init( this );
|
||||
|
||||
${EMU_MEMBER_INIT}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if REGAL_CODE
|
||||
if (Config::enableCode && !codeSource && !codeHeader)
|
||||
{
|
||||
if (Config::codeSourceFile.length())
|
||||
{
|
||||
codeSource = fopen(Config::codeSourceFile.c_str(),"wt");
|
||||
if (!codeSource)
|
||||
Warning("Failed to open file ",Config::codeSourceFile," for writing code source.");
|
||||
}
|
||||
if (Config::codeHeaderFile.length())
|
||||
{
|
||||
if (Config::codeHeaderFile==Config::codeSourceFile)
|
||||
codeHeader = codeSource;
|
||||
else
|
||||
codeHeader = fopen(Config::codeHeaderFile.c_str(),"wt");
|
||||
if (!codeHeader)
|
||||
Warning("Failed to open file ",Config::codeHeaderFile," for writing code header.");
|
||||
}
|
||||
#if ! REGAL_ERROR_POST_EMU
|
||||
#if REGAL_ERROR
|
||||
if( Config::enableError ) {
|
||||
err.Init( this );
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if REGAL_HTTP
|
||||
http.Init( this );
|
||||
|
|
|
|||
|
|
@ -105,15 +105,11 @@ localInclude = '''
|
|||
'''
|
||||
|
||||
localCode = '''
|
||||
static Dispatch::Global nextGlobal;
|
||||
|
||||
void Err::Init( RegalContext * ctx ) {
|
||||
void InitDispatchGLError( Dispatch::GL & tbl );
|
||||
void InitDispatchError( Dispatch::GL & tbl );
|
||||
next = ctx->dispatchGL;
|
||||
InitDispatchGLError( ctx->dispatchGL );
|
||||
nextGlobal = dispatchGlobal;
|
||||
void InitDispatchGlobal( Dispatch::Global & tbl );
|
||||
InitDispatchGlobal( dispatchGlobal );
|
||||
InitDispatchError( ctx->dispatchGL );
|
||||
}
|
||||
|
||||
'''
|
||||
|
|
@ -129,7 +125,7 @@ def generateErrorSource(apis, args):
|
|||
substitute['COPYRIGHT'] = args.copyright
|
||||
substitute['DISPATCH_NAME'] = 'Error'
|
||||
substitute['LOCAL_INCLUDE'] = ''
|
||||
substitute['LOCAL_CODE'] = ''
|
||||
substitute['LOCAL_CODE'] = localCode
|
||||
substitute['API_DISPATCH_FUNC_DEFINE'] = funcDefine
|
||||
substitute['API_DISPATCH_FUNC_INIT'] = funcInit
|
||||
substitute['API_DISPATCH_GLOBAL_FUNC_INIT'] = ''
|
||||
|
|
|
|||
|
|
@ -232,9 +232,24 @@ REGAL_GLOBAL_END
|
|||
|
||||
REGAL_NAMESPACE_BEGIN
|
||||
|
||||
static Dispatch::Global nextGlobal;
|
||||
|
||||
void Http::Init( RegalContext * ctx ) {
|
||||
|
||||
ctx->http.next = ctx->dispatchGL;
|
||||
void InitDispatchHttp( Dispatch::GL & );
|
||||
InitDispatchHttp( ctx->dispatchGL );
|
||||
|
||||
gl.Initialize( & ctx->http.next );
|
||||
|
||||
nextGlobal = dispatchGlobal;
|
||||
void InitDispatchHttp( Dispatch::Global & );
|
||||
InitDispatchHttp( dispatchGlobal );
|
||||
}
|
||||
|
||||
${API_FUNC_DEFINE}
|
||||
|
||||
void InitDispatchTableHttp(Dispatch::GL &tbl)
|
||||
void InitDispatchHttp(Dispatch::GL &tbl)
|
||||
{
|
||||
${API_GL_DISPATCH_INIT}
|
||||
}
|
||||
|
|
@ -323,9 +338,9 @@ def generateDispatchHttp(apis, args):
|
|||
|
||||
|
||||
if function.needsContext:
|
||||
code += ' Dispatch::GL *_next = _context ? &_context->dispatchGL : NULL;\n'
|
||||
code += ' Dispatch::GL *_next = _context ? &_context->http.next : NULL;\n'
|
||||
else:
|
||||
code += ' Dispatch::Global *_next = &dispatchGlobal;\n'
|
||||
code += ' Dispatch::Global *_next = &nextGlobal;\n'
|
||||
|
||||
code += ' RegalAssert(_next);\n'
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ REGAL_GLOBAL_END
|
|||
|
||||
REGAL_NAMESPACE_BEGIN
|
||||
|
||||
Dispatch::Global nextGlobal;
|
||||
static Dispatch::Global nextGlobal;
|
||||
|
||||
void Log::Init( RegalContext * ctx ) {
|
||||
ctx->log.next = ctx->dispatchGL;
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ struct BaseVertex : public ClientState::VertexArray
|
|||
|
||||
bool glDrawElementsBaseVertex(RegalContext &ctx, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)
|
||||
{
|
||||
Dispatch::GL &dt = ctx.dispatchGL;
|
||||
Dispatch::GL &dt = ctx.emu.curr;
|
||||
if (basevertex)
|
||||
adjust(ctx, dt, basevertex);
|
||||
dt.glDrawElements(mode, count, type, indices);
|
||||
|
|
@ -175,7 +175,7 @@ struct BaseVertex : public ClientState::VertexArray
|
|||
|
||||
bool glDrawRangeElementsBaseVertex(RegalContext &ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)
|
||||
{
|
||||
Dispatch::GL &dt = ctx.dispatchGL;
|
||||
Dispatch::GL &dt = ctx.emu.curr;
|
||||
if (basevertex)
|
||||
adjust(ctx, dt, basevertex);
|
||||
dt.glDrawRangeElements(mode, start, end, count, type, indices);
|
||||
|
|
@ -186,7 +186,7 @@ struct BaseVertex : public ClientState::VertexArray
|
|||
|
||||
bool glDrawElementsInstancedBaseVertex(RegalContext &ctx, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex)
|
||||
{
|
||||
Dispatch::GL &dt = ctx.dispatchGL;
|
||||
Dispatch::GL &dt = ctx.emu.curr;
|
||||
if (basevertex)
|
||||
adjust(ctx, dt, basevertex);
|
||||
dt.glDrawElementsInstanced(mode, count, type, indices, primcount);
|
||||
|
|
@ -197,7 +197,7 @@ struct BaseVertex : public ClientState::VertexArray
|
|||
|
||||
bool glDrawElementsInstancedBaseVertexBaseInstance(RegalContext &ctx, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance)
|
||||
{
|
||||
Dispatch::GL &dt = ctx.dispatchGL;
|
||||
Dispatch::GL &dt = ctx.emu.curr;
|
||||
if (basevertex)
|
||||
adjust(ctx, dt, basevertex);
|
||||
dt.glDrawElementsInstancedBaseInstance(mode, count, type, indices, primcount, baseinstance);
|
||||
|
|
@ -208,7 +208,7 @@ struct BaseVertex : public ClientState::VertexArray
|
|||
|
||||
bool glMultiDrawElementsBaseVertex(RegalContext &ctx, GLenum mode, const GLsizei *count, GLenum type, const GLvoid * const* indices, GLsizei primcount, const GLint *basevertex)
|
||||
{
|
||||
Dispatch::GL &dt = ctx.dispatchGL;
|
||||
Dispatch::GL &dt = ctx.emu.curr;
|
||||
for (GLsizei ii=0; ii<primcount; ii++)
|
||||
{
|
||||
if (basevertex[ii])
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ struct Bin
|
|||
|
||||
void ShaderBinary( RegalContext *ctx, GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length)
|
||||
{
|
||||
Dispatch::GL &tbl = ctx->dispatchGL;
|
||||
Dispatch::GL &tbl = ctx->emu.curr;
|
||||
tbl.glShaderBinary( count, shaders, binaryFormat, binary, length );
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -194,14 +194,22 @@ RegalContext::Init()
|
|||
log.Init( this );
|
||||
#endif
|
||||
|
||||
#if REGAL_EMULATION
|
||||
#if REGAL_ERROR_POST_EMU
|
||||
#if REGAL_ERROR
|
||||
if( Config::enableError ) {
|
||||
err.Init( this );
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
emu.Init( this );
|
||||
#if REGAL_EMULATION
|
||||
|
||||
#if !REGAL_FORCE_EMULATION
|
||||
if (Config::enableEmulation || Config::forceEmulation)
|
||||
#endif
|
||||
{
|
||||
emu.Init( this );
|
||||
|
||||
// emu
|
||||
emuLevel = 16;
|
||||
{
|
||||
|
|
@ -481,26 +489,13 @@ RegalContext::Init()
|
|||
}
|
||||
#endif
|
||||
|
||||
#if REGAL_CODE
|
||||
if (Config::enableCode && !codeSource && !codeHeader)
|
||||
{
|
||||
if (Config::codeSourceFile.length())
|
||||
{
|
||||
codeSource = fopen(Config::codeSourceFile.c_str(),"wt");
|
||||
if (!codeSource)
|
||||
Warning("Failed to open file ",Config::codeSourceFile," for writing code source.");
|
||||
}
|
||||
if (Config::codeHeaderFile.length())
|
||||
{
|
||||
if (Config::codeHeaderFile==Config::codeSourceFile)
|
||||
codeHeader = codeSource;
|
||||
else
|
||||
codeHeader = fopen(Config::codeHeaderFile.c_str(),"wt");
|
||||
if (!codeHeader)
|
||||
Warning("Failed to open file ",Config::codeHeaderFile," for writing code header.");
|
||||
}
|
||||
#if ! REGAL_ERROR_POST_EMU
|
||||
#if REGAL_ERROR
|
||||
if( Config::enableError ) {
|
||||
err.Init( this );
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if REGAL_HTTP
|
||||
http.Init( this );
|
||||
|
|
|
|||
|
|
@ -64,6 +64,12 @@ REGAL_NAMESPACE_BEGIN
|
|||
using namespace ::REGAL_NAMESPACE_INTERNAL::Logging;
|
||||
using namespace ::REGAL_NAMESPACE_INTERNAL::Token;
|
||||
|
||||
void Err::Init( RegalContext * ctx ) {
|
||||
void InitDispatchError( Dispatch::GL & tbl );
|
||||
next = ctx->dispatchGL;
|
||||
InitDispatchError( ctx->dispatchGL );
|
||||
}
|
||||
|
||||
// GL_VERSION_1_0
|
||||
|
||||
static void REGAL_CALL error_glAccum(GLenum op, GLfloat value)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -186,6 +186,7 @@ public:
|
|||
static void Stop();
|
||||
|
||||
GlProcs gl;
|
||||
Dispatch::GL next;
|
||||
static bool enabled;
|
||||
static int port;
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ REGAL_GLOBAL_END
|
|||
|
||||
REGAL_NAMESPACE_BEGIN
|
||||
|
||||
Dispatch::Global nextGlobal;
|
||||
static Dispatch::Global nextGlobal;
|
||||
|
||||
void Log::Init( RegalContext * ctx ) {
|
||||
ctx->log.next = ctx->dispatchGL;
|
||||
|
|
|
|||
|
|
@ -160,12 +160,12 @@ struct Dsa
|
|||
dsa.matrixMode = GL_TEXTURE;
|
||||
break;
|
||||
}
|
||||
ctx->dispatchGL.glMatrixMode( dsa.matrixMode );
|
||||
ctx->emu.curr.glMatrixMode( dsa.matrixMode );
|
||||
}
|
||||
}
|
||||
void RestoreMatrixMode( RegalContext * ctx ) {
|
||||
if( dsa.matrixMode != REGAL_DSA_INVALID ) {
|
||||
ctx->dispatchGL.glMatrixMode( drv.matrixMode );
|
||||
ctx->emu.curr.glMatrixMode( drv.matrixMode );
|
||||
RestoreActiveTexture( ctx );
|
||||
dsa.matrixMode = REGAL_DSA_INVALID;
|
||||
}
|
||||
|
|
@ -187,12 +187,12 @@ struct Dsa
|
|||
return;
|
||||
if( NotActiveTexture( tex ) ) {
|
||||
dsa.activeTexture = tex;
|
||||
ctx->dispatchGL.glActiveTexture( dsa.activeTexture );
|
||||
ctx->emu.curr.glActiveTexture( dsa.activeTexture );
|
||||
}
|
||||
}
|
||||
void RestoreActiveTexture( RegalContext * ctx ) {
|
||||
if( dsa.activeTexture != REGAL_DSA_INVALID ) {
|
||||
ctx->dispatchGL.glActiveTexture( drv.activeTexture );
|
||||
ctx->emu.curr.glActiveTexture( drv.activeTexture );
|
||||
dsa.activeTexture = REGAL_DSA_INVALID;
|
||||
}
|
||||
}
|
||||
|
|
@ -208,12 +208,12 @@ struct Dsa
|
|||
void DsaClientActiveTexture( RegalContext * ctx, GLenum tex ) {
|
||||
if( NotClientActiveTexture( tex ) ) {
|
||||
dsa.clientActiveTexture = tex;
|
||||
ctx->dispatchGL.glClientActiveTexture( dsa.clientActiveTexture );
|
||||
ctx->emu.curr.glClientActiveTexture( dsa.clientActiveTexture );
|
||||
}
|
||||
}
|
||||
void RestoreClientActiveTexture( RegalContext * ctx ) {
|
||||
if( dsa.clientActiveTexture != REGAL_DSA_INVALID ) {
|
||||
ctx->dispatchGL.glClientActiveTexture( drv.clientActiveTexture );
|
||||
ctx->emu.curr.glClientActiveTexture( drv.clientActiveTexture );
|
||||
dsa.clientActiveTexture = REGAL_DSA_INVALID;
|
||||
}
|
||||
}
|
||||
|
|
@ -229,12 +229,12 @@ struct Dsa
|
|||
void DsaGlslProgram( RegalContext * ctx, GLuint program ) {
|
||||
if( NotGlslProgram( program ) ) {
|
||||
dsa.glslProgram = program;
|
||||
ctx->dispatchGL.glUseProgram( dsa.glslProgram );
|
||||
ctx->emu.curr.glUseProgram( dsa.glslProgram );
|
||||
}
|
||||
}
|
||||
void RestoreGlslProgram( RegalContext * ctx ) {
|
||||
if( dsa.glslProgram != REGAL_DSA_INVALID ) {
|
||||
ctx->dispatchGL.glUseProgram( drv.glslProgram );
|
||||
ctx->emu.curr.glUseProgram( drv.glslProgram );
|
||||
dsa.glslProgram = REGAL_DSA_INVALID;
|
||||
}
|
||||
}
|
||||
|
|
@ -261,12 +261,12 @@ struct Dsa
|
|||
if( NotFramebuffer( target, framebuffer ) ) {
|
||||
dsa.framebufferTarget = target;
|
||||
dsa.framebuffer = framebuffer;
|
||||
ctx->dispatchGL.glBindFramebuffer( dsa.framebufferTarget, dsa.framebuffer );
|
||||
ctx->emu.curr.glBindFramebuffer( dsa.framebufferTarget, dsa.framebuffer );
|
||||
}
|
||||
}
|
||||
void RestoreFramebuffer( RegalContext * ctx ) {
|
||||
if( dsa.framebuffer != REGAL_DSA_INVALID ) {
|
||||
ctx->dispatchGL.glBindFramebuffer( drv.framebufferTarget, drv.framebuffer );
|
||||
ctx->emu.curr.glBindFramebuffer( drv.framebufferTarget, drv.framebuffer );
|
||||
dsa.framebufferTarget = REGAL_DSA_INVALID;
|
||||
dsa.framebuffer = REGAL_DSA_INVALID;
|
||||
}
|
||||
|
|
@ -295,12 +295,12 @@ struct Dsa
|
|||
if( NotRenderbuffer( target, renderbuffer ) ) {
|
||||
dsa.renderbufferTarget = target;
|
||||
dsa.renderbuffer = renderbuffer;
|
||||
ctx->dispatchGL.glBindRenderbuffer( dsa.renderbufferTarget, dsa.renderbuffer );
|
||||
ctx->emu.curr.glBindRenderbuffer( dsa.renderbufferTarget, dsa.renderbuffer );
|
||||
}
|
||||
}
|
||||
void RestoreRenderbuffer( RegalContext * ctx ) {
|
||||
if( dsa.renderbuffer != REGAL_DSA_INVALID ) {
|
||||
ctx->dispatchGL.glBindRenderbuffer( drv.renderbufferTarget, drv.renderbuffer );
|
||||
ctx->emu.curr.glBindRenderbuffer( drv.renderbufferTarget, drv.renderbuffer );
|
||||
dsa.renderbufferTarget = REGAL_DSA_INVALID;
|
||||
dsa.renderbuffer = REGAL_DSA_INVALID;
|
||||
}
|
||||
|
|
@ -353,13 +353,13 @@ struct Dsa
|
|||
int idx = AsmTargetIndex( target );
|
||||
if( NotAsmProgram( target, prog ) ) {
|
||||
dsa.asmProgram[idx] = prog;
|
||||
ctx->dispatchGL.glBindProgramARB( target, dsa.asmProgram[idx] );
|
||||
ctx->emu.curr.glBindProgramARB( target, dsa.asmProgram[idx] );
|
||||
}
|
||||
}
|
||||
void RestoreAsmProgram( RegalContext * ctx, GLenum target ) {
|
||||
int idx = AsmTargetIndex( target );
|
||||
if( dsa.asmProgram[idx] != REGAL_DSA_INVALID ) {
|
||||
ctx->dispatchGL.glBindProgramARB( target, drv.asmProgram[idx] );
|
||||
ctx->emu.curr.glBindProgramARB( target, drv.asmProgram[idx] );
|
||||
dsa.asmProgram[idx] = REGAL_DSA_INVALID;
|
||||
}
|
||||
}
|
||||
|
|
@ -386,12 +386,12 @@ struct Dsa
|
|||
void DsaVao( RegalContext * ctx, GLuint vao ) {
|
||||
if( NotVao( vao ) ) {
|
||||
dsa.vao = vao;
|
||||
ctx->dispatchGL.glBindVertexArray( dsa.vao );
|
||||
ctx->emu.curr.glBindVertexArray( dsa.vao );
|
||||
}
|
||||
}
|
||||
void RestoreVao( RegalContext * ctx ) {
|
||||
if( dsa.vao != REGAL_DSA_INVALID ) {
|
||||
ctx->dispatchGL.glBindVertexArray( drv.vao );
|
||||
ctx->emu.curr.glBindVertexArray( drv.vao );
|
||||
dsa.vao = REGAL_DSA_INVALID;
|
||||
}
|
||||
}
|
||||
|
|
@ -420,12 +420,12 @@ struct Dsa
|
|||
void DsaBuffer( RegalContext * ctx, GLuint buf ) {
|
||||
if( NotBuffer( buf ) ) {
|
||||
dsa.buffer = buf;
|
||||
ctx->dispatchGL.glBindBuffer( GL_ARRAY_BUFFER, dsa.buffer );
|
||||
ctx->emu.curr.glBindBuffer( GL_ARRAY_BUFFER, dsa.buffer );
|
||||
}
|
||||
}
|
||||
void RestoreBuffer( RegalContext * ctx ) {
|
||||
if( dsa.buffer != REGAL_DSA_INVALID ) {
|
||||
ctx->dispatchGL.glBindBuffer( GL_ARRAY_BUFFER, drv.buffer );
|
||||
ctx->emu.curr.glBindBuffer( GL_ARRAY_BUFFER, drv.buffer );
|
||||
dsa.buffer = REGAL_DSA_INVALID;
|
||||
}
|
||||
}
|
||||
|
|
@ -475,13 +475,13 @@ struct Dsa
|
|||
dsa.textureTarget = target;
|
||||
dsa.texture = texture;
|
||||
DsaActiveTexture( ctx, GL_TEXTURE0 );
|
||||
ctx->dispatchGL.glBindTexture( dsa.textureTarget, dsa.texture );
|
||||
ctx->emu.curr.glBindTexture( dsa.textureTarget, dsa.texture );
|
||||
}
|
||||
}
|
||||
void RestoreTexture( RegalContext * ctx ) {
|
||||
if( dsa.texture != REGAL_DSA_INVALID ) {
|
||||
DsaActiveTexture( ctx, GL_TEXTURE0 );
|
||||
ctx->dispatchGL.glBindTexture( drv.textureTarget, drv.texture );
|
||||
ctx->emu.curr.glBindTexture( drv.textureTarget, drv.texture );
|
||||
dsa.textureTarget = REGAL_DSA_INVALID;
|
||||
dsa.texture = REGAL_DSA_INVALID;
|
||||
}
|
||||
|
|
@ -498,7 +498,7 @@ struct Dsa
|
|||
|
||||
void ClientAttribDefault( RegalContext * ctx, GLbitfield mask )
|
||||
{
|
||||
Dispatch::GL &tbl = ctx->dispatchGL;
|
||||
Dispatch::GL &tbl = ctx->emu.curr;
|
||||
|
||||
if (mask&GL_CLIENT_PIXEL_STORE_BIT)
|
||||
{
|
||||
|
|
@ -573,7 +573,7 @@ struct Dsa
|
|||
|
||||
template< typename T >
|
||||
bool GetIndexedv( RegalContext * ctx, GLenum pname, GLuint index, T * params ) {
|
||||
Dispatch::GL &tbl = ctx->dispatchGL;
|
||||
Dispatch::GL &tbl = ctx->emu.curr;
|
||||
switch( pname ) {
|
||||
case GL_PROGRAM_MATRIX_EXT:
|
||||
ctx->dsa->DsaMatrixMode( ctx, GL_MATRIX0_ARB + index );
|
||||
|
|
@ -710,7 +710,7 @@ struct Dsa
|
|||
}
|
||||
|
||||
GLboolean IsEnabledIndexed( RegalContext * ctx, GLenum pname, GLuint index ) {
|
||||
Dispatch::GL &tbl = ctx->dispatchGL;
|
||||
Dispatch::GL &tbl = ctx->emu.curr;
|
||||
switch( pname ) {
|
||||
case GL_TEXTURE_1D:
|
||||
case GL_TEXTURE_2D:
|
||||
|
|
|
|||
|
|
@ -887,7 +887,7 @@ struct ProgramHandler : public RequestHandler {
|
|||
if( count > 1 ) {
|
||||
json +=string( indent, ' ' ) + print_string( "\"count\" :", count, ",\n" );
|
||||
}
|
||||
json +=string( indent, ' ' ) + print_string( "\"value\": ", PrintUniformValue( ctx->dispatchGL, prog, loc, count, type, indent ), ",\n" );
|
||||
json +=string( indent, ' ' ) + print_string( "\"value\": ", PrintUniformValue( ctx->http.next, prog, loc, count, type, indent ), ",\n" );
|
||||
EraseLastComma( json );
|
||||
indent -= 2;
|
||||
json += string( indent, ' ' ) + "},\n";
|
||||
|
|
@ -1310,11 +1310,6 @@ Http::Http() : runState( RS_Run ), debugGroupStackDepth( -1 ), stepOverGroupDept
|
|||
*/
|
||||
}
|
||||
|
||||
void Http::Init( RegalContext * ctx )
|
||||
{
|
||||
gl.Initialize( & ctx->dispatchGL );
|
||||
}
|
||||
|
||||
bool Http::enabled = REGAL_HTTP;
|
||||
int Http::port = REGAL_HTTP_PORT;
|
||||
|
||||
|
|
|
|||
|
|
@ -1818,7 +1818,7 @@ void Program::Init( RegalContext * ctx, const Store & sstore, GLuint vshd, GLuin
|
|||
ver = ::std::numeric_limits<GLuint64>::max();
|
||||
progcount = 0;
|
||||
RegalAssert(ctx);
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
store = sstore;
|
||||
pg = tbl.glCreateProgram();
|
||||
vs = vshd;
|
||||
|
|
@ -1875,7 +1875,7 @@ void Program::Attribs( RegalContext * ctx )
|
|||
{
|
||||
Internal("Regal::Iff::Program::Attribs","()");
|
||||
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
|
||||
RegalAssertArrayIndex( ctx->iff->ffAttrMap, RFF2A_Vertex );
|
||||
tbl.glBindAttribLocation( pg, ctx->iff->ffAttrMap[ RFF2A_Vertex ], "rglVertex" );
|
||||
|
|
@ -1922,7 +1922,7 @@ void Program::UserShaderModeAttribs( RegalContext * ctx )
|
|||
{
|
||||
Internal("Regal::Iff::Program::UserShaderModeAttribs","()");
|
||||
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
|
||||
RegalAssertArrayIndex( ctx->iff->ffAttrMap, RFF2A_Vertex );
|
||||
RegalAssertArrayIndex( ctx->iff->ffAttrMap, RFF2A_Normal );
|
||||
|
|
@ -2054,7 +2054,7 @@ void Iff::Cleanup( RegalContext &ctx )
|
|||
Internal("Regal::Iff::Cleanup","()");
|
||||
|
||||
RestoreVao(&ctx);
|
||||
Dispatch::GL &tbl = ctx.dispatchGL;
|
||||
Dispatch::GL &tbl = ctx.emu.curr;
|
||||
|
||||
tbl.glDeleteBuffers(1, &immVbo);
|
||||
tbl.glDeleteVertexArrays(1, &immVao);
|
||||
|
|
@ -2165,7 +2165,7 @@ void Iff::EnableClientState( RegalContext * ctx, GLenum state )
|
|||
RegalAssert( idx < max_vertex_attribs );
|
||||
if ( idx < max_vertex_attribs )
|
||||
{
|
||||
ctx->dispatchGL.glEnableVertexAttribArray( idx );
|
||||
ctx->emu.curr.glEnableVertexAttribArray( idx );
|
||||
EnableArray( ctx, idx ); // keep ffn up to date
|
||||
}
|
||||
}
|
||||
|
|
@ -2179,7 +2179,7 @@ void Iff::DisableClientState( RegalContext * ctx, GLenum state )
|
|||
RegalAssert( idx < max_vertex_attribs );
|
||||
if ( idx < max_vertex_attribs )
|
||||
{
|
||||
ctx->dispatchGL.glDisableVertexAttribArray( idx );
|
||||
ctx->emu.curr.glDisableVertexAttribArray( idx );
|
||||
DisableArray( ctx, idx ); // keep ffn up to date
|
||||
}
|
||||
}
|
||||
|
|
@ -2211,34 +2211,34 @@ void Iff::VertexPointer( RegalContext * ctx, GLint size, GLenum type, GLsizei st
|
|||
return;
|
||||
|
||||
RestoreVao( ctx );
|
||||
ctx->dispatchGL.glVertexAttribPointer( ffAttrMap[ RFF2A_Vertex ], size, type, GL_FALSE, stride, pointer );
|
||||
ctx->emu.curr.glVertexAttribPointer( ffAttrMap[ RFF2A_Vertex ], size, type, GL_FALSE, stride, pointer );
|
||||
}
|
||||
|
||||
void Iff::NormalPointer( RegalContext * ctx, GLenum type, GLsizei stride, const GLvoid *pointer )
|
||||
{
|
||||
RestoreVao( ctx );
|
||||
GLboolean n = type == GL_FLOAT ? GL_FALSE : GL_TRUE;
|
||||
ctx->dispatchGL.glVertexAttribPointer( ffAttrMap[ RFF2A_Normal ], 3, type, n, stride, pointer );
|
||||
ctx->emu.curr.glVertexAttribPointer( ffAttrMap[ RFF2A_Normal ], 3, type, n, stride, pointer );
|
||||
}
|
||||
|
||||
void Iff::ColorPointer( RegalContext * ctx, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
|
||||
{
|
||||
RestoreVao( ctx );
|
||||
GLboolean n = type == GL_FLOAT ? GL_FALSE : GL_TRUE;
|
||||
ctx->dispatchGL.glVertexAttribPointer( ffAttrMap[ RFF2A_Color ], size, type, n, stride, pointer );
|
||||
ctx->emu.curr.glVertexAttribPointer( ffAttrMap[ RFF2A_Color ], size, type, n, stride, pointer );
|
||||
}
|
||||
|
||||
void Iff::SecondaryColorPointer( RegalContext * ctx, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
|
||||
{
|
||||
RestoreVao( ctx );
|
||||
GLboolean n = type == GL_FLOAT ? GL_FALSE : GL_TRUE;
|
||||
ctx->dispatchGL.glVertexAttribPointer( ffAttrMap[ RFF2A_SecondaryColor ], size, type, n, stride, pointer );
|
||||
ctx->emu.curr.glVertexAttribPointer( ffAttrMap[ RFF2A_SecondaryColor ], size, type, n, stride, pointer );
|
||||
}
|
||||
|
||||
void Iff::FogCoordPointer( RegalContext * ctx, GLenum type, GLsizei stride, const GLvoid *pointer )
|
||||
{
|
||||
RestoreVao( ctx );
|
||||
ctx->dispatchGL.glVertexAttribPointer( ffAttrMap[ RFF2A_FogCoord ], 1, type, GL_FALSE, stride, pointer );
|
||||
ctx->emu.curr.glVertexAttribPointer( ffAttrMap[ RFF2A_FogCoord ], 1, type, GL_FALSE, stride, pointer );
|
||||
}
|
||||
|
||||
void Iff::EdgeFlagPointer( RegalContext * ctx, GLsizei stride, const GLvoid *pointer )
|
||||
|
|
@ -2247,7 +2247,7 @@ void Iff::EdgeFlagPointer( RegalContext * ctx, GLsizei stride, const GLvoid *poi
|
|||
GLuint index = ffAttrMap[ RFF2A_EdgeFlag ];
|
||||
if (index == RFF2A_Invalid)
|
||||
return;
|
||||
ctx->dispatchGL.glVertexAttribPointer( index, 1, GL_UNSIGNED_BYTE, GL_FALSE, stride, pointer );
|
||||
ctx->emu.curr.glVertexAttribPointer( index, 1, GL_UNSIGNED_BYTE, GL_FALSE, stride, pointer );
|
||||
}
|
||||
|
||||
void Iff::TexCoordPointer( RegalContext * ctx, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
|
||||
|
|
@ -2258,22 +2258,22 @@ void Iff::TexCoordPointer( RegalContext * ctx, GLint size, GLenum type, GLsizei
|
|||
return;
|
||||
}
|
||||
RestoreVao( ctx );
|
||||
ctx->dispatchGL.glVertexAttribPointer( ffAttrTexBegin + catIndex, size, type, GL_FALSE, stride, pointer );
|
||||
ctx->emu.curr.glVertexAttribPointer( ffAttrTexBegin + catIndex, size, type, GL_FALSE, stride, pointer );
|
||||
}
|
||||
|
||||
void Iff::GetAttrib( RegalContext * ctx, GLuint index, GLenum pname, GLdouble * d )
|
||||
{
|
||||
ctx->dispatchGL.glGetVertexAttribdv( index, pname, d );
|
||||
ctx->emu.curr.glGetVertexAttribdv( index, pname, d );
|
||||
}
|
||||
|
||||
void Iff::GetAttrib( RegalContext * ctx, GLuint index, GLenum pname, GLfloat * f )
|
||||
{
|
||||
ctx->dispatchGL.glGetVertexAttribfv( index, pname, f );
|
||||
ctx->emu.curr.glGetVertexAttribfv( index, pname, f );
|
||||
}
|
||||
|
||||
void Iff::GetAttrib( RegalContext * ctx, GLuint index, GLenum pname, GLint * i )
|
||||
{
|
||||
ctx->dispatchGL.glGetVertexAttribiv( index, pname, i );
|
||||
ctx->emu.curr.glGetVertexAttribiv( index, pname, i );
|
||||
}
|
||||
|
||||
bool Iff::IsEnabled( RegalContext * ctx, GLenum pname, GLboolean &enabled )
|
||||
|
|
@ -2364,7 +2364,7 @@ bool Iff::IsEnabled( RegalContext * ctx, GLenum pname, GLboolean &enabled )
|
|||
|
||||
void Iff::InitImmediate(RegalContext &ctx)
|
||||
{
|
||||
Dispatch::GL &tbl = ctx.dispatchGL;
|
||||
Dispatch::GL &tbl = ctx.emu.curr;
|
||||
tbl.glGenVertexArrays( 1, & immVao );
|
||||
tbl.glBindVertexArray( immVao );
|
||||
BindVertexArray( &ctx, immVao ); // to keep ffn current
|
||||
|
|
@ -2420,7 +2420,7 @@ void Iff::glDeleteVertexArrays( RegalContext * ctx, GLsizei n, const GLuint * ar
|
|||
{
|
||||
GLuint name = arrays[ i ];
|
||||
if (name != immVao)
|
||||
ctx->dispatchGL.glDeleteVertexArrays( 1, &name );
|
||||
ctx->emu.curr.glDeleteVertexArrays( 1, &name );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2431,7 +2431,7 @@ void Iff::glDeleteBuffers( RegalContext * ctx, GLsizei n, const GLuint * buffers
|
|||
{
|
||||
GLuint name = buffers[ i ];
|
||||
if (name != immVbo)
|
||||
ctx->dispatchGL.glDeleteBuffers( 1, &name );
|
||||
ctx->emu.curr.glDeleteBuffers( 1, &name );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2440,7 +2440,7 @@ GLboolean Iff::IsVertexArray( RegalContext * ctx, GLuint name )
|
|||
RegalAssert( ctx != NULL );
|
||||
if (name == immVao )
|
||||
return GL_FALSE;
|
||||
return ctx->dispatchGL.glIsVertexArray( name );
|
||||
return ctx->emu.curr.glIsVertexArray( name );
|
||||
}
|
||||
|
||||
void Iff::glBindVertexArray( RegalContext *ctx, GLuint vao )
|
||||
|
|
@ -2467,7 +2467,7 @@ void Iff::Begin( RegalContext * ctx, GLenum mode )
|
|||
if (immActive == false)
|
||||
{
|
||||
immActive = true;
|
||||
ctx->dispatchGL.glBindVertexArray( immVao );
|
||||
ctx->emu.curr.glBindVertexArray( immVao );
|
||||
BindVertexArray( ctx, immVao ); // keep ffn current
|
||||
}
|
||||
PreDraw( ctx );
|
||||
|
|
@ -2484,7 +2484,7 @@ void Iff::RestoreVao( RegalContext * ctx )
|
|||
{
|
||||
if (immActive)
|
||||
{
|
||||
ctx->dispatchGL.glBindVertexArray( immShadowVao );
|
||||
ctx->emu.curr.glBindVertexArray( immShadowVao );
|
||||
BindVertexArray( ctx, immShadowVao );
|
||||
immActive = false;
|
||||
}
|
||||
|
|
@ -2494,7 +2494,7 @@ void Iff::Flush( RegalContext * ctx )
|
|||
{
|
||||
if (immCurrent>0) // Do nothing for empty buffer
|
||||
{
|
||||
Dispatch::GL &tbl = ctx->dispatchGL;
|
||||
Dispatch::GL &tbl = ctx->emu.curr;
|
||||
tbl.glBufferData( GL_ARRAY_BUFFER, immCurrent * max_vertex_attribs * sizeof(Float4), immArray, GL_DYNAMIC_DRAW );
|
||||
|
||||
GLenum derivedPrim = immPrim;
|
||||
|
|
@ -3412,7 +3412,7 @@ void Iff::WindowPos( RegalContext * ctx, GLdouble x, GLdouble y, GLdouble z )
|
|||
// todo - cache rasterpos and implement glDrawPixels and glBitmap
|
||||
return;
|
||||
}
|
||||
ctx->dispatchGL.glWindowPos3d( x, y, z );
|
||||
ctx->emu.curr.glWindowPos3d( x, y, z );
|
||||
}
|
||||
|
||||
void Iff::BindVertexArray( RegalContext * ctx, GLuint vao )
|
||||
|
|
@ -3440,7 +3440,7 @@ void Iff::DisableArray( RegalContext * ctx, GLuint index )
|
|||
|
||||
GLuint Iff::CreateShader( RegalContext *ctx, GLenum shaderType )
|
||||
{
|
||||
GLuint sh = ctx->dispatchGL.glCreateShader( shaderType );
|
||||
GLuint sh = ctx->emu.curr.glCreateShader( shaderType );
|
||||
shaderTypeMap[ sh ] = shaderType;
|
||||
return sh;
|
||||
}
|
||||
|
|
@ -3563,7 +3563,7 @@ void Iff::UpdateUniforms( RegalContext * ctx )
|
|||
{
|
||||
Internal("Regal::Iff::UpdateUniforms", boost::print::optional(ctx,Logging::pointers));
|
||||
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
UniformMap * umap = NULL;
|
||||
if( currinst ) {
|
||||
if( currinst->prevInstance == NULL ) {
|
||||
|
|
@ -4096,7 +4096,7 @@ void Iff::UseFixedFunctionProgram( RegalContext * ctx )
|
|||
// delete this program
|
||||
if ( p->pg != 0 )
|
||||
{
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
tbl.glDeleteShader( p->vs );
|
||||
tbl.glDeleteShader( p->fs );
|
||||
tbl.glDeleteProgram( p->pg );
|
||||
|
|
@ -4109,7 +4109,7 @@ void Iff::UseFixedFunctionProgram( RegalContext * ctx )
|
|||
}
|
||||
RegalAssertArrayIndex( ffprogs, base + match );
|
||||
currprog = & ffprogs[ base + match ];
|
||||
ctx->dispatchGL.glUseProgram( currprog->pg );
|
||||
ctx->emu.curr.glUseProgram( currprog->pg );
|
||||
UpdateUniforms( ctx );
|
||||
}
|
||||
|
||||
|
|
@ -4118,7 +4118,7 @@ GLuint Iff::CreateFixedFunctionVertexShader( RegalContext * ctx ) {
|
|||
string_list vsSrc;
|
||||
GenerateVertexShaderSource( this, ffstate, vsSrc );
|
||||
GLuint vs;
|
||||
Program::Shader( ctx, ctx->dispatchGL, GL_VERTEX_SHADER, vs, vsSrc.str().c_str() );
|
||||
Program::Shader( ctx, ctx->emu.curr, GL_VERTEX_SHADER, vs, vsSrc.str().c_str() );
|
||||
return vs;
|
||||
}
|
||||
|
||||
|
|
@ -4127,7 +4127,7 @@ GLuint Iff::CreateFixedFunctionFragmentShader( RegalContext * ctx ) {
|
|||
string_list fsSrc;
|
||||
GenerateFragmentShaderSource( this, fsSrc );
|
||||
GLuint fs;
|
||||
Program::Shader( ctx, ctx->dispatchGL, GL_FRAGMENT_SHADER, fs, fsSrc.str().c_str() );
|
||||
Program::Shader( ctx, ctx->emu.curr, GL_FRAGMENT_SHADER, fs, fsSrc.str().c_str() );
|
||||
return fs;
|
||||
}
|
||||
|
||||
|
|
@ -4163,7 +4163,7 @@ void Iff::UseShaderProgram( RegalContext * ctx )
|
|||
}
|
||||
|
||||
// if instanced, update per-instance uniforms if necessary
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
if( currprog->instanced ) {
|
||||
if( currinst == NULL ) {
|
||||
currinst = & inst[ currprog->pg ];
|
||||
|
|
@ -4483,7 +4483,7 @@ void Iff::ShaderSource( RegalContext *ctx, GLuint shader, GLsizei count, const G
|
|||
|
||||
const GLchar * dumb = static_cast<const GLchar *>( src.c_str() );
|
||||
const GLchar ** dumber = & dumb;
|
||||
ctx->dispatchGL.glShaderSource( shader, 1, dumber, NULL );
|
||||
ctx->emu.curr.glShaderSource( shader, 1, dumber, NULL );
|
||||
}
|
||||
|
||||
void Iff::LinkProgram( RegalContext *ctx, GLuint program )
|
||||
|
|
@ -4500,7 +4500,7 @@ void Iff::LinkProgram( RegalContext *ctx, GLuint program )
|
|||
p.UserShaderModeAttribs(ctx);
|
||||
}
|
||||
}
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
tbl.glLinkProgram( program );
|
||||
Program & p = shprogmap[ program ];
|
||||
|
||||
|
|
|
|||
|
|
@ -152,12 +152,12 @@ struct Obj
|
|||
textureNames.drv2app = sharingWith->obj->textureNames.drv2app;
|
||||
}
|
||||
|
||||
bufferNames.gen = ctx.dispatchGL.glGenBuffers;
|
||||
bufferNames.del = ctx.dispatchGL.glDeleteBuffers;
|
||||
vaoNames.gen = ctx.dispatchGL.glGenVertexArrays;
|
||||
vaoNames.del = ctx.dispatchGL.glDeleteVertexArrays;
|
||||
textureNames.gen = ctx.dispatchGL.glGenTextures;
|
||||
textureNames.del = ctx.dispatchGL.glDeleteTextures;
|
||||
bufferNames.gen = ctx.emu.curr.glGenBuffers;
|
||||
bufferNames.del = ctx.emu.curr.glDeleteBuffers;
|
||||
vaoNames.gen = ctx.emu.curr.glGenVertexArrays;
|
||||
vaoNames.del = ctx.emu.curr.glDeleteVertexArrays;
|
||||
textureNames.gen = ctx.emu.curr.glGenTextures;
|
||||
textureNames.del = ctx.emu.curr.glDeleteTextures;
|
||||
}
|
||||
|
||||
void Cleanup(RegalContext &ctx)
|
||||
|
|
@ -167,7 +167,7 @@ struct Obj
|
|||
|
||||
void BindBuffer(RegalContext &ctx, GLenum target, GLuint bufferBinding)
|
||||
{
|
||||
Dispatch::GL &tbl = ctx.dispatchGL;
|
||||
Dispatch::GL &tbl = ctx.emu.curr;
|
||||
tbl.glBindBuffer( target, bufferNames.ToDriverName( bufferBinding ) );
|
||||
}
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ struct Obj
|
|||
|
||||
void BindVertexArray(RegalContext &ctx, GLuint vao)
|
||||
{
|
||||
Dispatch::GL &tbl = ctx.dispatchGL;
|
||||
Dispatch::GL &tbl = ctx.emu.curr;
|
||||
tbl.glBindVertexArray( vaoNames.ToDriverName( vao ) );
|
||||
}
|
||||
|
||||
|
|
@ -223,7 +223,7 @@ struct Obj
|
|||
|
||||
void BindTexture(RegalContext &ctx, GLenum target, GLuint name)
|
||||
{
|
||||
Dispatch::GL &tbl = ctx.dispatchGL;
|
||||
Dispatch::GL &tbl = ctx.emu.curr;
|
||||
tbl.glBindTexture( target, textureNames.ToDriverName( name ) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
{
|
||||
Internal("Regal::Ppa::PushAttrib GL_SCISSOR_BIT ",State::Scissor::toString());
|
||||
if (!State::Scissor::fullyDefined())
|
||||
State::Scissor::getUndefined(ctx->dispatchGL);
|
||||
State::Scissor::getUndefined(ctx->emu.curr);
|
||||
scissorStack.push_back(State::Scissor());
|
||||
scissorStack.back() = *this;
|
||||
mask &= ~GL_SCISSOR_BIT;
|
||||
|
|
@ -183,7 +183,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
{
|
||||
Internal("Regal::Ppa::PushAttrib GL_VIEWPORT_BIT ",State::Viewport::toString());
|
||||
if (!State::Viewport::fullyDefined())
|
||||
State::Viewport::getUndefined(ctx->dispatchGL);
|
||||
State::Viewport::getUndefined(ctx->emu.curr);
|
||||
viewportStack.push_back(State::Viewport());
|
||||
viewportStack.back() = *this;
|
||||
mask &= ~GL_VIEWPORT_BIT;
|
||||
|
|
@ -241,7 +241,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
{
|
||||
Internal("Regal::Ppa::PushAttrib GL_COLOR_BUFFER_BIT ",State::ColorBuffer::toString());
|
||||
if (!State::ColorBuffer::fullyDefined())
|
||||
State::ColorBuffer::getUndefined(ctx->dispatchGL);
|
||||
State::ColorBuffer::getUndefined(ctx->emu.curr);
|
||||
colorBufferStack.push_back(State::ColorBuffer());
|
||||
colorBufferStack.back() = *this;
|
||||
mask &= ~GL_COLOR_BUFFER_BIT;
|
||||
|
|
@ -251,7 +251,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
{
|
||||
Internal("Regal::Ppa::PushAttrib GL_PIXEL_MODE_BIT ",State::PixelMode::toString());
|
||||
if (!State::PixelMode::fullyDefined())
|
||||
State::PixelMode::getUndefined(ctx->dispatchGL);
|
||||
State::PixelMode::getUndefined(ctx->emu.curr);
|
||||
pixelModeStack.push_back(State::PixelMode());
|
||||
pixelModeStack.back() = *this;
|
||||
mask &= ~GL_PIXEL_MODE_BIT;
|
||||
|
|
@ -273,7 +273,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
return;
|
||||
|
||||
if (mask)
|
||||
ctx->dispatchGL.glPushAttrib(mask);
|
||||
ctx->emu.curr.glPushAttrib(mask);
|
||||
}
|
||||
|
||||
void PopAttrib(RegalContext *ctx)
|
||||
|
|
@ -297,7 +297,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::Depth::set(ctx->dispatchGL);
|
||||
State::Depth::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_DEPTH_BUFFER_BIT;
|
||||
}
|
||||
|
|
@ -313,7 +313,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::Stencil::set(ctx->dispatchGL);
|
||||
State::Stencil::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_STENCIL_BUFFER_BIT;
|
||||
}
|
||||
|
|
@ -329,7 +329,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::Polygon::set(ctx->dispatchGL);
|
||||
State::Polygon::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_POLYGON_BIT;
|
||||
}
|
||||
|
|
@ -341,7 +341,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
|
||||
Internal("Regal::Ppa::PopAttrib GL_TRANSFORM_BIT ",State::Transform::toString());
|
||||
|
||||
State::Transform::transition(ctx->dispatchGL, transformStack.back());
|
||||
State::Transform::transition(ctx->emu.curr, transformStack.back());
|
||||
transformStack.pop_back();
|
||||
|
||||
mask &= ~GL_TRANSFORM_BIT;
|
||||
|
|
@ -358,7 +358,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::Hint::set(ctx->dispatchGL);
|
||||
State::Hint::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_HINT_BIT;
|
||||
}
|
||||
|
|
@ -390,7 +390,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::List::set(ctx->dispatchGL);
|
||||
State::List::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_LIST_BIT;
|
||||
}
|
||||
|
|
@ -406,7 +406,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::AccumBuffer::set(ctx->dispatchGL);
|
||||
State::AccumBuffer::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_ACCUM_BUFFER_BIT;
|
||||
}
|
||||
|
|
@ -423,8 +423,8 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// since the glPushAttrib() - revisit
|
||||
|
||||
if (!State::Scissor::fullyDefined())
|
||||
State::Scissor::getUndefined(ctx->dispatchGL);
|
||||
State::Scissor::set(ctx->dispatchGL);
|
||||
State::Scissor::getUndefined(ctx->emu.curr);
|
||||
State::Scissor::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_SCISSOR_BIT;
|
||||
}
|
||||
|
|
@ -441,8 +441,8 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// since the glPushAttrib() - revisit
|
||||
|
||||
if (!State::Viewport::fullyDefined())
|
||||
State::Viewport::getUndefined(ctx->dispatchGL);
|
||||
State::Viewport::set(ctx->dispatchGL);
|
||||
State::Viewport::getUndefined(ctx->emu.curr);
|
||||
State::Viewport::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_VIEWPORT_BIT;
|
||||
}
|
||||
|
|
@ -458,7 +458,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::Line::set(ctx->dispatchGL);
|
||||
State::Line::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_LINE_BIT;
|
||||
}
|
||||
|
|
@ -490,7 +490,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::Eval::set(ctx->dispatchGL);
|
||||
State::Eval::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_EVAL_BIT;
|
||||
}
|
||||
|
|
@ -506,7 +506,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::Fog::set(ctx->dispatchGL);
|
||||
State::Fog::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_FOG_BIT;
|
||||
}
|
||||
|
|
@ -522,7 +522,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::Point::set(ctx->dispatchGL);
|
||||
State::Point::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_POINT_BIT;
|
||||
}
|
||||
|
|
@ -538,7 +538,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::PolygonStipple::set(ctx->dispatchGL);
|
||||
State::PolygonStipple::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_POLYGON_STIPPLE_BIT;
|
||||
}
|
||||
|
|
@ -555,8 +555,8 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// since the glPushAttrib() - revisit
|
||||
|
||||
if (!State::ColorBuffer::fullyDefined())
|
||||
State::ColorBuffer::getUndefined(ctx->dispatchGL);
|
||||
State::ColorBuffer::set(ctx->dispatchGL);
|
||||
State::ColorBuffer::getUndefined(ctx->emu.curr);
|
||||
State::ColorBuffer::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_COLOR_BUFFER_BIT;
|
||||
}
|
||||
|
|
@ -573,8 +573,8 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// since the glPushAttrib() - revisit
|
||||
|
||||
if (!State::PixelMode::fullyDefined())
|
||||
State::PixelMode::getUndefined(ctx->dispatchGL);
|
||||
State::PixelMode::set(ctx->dispatchGL);
|
||||
State::PixelMode::getUndefined(ctx->emu.curr);
|
||||
State::PixelMode::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_PIXEL_MODE_BIT;
|
||||
}
|
||||
|
|
@ -590,7 +590,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
// Ideally we'd only set the state that has changed
|
||||
// since the glPushAttrib() - revisit
|
||||
|
||||
State::Lighting::set(ctx->dispatchGL);
|
||||
State::Lighting::set(ctx->emu.curr);
|
||||
|
||||
mask &= ~GL_LIGHTING_BIT;
|
||||
}
|
||||
|
|
@ -601,7 +601,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
return;
|
||||
|
||||
if (mask)
|
||||
ctx->dispatchGL.glPopAttrib();
|
||||
ctx->emu.curr.glPopAttrib();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -749,7 +749,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
if ( index < array_size( State::ColorBuffer::drawBuffers ))
|
||||
{
|
||||
if (!State::ColorBuffer::fullyDefined())
|
||||
State::ColorBuffer::getUndefined(ctx->dispatchGL);
|
||||
State::ColorBuffer::getUndefined(ctx->emu.curr);
|
||||
RegalAssertArrayIndex( State::ColorBuffer::drawBuffers, index );
|
||||
params[0] = static_cast<T>(State::ColorBuffer::drawBuffers[index]);
|
||||
}
|
||||
|
|
@ -976,7 +976,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
case GL_READ_BUFFER:
|
||||
{
|
||||
if (!State::PixelMode::fullyDefined())
|
||||
State::PixelMode::getUndefined(ctx->dispatchGL);
|
||||
State::PixelMode::getUndefined(ctx->emu.curr);
|
||||
params[0] = static_cast<T>(State::PixelMode::readBuffer);
|
||||
}
|
||||
break;
|
||||
|
|
@ -1130,7 +1130,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
if (index < ctx->emuInfo->gl_max_viewports)
|
||||
{
|
||||
if (!State::Scissor::fullyDefined())
|
||||
State::Scissor::getUndefined(ctx->dispatchGL);
|
||||
State::Scissor::getUndefined(ctx->emu.curr);
|
||||
params[0] = static_cast<T>(State::Scissor::scissorBox[index][0]);
|
||||
params[1] = static_cast<T>(State::Scissor::scissorBox[index][1]);
|
||||
params[2] = static_cast<T>(State::Scissor::scissorBox[index][2]);
|
||||
|
|
@ -1142,7 +1142,7 @@ struct Ppa : public State::Stencil, State::Depth, State::Polygon, State::Transfo
|
|||
if (index < ctx->emuInfo->gl_max_viewports)
|
||||
{
|
||||
if (!State::Viewport::fullyDefined())
|
||||
State::Viewport::getUndefined(ctx->dispatchGL);
|
||||
State::Viewport::getUndefined(ctx->emu.curr);
|
||||
params[0] = static_cast<T>(State::Viewport::viewport[index][0]);
|
||||
params[1] = static_cast<T>(State::Viewport::viewport[index][1]);
|
||||
params[2] = static_cast<T>(State::Viewport::viewport[index][2]);
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ struct Ppca : public ClientState::VertexArray, ClientState::PixelStore
|
|||
return;
|
||||
|
||||
if (mask)
|
||||
ctx.dispatchGL.glPushClientAttrib(mask);
|
||||
ctx.emu.curr.glPushClientAttrib(mask);
|
||||
}
|
||||
|
||||
void glPopClientAttrib(RegalContext &ctx)
|
||||
|
|
@ -164,7 +164,7 @@ struct Ppca : public ClientState::VertexArray, ClientState::PixelStore
|
|||
if (mask&GL_CLIENT_VERTEX_ARRAY_BIT)
|
||||
{
|
||||
RegalAssert(vertexArrayStack.size());
|
||||
ClientState::VertexArray::transition(ctx.dispatchGL, vertexArrayStack.back(), driverAllowsVertexAttributeArraysWithoutBoundBuffer);
|
||||
ClientState::VertexArray::transition(ctx.emu.curr, vertexArrayStack.back(), driverAllowsVertexAttributeArraysWithoutBoundBuffer);
|
||||
vertexArrayStack.pop_back();
|
||||
|
||||
Internal("Regal::Ppca::PopClientAttrib GL_CLIENT_VERTEX_ARRAY_BIT ",ClientState::VertexArray::toString());
|
||||
|
|
@ -175,7 +175,7 @@ struct Ppca : public ClientState::VertexArray, ClientState::PixelStore
|
|||
if (mask&GL_CLIENT_PIXEL_STORE_BIT)
|
||||
{
|
||||
RegalAssert(pixelStoreStack.size());
|
||||
ClientState::PixelStore::transition(ctx.dispatchGL, pixelStoreStack.back());
|
||||
ClientState::PixelStore::transition(ctx.emu.curr, pixelStoreStack.back());
|
||||
pixelStoreStack.pop_back();
|
||||
|
||||
Internal("Regal::Ppca::PopClientAttrib GL_CLIENT_PIXEL_STORE_BIT ",ClientState::PixelStore::toString());
|
||||
|
|
@ -189,7 +189,7 @@ struct Ppca : public ClientState::VertexArray, ClientState::PixelStore
|
|||
return;
|
||||
|
||||
if (mask)
|
||||
ctx.dispatchGL.glPopClientAttrib();
|
||||
ctx.emu.curr.glPopClientAttrib();
|
||||
}
|
||||
|
||||
void glClientAttribDefaultEXT(RegalContext &ctx, GLbitfield mask)
|
||||
|
|
@ -202,7 +202,7 @@ struct Ppca : public ClientState::VertexArray, ClientState::PixelStore
|
|||
|
||||
// Ideally we'd only set the state that has changed - revisit
|
||||
|
||||
ClientState::VertexArray::set(ctx.dispatchGL,driverAllowsVertexAttributeArraysWithoutBoundBuffer);
|
||||
ClientState::VertexArray::set(ctx.emu.curr,driverAllowsVertexAttributeArraysWithoutBoundBuffer);
|
||||
|
||||
mask &= ~GL_CLIENT_VERTEX_ARRAY_BIT;
|
||||
}
|
||||
|
|
@ -215,7 +215,7 @@ struct Ppca : public ClientState::VertexArray, ClientState::PixelStore
|
|||
|
||||
// Ideally we'd only set the state that has changed - revisit
|
||||
|
||||
ClientState::PixelStore::set(ctx.dispatchGL);
|
||||
ClientState::PixelStore::set(ctx.emu.curr);
|
||||
|
||||
mask &= ~GL_CLIENT_PIXEL_STORE_BIT;
|
||||
}
|
||||
|
|
@ -226,7 +226,7 @@ struct Ppca : public ClientState::VertexArray, ClientState::PixelStore
|
|||
return;
|
||||
|
||||
if (mask)
|
||||
ctx.dispatchGL.glClientAttribDefaultEXT(mask);
|
||||
ctx.emu.curr.glClientAttribDefaultEXT(mask);
|
||||
}
|
||||
|
||||
void glPushClientAttribDefaultEXT(RegalContext &ctx, GLbitfield mask)
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ namespace Emu
|
|||
void Quads::Init(RegalContext &ctx)
|
||||
{
|
||||
elementArrayBuffer = 0;
|
||||
Dispatch::GL & dt = ctx.dispatchGL;
|
||||
Dispatch::GL & dt = ctx.emu.curr;
|
||||
dt.glGenBuffers(1, &quadIndexBuffer);
|
||||
windingMode = GL_CCW;
|
||||
frontFaceMode = backFaceMode = GL_FILL;
|
||||
|
|
@ -178,7 +178,7 @@ bool Quads::glDrawArrays(RegalContext *ctx, GLenum mode, GLint first, GLsizei co
|
|||
Internal("Regal::Emu::Quads: drawLines =", drawLines);
|
||||
Internal("Regal::Emu::Quads: drawPoints =", drawPoints);
|
||||
|
||||
Dispatch::GL &dt = ctx->dispatchGL;
|
||||
Dispatch::GL &dt = ctx->emu.curr;
|
||||
|
||||
#define EMU_QUADS_BUFFER_SIZE 1024
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ struct Rect
|
|||
if (ctx->depthBeginEnd)
|
||||
return;
|
||||
|
||||
Dispatch::GL &dt = ctx->dispatchGL;
|
||||
Dispatch::GL &dt = ctx->emu.curr;
|
||||
|
||||
// incrementing context->depthBeginEnd here avoids an assert in log_glBegin and
|
||||
// also keeps the log indentation as it should be
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ So::BindSampler(GLuint unit, GLuint so)
|
|||
void
|
||||
So::GenTextures(RegalContext &ctx, GLsizei count, GLuint *textures)
|
||||
{
|
||||
ctx.dispatchGL.glGenTextures(count, textures);
|
||||
ctx.emu.curr.glGenTextures(count, textures);
|
||||
|
||||
for (GLsizei ii=0; ii<count; ii++)
|
||||
{
|
||||
|
|
@ -215,7 +215,7 @@ So::BindTexture(RegalContext &ctx, GLuint unit, GLenum target, GLuint to)
|
|||
}
|
||||
}
|
||||
|
||||
Dispatch::GL &tbl = ctx.dispatchGL;
|
||||
Dispatch::GL &tbl = ctx.emu.curr;
|
||||
|
||||
GLuint originallyActiveUnit = activeTextureUnit;
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ So::ActiveTexture( RegalContext &ctx, GLenum texture )
|
|||
return false;
|
||||
|
||||
activeTextureUnit = texture - GL_TEXTURE0;
|
||||
ctx.dispatchGL.glActiveTexture( texture );
|
||||
ctx.emu.curr.glActiveTexture( texture );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ So::SendStateToDriver(RegalContext &ctx, GLuint unit, GLenum target, SamplingSta
|
|||
}
|
||||
}
|
||||
|
||||
Dispatch::GL &tbl = ctx.dispatchGL;
|
||||
Dispatch::GL &tbl = ctx.emu.curr;
|
||||
|
||||
if (newState.BorderColor[0] != drv.BorderColor[0] ||
|
||||
newState.BorderColor[1] != drv.BorderColor[1] ||
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@ struct Enable
|
|||
|
||||
inline Enable &get(RegalContext &ctx)
|
||||
{
|
||||
Dispatch::GL &dt = ctx.dispatchGL;
|
||||
Dispatch::GL &dt = ctx.emu.curr;
|
||||
alphaTest = dt.glIsEnabled(GL_ALPHA_TEST);
|
||||
autoNormal = dt.glIsEnabled(GL_AUTO_NORMAL);
|
||||
size_t n = array_size( blend );
|
||||
|
|
@ -511,7 +511,7 @@ struct Enable
|
|||
|
||||
inline const Enable &set(RegalContext &ctx) const
|
||||
{
|
||||
Dispatch::GL &dt = ctx.dispatchGL;
|
||||
Dispatch::GL &dt = ctx.emu.curr;
|
||||
setEnable(dt,GL_ALPHA_TEST,alphaTest);
|
||||
setEnable(dt,GL_AUTO_NORMAL,autoNormal);
|
||||
size_t n = array_size( blend );
|
||||
|
|
@ -1980,7 +1980,7 @@ struct Multisample
|
|||
|
||||
inline Multisample &get(RegalContext &ctx)
|
||||
{
|
||||
Dispatch::GL &dt = ctx.dispatchGL;
|
||||
Dispatch::GL &dt = ctx.emu.curr;
|
||||
multisample = dt.glIsEnabled(GL_MULTISAMPLE);
|
||||
sampleAlphaToCoverage = dt.glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
sampleAlphaToOne = dt.glIsEnabled(GL_SAMPLE_ALPHA_TO_ONE);
|
||||
|
|
@ -1995,7 +1995,7 @@ struct Multisample
|
|||
|
||||
inline const Multisample &set(RegalContext &ctx) const
|
||||
{
|
||||
Dispatch::GL &dt = ctx.dispatchGL;
|
||||
Dispatch::GL &dt = ctx.emu.curr;
|
||||
setEnable(dt,GL_MULTISAMPLE,multisample);
|
||||
setEnable(dt,GL_SAMPLE_ALPHA_TO_COVERAGE,sampleAlphaToCoverage);
|
||||
setEnable(dt,GL_SAMPLE_ALPHA_TO_ONE,sampleAlphaToOne);
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace Emu {
|
|||
|
||||
void TextureStorage( RegalContext * ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width )
|
||||
{
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
for (GLsizei i = 0; i < levels; i++)
|
||||
{
|
||||
tbl.glTexImage1D( target, i, internalformat, width, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
|
|
@ -105,7 +105,7 @@ namespace Emu {
|
|||
|
||||
void TextureStorage( RegalContext * ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height )
|
||||
{
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
for (GLsizei i = 0; i < levels; i++)
|
||||
{
|
||||
if (target == GL_TEXTURE_CUBE_MAP)
|
||||
|
|
@ -131,7 +131,7 @@ namespace Emu {
|
|||
|
||||
void TextureStorage( RegalContext * ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth )
|
||||
{
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
for (GLsizei i = 0; i < levels; i++)
|
||||
{
|
||||
tbl.glTexImage3D( target, i, internalformat, width, height, depth, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
|
|
@ -152,7 +152,7 @@ namespace Emu {
|
|||
if (pname != GL_TEXTURE_IMMUTABLE_FORMAT)
|
||||
return false;
|
||||
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
|
||||
GLint id;
|
||||
tbl.glGetIntegerv( BindingFromTarget(target), &id );
|
||||
|
|
|
|||
|
|
@ -168,9 +168,9 @@ struct Vao
|
|||
if( ctx.info->core )
|
||||
{
|
||||
maxName = 1;
|
||||
ctx.dispatchGL.glGenVertexArrays( 1, & coreVao );
|
||||
ctx.emu.curr.glGenVertexArrays( 1, & coreVao );
|
||||
RegalAssert( coreVao != 0 );
|
||||
ctx.dispatchGL.glBindVertexArray( coreVao );
|
||||
ctx.emu.curr.glBindVertexArray( coreVao );
|
||||
}
|
||||
else
|
||||
coreVao = 0;
|
||||
|
|
@ -213,7 +213,7 @@ struct Vao
|
|||
{
|
||||
maxName = current;
|
||||
}
|
||||
Dispatch::GL &tbl = ctx.dispatchGL;
|
||||
Dispatch::GL &tbl = ctx.emu.curr;
|
||||
tbl.glBindBuffer( GL_ARRAY_BUFFER, vao.vertexBuffer );
|
||||
tbl.glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, vao.indexBuffer );
|
||||
GLuint lastBuffer = vao.vertexBuffer;
|
||||
|
|
@ -289,7 +289,7 @@ struct Vao
|
|||
if (index >= max_vertex_attribs || index >= REGAL_EMU_MAX_VERTEX_ATTRIBS)
|
||||
return;
|
||||
|
||||
Dispatch::GL &tbl = ctx.dispatchGL;
|
||||
Dispatch::GL &tbl = ctx.emu.curr;
|
||||
Array &a = objects[current].a[index];
|
||||
a.enabled = enable;
|
||||
if( a.enabled == GL_TRUE )
|
||||
|
|
@ -400,7 +400,7 @@ struct Vao
|
|||
|
||||
RegalAssert( a.buffer == 0 || GLuint64( a.pointer ) < ( 1 << 22 ) );
|
||||
|
||||
ctx.dispatchGL.glVertexAttribPointer( index, size, type, normalized, stride, pointer );
|
||||
ctx.emu.curr.glVertexAttribPointer( index, size, type, normalized, stride, pointer );
|
||||
}
|
||||
|
||||
void Validate( RegalContext &ctx )
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ namespace Emu {
|
|||
Internal("Regal::Xfer::SubImage2D","ctx=",ctx," target=",Token::GLenumToString(target)," internalFormat=",Token::GLenumToString(internalFormat)," level=",level," format=",Token::GLenumToString(format)," type=",Token::GLenumToString(type));
|
||||
RegalAssert(ctx);
|
||||
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
int complex = 0;
|
||||
int tgttype = 0;
|
||||
if ( format == GL_RGBA8 ) {
|
||||
|
|
@ -269,7 +269,7 @@ namespace Emu {
|
|||
Internal("Regal::Xfer::CompressedSubImage2D","target=", Token::GLenumToString(target), " level=", level,
|
||||
" format=", Token::GLenumToString(format));
|
||||
RegalAssert(ctx);
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
|
||||
#if !REGAL_NO_SQUISH
|
||||
if( ShouldDecompress( ctx, format ) )
|
||||
|
|
@ -339,7 +339,7 @@ void Xfer::TexImage2D( RegalContext * ctx, GLenum target, GLint level, GLint int
|
|||
{
|
||||
Internal("Regal::Xfer::TexImage2D","ctx=",ctx," target=",Token::GLenumToString(target)," level=",level," internalFormat=",Token::GLenumToString(internalFormat));
|
||||
RegalAssert(ctx);
|
||||
Dispatch::GL &tbl = ctx->dispatchGL;
|
||||
Dispatch::GL &tbl = ctx->emu.curr;
|
||||
|
||||
if (ctx->isCore() || ctx->isES2())
|
||||
{
|
||||
|
|
@ -422,7 +422,7 @@ void Xfer::CompressedTexImage2D( RegalContext * ctx, GLenum target, GLint level,
|
|||
" format=", Token::GLenumToString(internalFormat));
|
||||
|
||||
RegalAssert(ctx);
|
||||
Dispatch::GL & tbl = ctx->dispatchGL;
|
||||
Dispatch::GL & tbl = ctx->emu.curr;
|
||||
if( ShouldDecompress( ctx, internalFormat ) ) {
|
||||
Internal("Regal::Xfer::CompressedTexImage2D","decompressing texture data");
|
||||
GLenum ifmt = GL_RGBA;
|
||||
|
|
|
|||
Loading…
Reference in a new issue