mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 20:58:04 +02:00
glx: Don't rely on struct _glapi_table
When --enable-shared-glapi is used, all non-ABI entries in the table are lies. There are two completely separate code generation paths used to assign dispatch offset. Neither has any clue about the other. Unsurprisingly, the can't agree on what offsets to assign. This adds a bunch of overhead to __glXNewIndirectAPI, but this function is called at most once. The test ExtensionNopDispatch was removed. There was just no way to make this test work with the information provided in shared-glapi. Since indirect_glx.c uses _glapi_get_proc_offset now, it was also impossible to make the tests work without shared-glapi. So much pain. This fixes indirect rendering with shared-glapi. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
52d6df8aa7
commit
f5dffb7e36
3 changed files with 675 additions and 680 deletions
|
|
@ -1,6 +1,8 @@
|
|||
if HAVE_SHARED_GLAPI
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_builddir)/src/gtest/include \
|
||||
-I$(top_builddir)/src/mapi \
|
||||
-I$(top_builddir)/src/mesa \
|
||||
-I$(top_builddir)/src/glx \
|
||||
-I$(top_builddir)/include \
|
||||
$(X11_CFLAGS)
|
||||
|
|
@ -18,4 +20,6 @@ glx_test_SOURCES = \
|
|||
glx_test_LDADD = \
|
||||
$(top_builddir)/src/glx/libglx.la \
|
||||
$(top_builddir)/src/gtest/libgtest.la \
|
||||
$(top_builddir)/src/mapi/shared-glapi/libglapi.la \
|
||||
-lpthread
|
||||
endif
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -928,6 +928,7 @@ class PrintGlxProtoInit_c(gl_XML.gl_print_base):
|
|||
#include "indirect_init.h"
|
||||
#include "indirect.h"
|
||||
#include "glapi.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -945,26 +946,24 @@ static int NoOp(void)
|
|||
*/
|
||||
struct _glapi_table * __glXNewIndirectAPI( void )
|
||||
{
|
||||
struct _glapi_table *glAPI;
|
||||
GLuint entries;
|
||||
_glapi_proc *table;
|
||||
unsigned entries;
|
||||
unsigned i;
|
||||
int o;
|
||||
|
||||
entries = _glapi_get_dispatch_table_size();
|
||||
glAPI = (struct _glapi_table *) Xmalloc(entries * sizeof(void *));
|
||||
table = (_glapi_proc *) Xmalloc(entries * sizeof(_glapi_proc));
|
||||
|
||||
/* first, set all entries to point to no-op functions */
|
||||
{
|
||||
int i;
|
||||
void **dispatch = (void **) glAPI;
|
||||
for (i = 0; i < entries; i++) {
|
||||
dispatch[i] = (void *) NoOp;
|
||||
}
|
||||
for (i = 0; i < entries; i++) {
|
||||
table[i] = (_glapi_proc) NoOp;
|
||||
}
|
||||
|
||||
/* now, initialize the entries we understand */"""
|
||||
|
||||
def printRealFooter(self):
|
||||
print """
|
||||
return glAPI;
|
||||
return (struct _glapi_table *) table;
|
||||
}
|
||||
"""
|
||||
return
|
||||
|
|
@ -973,14 +972,22 @@ struct _glapi_table * __glXNewIndirectAPI( void )
|
|||
def printBody(self, api):
|
||||
for [name, number] in api.categoryIterate():
|
||||
if number != None:
|
||||
preamble = '\n /* %3u. %s */\n\n' % (int(number), name)
|
||||
preamble = '\n /* %3u. %s */\n' % (int(number), name)
|
||||
else:
|
||||
preamble = '\n /* %s */\n\n' % (name)
|
||||
preamble = '\n /* %s */\n' % (name)
|
||||
|
||||
for func in api.functionIterateByCategory(name):
|
||||
if func.client_supported_for_indirect():
|
||||
print '%s glAPI->%s = __indirect_gl%s;' % (preamble, func.name, func.name)
|
||||
preamble = ''
|
||||
if preamble:
|
||||
print preamble
|
||||
preamble = None
|
||||
|
||||
if func.is_abi():
|
||||
print ' table[{offset}] = (_glapi_proc) __indirect_gl{name};'.format(name = func.name, offset = func.offset)
|
||||
else:
|
||||
print ' o = _glapi_get_proc_offset("gl{0}");'.format(func.name)
|
||||
print ' assert(o > 0);'
|
||||
print ' table[o] = (_glapi_proc) __indirect_gl{0};'.format(func.name)
|
||||
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue