noinst_LTLIBRARIES = libmesaswr.la
-libmesaswr_la_SOURCES = $(LOADER_SOURCES)
+# gen_knobs.* included here to provide driver access to swr configuration
+libmesaswr_la_SOURCES = \
+ $(CXX_SOURCES) \
+ $(COMMON_CXX_SOURCES) \
+ $(JITTER_CXX_SOURCES) \
+ rasterizer/codegen/gen_knobs.cpp \
+ rasterizer/codegen/gen_knobs.h \
+ $(LOADER_SOURCES)
COMMON_CXXFLAGS = \
-fno-strict-aliasing \
-I$(srcdir)/rasterizer/jitter \
-I$(srcdir)/rasterizer/archrast
+# SWR_AVX_CXXFLAGS needed for intrinsic usage in swr api headers
+libmesaswr_la_CXXFLAGS = \
+ $(SWR_AVX_CXXFLAGS) \
+ $(COMMON_CXXFLAGS)
+
COMMON_SOURCES = \
- $(CXX_SOURCES) \
$(ARCHRAST_CXX_SOURCES) \
$(COMMON_CXX_SOURCES) \
$(CORE_CXX_SOURCES) \
- $(JITTER_CXX_SOURCES) \
$(MEMORY_CXX_SOURCES) \
$(BUILT_SOURCES)
--cpp \
--hpp
-COMMON_LIBADD = \
- $(top_builddir)/src/gallium/auxiliary/libgallium.la \
- $(top_builddir)/src/mesa/libmesagallium.la \
- $(LLVM_LIBS)
-
COMMON_LDFLAGS = \
-shared \
-module \
-no-undefined \
$(GC_SECTIONS) \
- $(NO_UNDEFINED) \
- $(LLVM_LDFLAGS)
-
+ $(NO_UNDEFINED)
lib_LTLIBRARIES = libswrAVX.la libswrAVX2.la
libswrAVX_la_SOURCES = \
$(COMMON_SOURCES)
-libswrAVX_la_LIBADD = \
- $(COMMON_LIBADD)
-
libswrAVX_la_LDFLAGS = \
$(COMMON_LDFLAGS)
libswrAVX2_la_SOURCES = \
$(COMMON_SOURCES)
-libswrAVX2_la_LIBADD = \
- $(COMMON_LIBADD)
-
libswrAVX2_la_LDFLAGS = \
$(COMMON_LDFLAGS)
llvm_includedir = env.backtick('%s --includedir' % llvm_config).rstrip()
print "llvm include dir %s" % llvm_includedir
-# the loader is included in the mesa lib itself
-# All the remaining files are in loadable modules
-loadersource = env.ParseSourceList('Makefile.sources', [
- 'LOADER_SOURCES'
-])
-
if not env['msvc'] :
env.Append(CCFLAGS = [
'-std=c++11',
source = built_sources
source += env.ParseSourceList(swrroot + 'Makefile.sources', [
- 'CXX_SOURCES',
'ARCHRAST_CXX_SOURCES',
'COMMON_CXX_SOURCES',
'CORE_CXX_SOURCES',
- 'JITTER_CXX_SOURCES',
'MEMORY_CXX_SOURCES'
])
-env.Prepend(LIBS = [ mesautil, mesa, gallium ])
-
env.Prepend(CPPPATH = [
'.',
'rasterizer',
)
env.Alias('swrAVX2', swrAVX2)
+source = env.ParseSourceList(swrroot + 'Makefile.sources', [
+ 'CXX_SOURCES',
+ 'COMMON_CXX_SOURCES',
+ 'JITTER_CXX_SOURCES',
+ 'LOADER_SOURCES'
+])
+source += [
+ 'rasterizer/codegen/gen_knobs.cpp',
+ 'rasterizer/archrast/gen_ar_event.cpp',
+ ]
# main SWR lib
-swr = env.ConvenienceLibrary(
+envSWR = envavx.Clone() # pick up the arch flag for intrinsic usage
+swr = envSWR.ConvenienceLibrary(
target = 'swr',
- source = loadersource,
+ source = source,
)
-
# treat arch libs as dependencies, even though they are not linked
# into swr, so we don't have to build them separately
Depends(swr, ['swrAVX', 'swrAVX2'])
AlignedMalloc(sizeof(struct swr_context), KNOB_SIMD_BYTES);
memset(ctx, 0, sizeof(struct swr_context));
- SwrGetInterface(ctx->api);
+ swr_screen(p_screen)->pfnSwrGetInterface(ctx->api);
ctx->swrDC.pAPI = &ctx->api;
ctx->blendJIT =
#include "util/u_cpu_detect.h"
#include "util/u_dl.h"
#include "swr_public.h"
-
-#include "pipe/p_screen.h"
+#include "swr_screen.h"
#include <stdio.h>
-typedef pipe_screen *(*screen_create_proc)(struct sw_winsys *winsys);
-
struct pipe_screen *
swr_create_screen(struct sw_winsys *winsys)
{
exit(-1);
}
- util_dl_proc pScreenProc = util_dl_get_proc_address(pLibrary, "swr_create_screen_internal");
+ util_dl_proc pApiProc = util_dl_get_proc_address(pLibrary, "SwrGetInterface");
- if (!pScreenProc) {
+ if (!pApiProc) {
fprintf(stderr, "SWR library search failure: %s\n", util_dl_error());
exit(-1);
}
- screen_create_proc pScreenCreate = (screen_create_proc)pScreenProc;
+ struct pipe_screen *screen = swr_create_screen_internal(winsys);
+ swr_screen(screen)->pfnSwrGetInterface = (PFNSwrGetInterface)pApiProc;
- return pScreenCreate(winsys);
+ return screen;
}
uint8_t msaa_max_count;
HANDLE hJitMgr;
+
+ PFNSwrGetInterface pfnSwrGetInterface;
};
static INLINE struct swr_screen *