Module: Mesa Branch: master Commit: fed482f5e30ea6b230ed20982551b340570dc3e9 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fed482f5e30ea6b230ed20982551b340570dc3e9
Author: Chia-I Wu <o...@lunarg.com> Date: Wed Jun 8 22:04:16 2011 +0800 mesa: fix GLES remap table setup again Generate different glapidispatch.h's for GL and GLES. For GLES, we want a local remap table. This reverts commit 5af46e836073d2112b147b524e441bdb808cc128. The commit will break GL remap table setup when main/glapidispatch.h is regenerated. --- src/mapi/glapi/gen/gl_table.py | 22 +++++++++++++--------- src/mesa/main/es_generator.py | 5 +++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/mapi/glapi/gen/gl_table.py b/src/mapi/glapi/gen/gl_table.py index c3cc616..bd3f3eb 100644 --- a/src/mapi/glapi/gen/gl_table.py +++ b/src/mapi/glapi/gen/gl_table.py @@ -149,14 +149,18 @@ class PrintRemapTable(gl_XML.gl_print_base): print '#else /* !_GLAPI_USE_REMAP_TABLE */' print '' - print '#define driDispatchRemapTable_size %u' % (count) - print 'extern int driDispatchRemapTable[ driDispatchRemapTable_size ];' - print '' - print '#if FEATURE_remap_table' - print '#define driDispatchRemapTable remap_table' - print 'static int remap_table[driDispatchRemapTable_size];' - print '#endif' - print '' + if self.es: + remap_table = "esLocalRemapTable" + + print '#define %s_size %u' % (remap_table, count) + print 'static int %s[ %s_size ];' % (remap_table, remap_table) + print '' + else: + remap_table = "driDispatchRemapTable" + + print '#define %s_size %u' % (remap_table, count) + print 'extern int %s[ %s_size ];' % (remap_table, remap_table) + print '' for f, index in functions: print '#define %s_remap_index %u' % (f.name, index) @@ -164,7 +168,7 @@ class PrintRemapTable(gl_XML.gl_print_base): print '' for f, index in functions: - print '#define _gloffset_%s driDispatchRemapTable[%s_remap_index]' % (f.name, f.name) + print '#define _gloffset_%s %s[%s_remap_index]' % (f.name, remap_table, f.name) print '' print '#endif /* _GLAPI_USE_REMAP_TABLE */' diff --git a/src/mesa/main/es_generator.py b/src/mesa/main/es_generator.py index 87d8bd3..5b49416 100644 --- a/src/mesa/main/es_generator.py +++ b/src/mesa/main/es_generator.py @@ -680,6 +680,7 @@ print """ #if FEATURE_remap_table +/* define esLocalRemapTable */ /* cannot include main/dispatch.h here */ #define _GLAPI_USE_REMAP_TABLE #include "%sapi/main/glapidispatch.h" @@ -701,7 +702,7 @@ init_remap_table(void) return; } - for (i = 0; i < driDispatchRemapTable_size; i++) { + for (i = 0; i < esLocalRemapTable_size; i++) { GLint offset; const char *spec; @@ -710,7 +711,7 @@ init_remap_table(void) spec = _mesa_function_pool + remap[i].pool_index; offset = _mesa_map_function_spec(spec); - remap_table[i] = offset; + esLocalRemapTable[i] = offset; } initialized = GL_TRUE; _glthread_UNLOCK_MUTEX(mutex); _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit