swrast: initial multi-threaded span rendering

Optional parallel rendering of spans using OpenMP.
Initial implementation for aa triangles. A new option for scons is
also provided to activate the openmp support (off by default).

Signed-off-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Andreas Fänger
2011-08-10 08:07:29 +00:00
committed by Brian Paul
parent fa351bd2e0
commit e411cd7b0a
6 changed files with 91 additions and 36 deletions

View File

@@ -596,6 +596,18 @@ def generate(env):
libs += ['m', 'pthread', 'dl']
env.Append(LIBS = libs)
# OpenMP
if env['openmp']:
if env['msvc']:
env.Append(CCFLAGS = ['/openmp'])
# When building openmp release VS2008 link.exe crashes with LNK1103 error.
# Workaround: overwrite PDB flags with empty value as it isn't required anyways
if env['build'] == 'release':
env['PDB'] = ''
if env['gcc']:
env.Append(CCFLAGS = ['-fopenmp'])
env.Append(LIBS = ['gomp'])
# Load tools
env.Tool('lex')
env.Tool('yacc')