From 85a08f8fc761d8501fc315d16df6ce0fba9f091e Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 18 Oct 2010 06:24:30 -0700 Subject: gallivm: Remove the EMMS opcodes. Unnecessary now that lp_set_target_options() successful disables MMX code emission. --- src/gallium/drivers/llvmpipe/lp_state_fs.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 9fbedac165f..e4495e33d09 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -761,11 +761,6 @@ generate_fragment(struct llvmpipe_screen *screen, } } -#ifdef PIPE_ARCH_X86 - /* Avoid corrupting the FPU stack on 32bit OSes. */ - lp_build_intrinsic(builder, "llvm.x86.mmx.emms", LLVMVoidType(), NULL, 0); -#endif - LLVMBuildRetVoid(builder); LLVMDisposeBuilder(builder); -- cgit v1.2.3 From 601498ae73e654c2de997ea75075613a694d604d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Nov 2010 13:30:22 +0000 Subject: scons: Revamp how to specify targets to build. Use scons target and dependency system instead of ad-hoc options. Now is simply a matter of naming what to build. For example: scons libgl-xlib scons libgl-gdi scons graw-progs scons llvmpipe and so on. And there is also the possibility of scepcified subdirs, e.g. scons src/gallium/drivers If nothing is specified then everything will be build. There might be some rough corners over the next days. Please bare with me. --- SConstruct | 123 +---- common.py | 40 +- scons/gallium.py | 88 +++- scons/llvm.py | 13 +- scons/udis86.py | 4 +- scons/x11.py | 18 +- src/SConscript | 20 +- src/egl/main/SConscript | 92 ++-- src/egl/main/eglconfig.h | 1 + src/gallium/SConscript | 98 +++- src/gallium/auxiliary/SConscript | 71 +-- src/gallium/drivers/i915/SConscript | 2 +- src/gallium/drivers/i965/SConscript | 2 +- src/gallium/drivers/llvmpipe/README | 65 +-- src/gallium/drivers/llvmpipe/SConscript | 6 +- src/gallium/drivers/rbug/README | 16 +- src/gallium/drivers/softpipe/SConscript | 2 + src/gallium/drivers/sw/SConscript | 1 - src/gallium/drivers/trace/README | 18 +- src/gallium/state_trackers/egl/SConscript | 53 ++- src/gallium/state_trackers/glx/xlib/SConscript | 38 +- src/gallium/state_trackers/python/SConscript | 106 +++-- src/gallium/state_trackers/vega/SConscript | 81 ++-- src/gallium/state_trackers/xorg/SConscript | 63 +-- src/gallium/targets/SConscript | 41 -- src/gallium/targets/SConscript.dri | 32 +- src/gallium/targets/dri-i915/SConscript | 8 +- src/gallium/targets/dri-i965/SConscript | 8 +- src/gallium/targets/dri-r300/SConscript | 8 +- src/gallium/targets/dri-r600/SConscript | 8 +- src/gallium/targets/dri-swrast/SConscript | 5 +- src/gallium/targets/dri-vmwgfx/SConscript | 8 +- src/gallium/targets/egl-gdi/SConscript | 92 ++-- src/gallium/targets/graw-null/SConscript | 40 +- src/gallium/targets/graw-null/graw_null.c | 69 +-- src/gallium/targets/graw-null/graw_util.c | 53 +++ src/gallium/targets/graw-xlib/SConscript | 19 +- src/gallium/targets/graw-xlib/graw_util.c | 50 -- src/gallium/targets/libgl-gdi/SConscript | 85 ++-- src/gallium/targets/libgl-xlib/SConscript | 27 +- src/gallium/targets/xorg-vmwgfx/SConscript | 114 +++-- src/gallium/tests/graw/SConscript | 26 +- src/gallium/tests/unit/SConscript | 4 +- src/gallium/winsys/SConscript | 67 ++- src/glut/glx/SConscript | 1 - src/mapi/glapi/SConscript | 143 +++--- src/mapi/vgapi/.gitignore | 1 + src/mesa/SConscript | 629 +++++++++++++------------ 48 files changed, 1172 insertions(+), 1387 deletions(-) delete mode 100644 src/gallium/targets/SConscript create mode 100644 src/gallium/targets/graw-null/graw_util.c delete mode 100644 src/gallium/targets/graw-xlib/graw_util.c create mode 100644 src/mapi/vgapi/.gitignore (limited to 'src/gallium/drivers') diff --git a/SConstruct b/SConstruct index 558ebf90aaa..c6198041fb0 100644 --- a/SConstruct +++ b/SConstruct @@ -3,14 +3,14 @@ # # For example, invoke scons as # -# scons debug=1 dri=0 machine=x86 +# scons build=debug llvm=yes machine=x86 # # to set configuration variables. Or you can write those options to a file # named config.py: # # # config.py -# debug=1 -# dri=0 +# build='debug' +# llvm=True # machine='x86' # # Invoke @@ -30,54 +30,8 @@ import common ####################################################################### # Configuration options -default_statetrackers = 'mesa' -default_targets = 'graw-null' - -if common.default_platform in ('linux', 'freebsd', 'darwin'): - default_drivers = 'softpipe,galahad,failover,svga,i915,i965,trace,identity,llvmpipe' - default_winsys = 'xlib' -elif common.default_platform in ('winddk',): - default_drivers = 'softpipe,svga,i915,i965,trace,identity' - default_winsys = 'all' -elif common.default_platform in ('embedded',): - default_drivers = 'softpipe,llvmpipe' - default_winsys = 'xlib' -else: - default_drivers = 'all' - default_winsys = 'all' - opts = Variables('config.py') common.AddOptions(opts) -opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers, - ['mesa', 'python', 'xorg', 'egl'])) -opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers, - ['softpipe', 'galahad', 'failover', 'svga', 'i915', 'i965', 'trace', 'r300', 'r600', 'identity', 'llvmpipe', 'nouveau', 'nv50', 'nvfx'])) -opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys, - ['xlib', 'vmware', 'i915', 'i965', 'gdi', 'radeon', 'r600', 'graw-xlib'])) - -opts.Add(ListVariable('targets', 'driver targets to build', default_targets, - ['dri-i915', - 'dri-i965', - 'dri-nouveau', - 'dri-radeong', - 'dri-swrast', - 'dri-vmwgfx', - 'egl-i915', - 'egl-i965', - 'egl-nouveau', - 'egl-radeon', - 'egl-swrast', - 'egl-vmwgfx', - 'graw-xlib', - 'graw-null', - 'libgl-gdi', - 'libgl-xlib', - 'xorg-i915', - 'xorg-i965', - 'xorg-nouveau', - 'xorg-radeon', - 'xorg-vmwgfx'])) - opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0'))) env = Environment( @@ -87,61 +41,26 @@ env = Environment( ENV = os.environ, ) -if os.environ.has_key('CC'): - env['CC'] = os.environ['CC'] -if os.environ.has_key('CFLAGS'): - env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS']) -if os.environ.has_key('CXX'): - env['CXX'] = os.environ['CXX'] -if os.environ.has_key('CXXFLAGS'): - env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS']) -if os.environ.has_key('LDFLAGS'): - env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS']) +# Backwards compatability with old target configuration variable +try: + targets = ARGUMENTS['targets'] +except KeyError: + pass +else: + targets = targets.split(',') + print 'scons: warning: targets option is deprecated; pass the targets on their own such as' + print + print ' scons %s' % ' '.join(targets) + print + COMMAND_LINE_TARGETS.append(targets) -Help(opts.GenerateHelpText(env)) -# replicate options values in local variables -debug = env['debug'] -dri = env['dri'] -machine = env['machine'] -platform = env['platform'] - -# derived options -x86 = machine == 'x86' -ppc = machine == 'ppc' -gcc = platform in ('linux', 'freebsd', 'darwin', 'embedded') -msvc = platform in ('windows', 'winddk') - -Export([ - 'debug', - 'x86', - 'ppc', - 'dri', - 'platform', - 'gcc', - 'msvc', -]) +Help(opts.GenerateHelpText(env)) ####################################################################### # Environment setup -# Always build trace, rbug, identity, softpipe, and llvmpipe (where possible) -if 'trace' not in env['drivers']: - env['drivers'].append('trace') -if 'rbug' not in env['drivers']: - env['drivers'].append('rbug') -if 'galahad' not in env['drivers']: - env['drivers'].append('galahad') -if 'identity' not in env['drivers']: - env['drivers'].append('identity') -if 'softpipe' not in env['drivers']: - env['drivers'].append('softpipe') -if env['llvm'] and 'llvmpipe' not in env['drivers']: - env['drivers'].append('llvmpipe') -if 'sw' not in env['drivers']: - env['drivers'].append('sw') - # Includes env.Prepend(CPPPATH = [ '#/include', @@ -157,7 +76,7 @@ if env['msvc']: env.Append(CPPPATH = ['#include/c99']) # Embedded -if platform == 'embedded': +if env['platform'] == 'embedded': env.Append(CPPDEFINES = [ '_POSIX_SOURCE', ('_POSIX_C_SOURCE', '199309L'), @@ -174,7 +93,7 @@ if platform == 'embedded': ]) # Posix -if platform in ('posix', 'linux', 'freebsd', 'darwin'): +if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'): env.Append(CPPDEFINES = [ '_POSIX_SOURCE', ('_POSIX_C_SOURCE', '199309L'), @@ -184,9 +103,9 @@ if platform in ('posix', 'linux', 'freebsd', 'darwin'): 'PTHREADS', 'HAVE_POSIX_MEMALIGN', ]) - if gcc: + if env['gcc']: env.Append(CFLAGS = ['-fvisibility=hidden']) - if platform == 'darwin': + if env['platform'] == 'darwin': env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE']) env.Append(LIBS = [ 'm', @@ -212,5 +131,3 @@ SConscript( duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html ) -env.Default('src') - diff --git a/common.py b/common.py index 13e8dc83e97..b7749c925df 100644 --- a/common.py +++ b/common.py @@ -8,6 +8,8 @@ import subprocess import sys import platform as _platform +import SCons.Script.SConscript + ####################################################################### # Defaults @@ -20,6 +22,15 @@ _platform_map = { default_platform = sys.platform default_platform = _platform_map.get(default_platform, default_platform) +# Search sys.argv[] for a "platform=foo" argument since we don't have +# an 'env' variable at this point. +if 'platform' in SCons.Script.ARGUMENTS: + selected_platform = SCons.Script.ARGUMENTS['platform'] +else: + selected_platform = default_platform + +cross_compiling = selected_platform != default_platform + _machine_map = { 'x86': 'x86', 'i386': 'x86', @@ -37,38 +48,26 @@ if 'PROCESSOR_ARCHITECTURE' in os.environ: else: default_machine = _platform.machine() default_machine = _machine_map.get(default_machine, 'generic') +default_toolchain = 'default' + +if selected_platform == 'windows' and cross_compiling: + default_machine = 'x86' + default_toolchain = 'crossmingw' # find default_llvm value if 'LLVM' in os.environ: default_llvm = 'yes' else: - # Search sys.argv[] for a "platform=foo" argument since we don't have - # an 'env' variable at this point. - platform = default_platform - pattern = re.compile("(platform=)(.*)") - for arg in sys.argv: - m = pattern.match(arg) - if m: - platform = m.group(2) - default_llvm = 'no' try: - if platform != 'windows' and subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0: + if selected_platform != 'windows' and \ + subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0: default_llvm = 'yes' except: pass -# find default_dri value -if default_platform in ('linux', 'freebsd'): - default_dri = 'yes' -elif default_platform in ('winddk', 'windows', 'wince', 'darwin'): - default_dri = 'no' -else: - default_dri = 'no' - - ####################################################################### # Common options @@ -88,8 +87,7 @@ def AddOptions(opts): allowed_values=('generic', 'ppc', 'x86', 'x86_64'))) opts.Add(EnumOption('platform', 'target platform', default_platform, allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos5', 'freebsd8'))) - opts.Add('toolchain', 'compiler toolchain', 'default') + opts.Add('toolchain', 'compiler toolchain', default_toolchain) opts.Add(BoolOption('llvm', 'use LLVM', default_llvm)) - opts.Add(BoolOption('dri', 'build DRI drivers', default_dri)) opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes')) opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no')) diff --git a/scons/gallium.py b/scons/gallium.py index b065b7bc49f..194b1524e6c 100644 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -98,6 +98,38 @@ def num_jobs(): return 1 +def pkg_config_modules(env, name, modules): + '''Simple wrapper for pkg-config.''' + + env[name] = False + + if env['platform'] == 'windows': + return + + if not env.Detect('pkg-config'): + return + + # Put -I and -L flags directly into the environment, as these don't affect + # the compilation of targets that do not use them + try: + env.ParseConfig('pkg-config --cflags-only-I --libs-only-L ' + ' '.join(modules)) + except OSError: + return + + # Other flags may affect the compilation of unrelated targets, so store + # them with a prefix, (e.g., XXX_CFLAGS, XXX_LIBS, etc) + try: + flags = env.ParseFlags('!pkg-config --cflags-only-other --libs-only-l --libs-only-other ' + ' '.join(modules)) + except OSError: + return + prefix = name.upper() + '_' + for flag_name, flag_value in flags.iteritems(): + env[prefix + flag_name] = flag_value + + env[name] = True + + + def generate(env): """Common environment generation code""" @@ -110,21 +142,27 @@ def generate(env): env['toolchain'] = 'wcesdk' env.Tool(env['toolchain']) - if env['platform'] == 'embedded': - # Allow overriding compiler from environment - if os.environ.has_key('CC'): - env['CC'] = os.environ['CC'] - # Update CCVERSION to match - pipe = SCons.Action._subproc(env, [env['CC'], '--version'], - stdin = 'devnull', - stderr = 'devnull', - stdout = subprocess.PIPE) - if pipe.wait() == 0: - line = pipe.stdout.readline() - match = re.search(r'[0-9]+(\.[0-9]+)+', line) - if match: - env['CCVERSION'] = match.group(0) - + # Allow override compiler and specify additional flags from environment + if os.environ.has_key('CC'): + env['CC'] = os.environ['CC'] + # Update CCVERSION to match + pipe = SCons.Action._subproc(env, [env['CC'], '--version'], + stdin = 'devnull', + stderr = 'devnull', + stdout = subprocess.PIPE) + if pipe.wait() == 0: + line = pipe.stdout.readline() + match = re.search(r'[0-9]+(\.[0-9]+)+', line) + if match: + env['CCVERSION'] = match.group(0) + if os.environ.has_key('CFLAGS'): + env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS']) + if os.environ.has_key('CXX'): + env['CXX'] = os.environ['CXX'] + if os.environ.has_key('CXXFLAGS'): + env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS']) + if os.environ.has_key('LDFLAGS'): + env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS']) env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-') env['msvc'] = env['CC'] == 'cl' @@ -140,10 +178,16 @@ def generate(env): # Backwards compatability with the debug= profile= options if env['build'] == 'debug': if not env['debug']: - print 'scons: debug option is deprecated: use instead build=release' + print 'scons: warning: debug option is deprecated and will be removed eventually; use instead' + print + print ' scons build=release' + print env['build'] = 'release' if env['profile']: - print 'scons: profile option is deprecated: use instead build=profile' + print 'scons: warning: profile option is deprecated and will be removed eventually; use instead' + print + print ' scons build=profile' + print env['build'] = 'profile' if False: # Enforce SConscripts to use the new build variable @@ -184,6 +228,9 @@ def generate(env): if env.GetOption('num_jobs') <= 1: env.SetOption('num_jobs', num_jobs()) + env.Decider('MD5-timestamp') + env.SetOption('max_drift', 60) + # C preprocessor options cppdefines = [] if env['build'] in ('debug', 'checked'): @@ -499,9 +546,14 @@ def generate(env): # Default libs env.Append(LIBS = []) - # Load LLVM + # Load tools if env['llvm']: env.Tool('llvm') + env.Tool('udis86') + + pkg_config_modules(env, 'x11', ['x11', 'xext']) + pkg_config_modules(env, 'dri', ['libdrm']) + pkg_config_modules(env, 'xorg', ['xorg-server']) # Custom builders and methods env.Tool('custom') diff --git a/scons/llvm.py b/scons/llvm.py index 39fbb910b6d..1b033acb1b3 100644 --- a/scons/llvm.py +++ b/scons/llvm.py @@ -38,6 +38,8 @@ import SCons.Util def generate(env): + env['llvm'] = False + try: llvm_dir = os.environ['LLVM'] except KeyError: @@ -64,13 +66,13 @@ def generate(env): # XXX: There is no llvm-config on Windows, so assume a standard layout if llvm_dir is None: print 'scons: LLVM environment variable must be specified when building for windows' - env.Exit(1) + return # Try to determine the LLVM version from llvm/Config/config.h llvm_config = os.path.join(llvm_dir, 'include/llvm/Config/config.h') if not os.path.exists(llvm_config): print 'scons: could not find %s' % llvm_config - env.Exit(1) + return llvm_version_re = re.compile(r'^#define PACKAGE_VERSION "([^"]*)"') llvm_version = None for line in open(llvm_config, 'rt'): @@ -81,7 +83,7 @@ def generate(env): break if llvm_version is None: print 'scons: could not determine the LLVM version from %s' % llvm_config - env.Exit(1) + return env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')]) env.AppendUnique(CPPDEFINES = [ @@ -133,7 +135,7 @@ def generate(env): else: if not env.Detect('llvm-config'): print 'scons: llvm-config script not found' % llvm_version - env.Exit(1) + return llvm_version = env.backtick('llvm-config --version').rstrip() llvm_version = distutils.version.LooseVersion(llvm_version) @@ -144,11 +146,12 @@ def generate(env): env.ParseConfig('llvm-config --ldflags') except OSError: print 'scons: llvm-config version %s failed' % llvm_version - env.Exit(1) + return else: env['LINK'] = env['CXX'] assert llvm_version is not None + env['llvm'] = True print 'scons: Found LLVM version %s' % llvm_version env['LLVM_VERSION'] = llvm_version diff --git a/scons/udis86.py b/scons/udis86.py index ba71d4eb0b8..bb91d3c35cf 100644 --- a/scons/udis86.py +++ b/scons/udis86.py @@ -31,8 +31,10 @@ def generate(env): conf = env.Configure() if conf.CheckHeader('udis86.h'): # and conf.CheckLib('udis86'): - env.Append(CPPDEFINES = [('HAVE_UDIS86', '1')]) + env['UDIS86'] = True env.Prepend(LIBS = ['udis86']) + else: + env['UDIS86'] = False conf.Finish() diff --git a/scons/x11.py b/scons/x11.py index 99bf079626e..7368618f3bb 100644 --- a/scons/x11.py +++ b/scons/x11.py @@ -29,24 +29,12 @@ Tool-specific initialization for X11 def generate(env): - env.Append(CPPPATH = ['/usr/X11R6/include']) - env.Append(LIBPATH = ['/usr/X11R6/lib']) - - env.Append(LIBS = [ - 'X11', - 'Xext', - 'Xxf86vm', - 'Xdamage', - 'Xfixes', - ]) + # XXX: backwards compatability only + pass def exists(env): - # TODO: actually detect the presence of the headers - if env['platform'] in ('linux', 'freebsd', 'darwin'): - return True - else: - return False + return True # vim:set ts=4 sw=4 et: diff --git a/src/SConscript b/src/SConscript index c3e34be6f76..c42d9bff2d7 100644 --- a/src/SConscript +++ b/src/SConscript @@ -1,19 +1,17 @@ Import('*') -if 'egl' in env['statetrackers']: - SConscript('mapi/vgapi/SConscript') - SConscript('egl/main/SConscript') +SConscript('mapi/vgapi/SConscript') -if 'mesa' in env['statetrackers']: - if platform == 'windows': - SConscript('talloc/SConscript') +if env['platform'] == 'windows': + SConscript('egl/main/SConscript') + SConscript('talloc/SConscript') - SConscript('glsl/SConscript') - SConscript('mapi/glapi/SConscript') - SConscript('mesa/SConscript') +SConscript('glsl/SConscript') +SConscript('mapi/glapi/SConscript') +SConscript('mesa/SConscript') - if platform != 'embedded': - SConscript('glut/glx/SConscript') +if env['platform'] != 'embedded': + SConscript('glut/glx/SConscript') SConscript('gallium/SConscript') diff --git a/src/egl/main/SConscript b/src/egl/main/SConscript index 8ade85b3572..f001b81600f 100644 --- a/src/egl/main/SConscript +++ b/src/egl/main/SConscript @@ -4,49 +4,49 @@ Import('*') -if env['platform'] != 'winddk': - - env = env.Clone() - - env.Append(CPPDEFINES = [ - '_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS', - '_EGL_DRIVER_SEARCH_DIR=\\"\\"', - '_EGL_OS_WINDOWS', - '_EGL_GET_CORE_ADDRESSES', - 'KHRONOS_DLL_EXPORTS', - ]) - - env.Append(CPPPATH = [ - '#/include', - ]) - - egl_sources = [ - 'eglapi.c', - 'eglarray.c', - 'eglconfig.c', - 'eglcontext.c', - 'eglcurrent.c', - 'egldisplay.c', - 'egldriver.c', - 'eglfallbacks.c', - 'eglglobals.c', - 'eglimage.c', - 'egllog.c', - 'eglmisc.c', - 'eglmode.c', - 'eglscreen.c', - 'eglstring.c', - 'eglsurface.c', - 'eglsync.c', - ] - - egl = env.SharedLibrary( - target = 'libEGL', - source = egl_sources + ['egl.def'], - ) - - env.InstallSharedLibrary(egl, version=(1, 4, 0)) - - egl = [env.FindIxes(egl, 'LIBPREFIX', 'LIBSUFFIX')] - - Export('egl') +env = env.Clone() + +env.Append(CPPDEFINES = [ + '_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS', + '_EGL_DRIVER_SEARCH_DIR=\\"\\"', + '_EGL_OS_WINDOWS', + '_EGL_GET_CORE_ADDRESSES', + 'KHRONOS_DLL_EXPORTS', +]) + +env.Append(CPPPATH = [ + '#/include', +]) + +egl_sources = [ + 'eglapi.c', + 'eglarray.c', + 'eglconfig.c', + 'eglcontext.c', + 'eglcurrent.c', + 'egldisplay.c', + 'egldriver.c', + 'eglfallbacks.c', + 'eglglobals.c', + 'eglimage.c', + 'egllog.c', + 'eglmisc.c', + 'eglmode.c', + 'eglscreen.c', + 'eglstring.c', + 'eglsurface.c', + 'eglsync.c', +] + +egl = env.SharedLibrary( + target = 'libEGL', + source = egl_sources + ['egl.def'], +) + +installed_egl = env.InstallSharedLibrary(egl, version=(1, 4, 0)) + +env.Alias('egl', installed_egl) + +egl = [env.FindIxes(egl, 'LIBPREFIX', 'LIBSUFFIX')] + +Export('egl') diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h index 3457670bfa5..2169960fd1d 100644 --- a/src/egl/main/eglconfig.h +++ b/src/egl/main/eglconfig.h @@ -3,6 +3,7 @@ #include +#include #include "egltypedefs.h" diff --git a/src/gallium/SConscript b/src/gallium/SConscript index 3c171552bed..76f9ffb58ab 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -1,30 +1,112 @@ -import os +Import('env') -Import('*') +# +# Auxiliary modules +# SConscript('auxiliary/SConscript') -for driver in env['drivers']: - SConscript(os.path.join('drivers', driver, 'SConscript')) +# +# Drivers +# + +SConscript([ + 'drivers/failover/SConscript', + 'drivers/galahad/SConscript', + 'drivers/i915/SConscript', + 'drivers/i965/SConscript', + 'drivers/identity/SConscript', + 'drivers/llvmpipe/SConscript', + 'drivers/rbug/SConscript', + 'drivers/r300/SConscript', + 'drivers/softpipe/SConscript', + 'drivers/svga/SConscript', + 'drivers/trace/SConscript', +]) + +if env['dri']: + # These drivers depend on drm headers + SConscript([ + # XXX: nouveau drivers have a tight dependency on libdrm, so to enable + # we need some version logic before we enable them. Also, ATM there is + # no nouveau target in scons + #'drivers/nouveau/SConscript', + #'drivers/nv50/SConscript', + #'drivers/nvfx/SConscript', + 'drivers/r600/SConscript', + ]) + +# +# State trackers +# # Needed by some state trackers SConscript('winsys/sw/null/SConscript') SConscript('state_trackers/python/SConscript') -if platform != 'embedded': +if env['platform'] != 'embedded': SConscript('state_trackers/glx/xlib/SConscript') SConscript('state_trackers/dri/SConscript') SConscript('state_trackers/xorg/SConscript') SConscript('state_trackers/egl/SConscript') SConscript('state_trackers/vega/SConscript') -if platform == 'windows': +if env['platform'] == 'windows': SConscript('state_trackers/wgl/SConscript') +# +# Winsys +# + SConscript('winsys/SConscript') -SConscript('targets/SConscript') +# +# Targets +# + +SConscript([ + 'targets/graw-null/SConscript', +]) + +if env['x11']: + SConscript([ + 'targets/graw-xlib/SConscript', + 'targets/libgl-xlib/SConscript', + ]) -if platform != 'embedded': +if env['platform'] == 'windows': + SConscript([ + 'targets/libgl-gdi/SConscript', + #'egl-gdi/SConscript', + ]) + +if env['dri']: + SConscript([ + 'targets/SConscript.dri', + 'targets/dri-i915/SConscript', + 'targets/dri-i965/SConscript', + #'targets/dri-nouveau/SConscript', + 'targets/dri-r300/SConscript', + 'targets/dri-r600/SConscript', + 'targets/dri-swrast/SConscript', + 'targets/dri-vmwgfx/SConscript', + ]) + +if env['xorg']: + SConscript([ + #'targets/xorg-i915/SConscript', + #'targets/xorg-i965/SConscript', + #'targets/xorg-nouveau/SConscript', + #'targets/xorg-radeon/SConscript', + 'targets/xorg-vmwgfx/SConscript', + ]) + + +# +# Unit tests & tools +# + +if env['platform'] != 'embedded': SConscript('tests/unit/SConscript') SConscript('tests/graw/SConscript') + diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index 94cd74424a0..0e5da1374ff 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -7,8 +7,6 @@ env.Append(CPPPATH = [ 'util', ]) -env.Tool('udis86') - env.CodeGenerate( target = 'indices/u_indices_gen.c', script = 'indices/u_indices_gen.py', @@ -202,39 +200,42 @@ source = [ ] if env['llvm']: + if env['UDIS86']: + env.Append(CPPDEFINES = [('HAVE_UDIS86', '1')]) + source += [ - 'gallivm/lp_bld_arit.c', - 'gallivm/lp_bld_assert.c', - 'gallivm/lp_bld_bitarit.c', - 'gallivm/lp_bld_const.c', - 'gallivm/lp_bld_conv.c', - 'gallivm/lp_bld_debug.c', - 'gallivm/lp_bld_flow.c', - 'gallivm/lp_bld_format_aos.c', - 'gallivm/lp_bld_format_soa.c', - 'gallivm/lp_bld_format_yuv.c', - 'gallivm/lp_bld_gather.c', - 'gallivm/lp_bld_init.c', - 'gallivm/lp_bld_intr.c', - 'gallivm/lp_bld_logic.c', - 'gallivm/lp_bld_misc.cpp', - 'gallivm/lp_bld_pack.c', - 'gallivm/lp_bld_printf.c', - 'gallivm/lp_bld_quad.c', - 'gallivm/lp_bld_sample.c', - 'gallivm/lp_bld_sample_aos.c', - 'gallivm/lp_bld_sample_soa.c', - 'gallivm/lp_bld_struct.c', - 'gallivm/lp_bld_swizzle.c', - 'gallivm/lp_bld_tgsi_aos.c', - 'gallivm/lp_bld_tgsi_info.c', - 'gallivm/lp_bld_tgsi_soa.c', - 'gallivm/lp_bld_type.c', - 'draw/draw_llvm.c', - 'draw/draw_llvm_sample.c', - 'draw/draw_llvm_translate.c', - 'draw/draw_pt_fetch_shade_pipeline_llvm.c', - 'draw/draw_vs_llvm.c' + 'gallivm/lp_bld_arit.c', + 'gallivm/lp_bld_assert.c', + 'gallivm/lp_bld_bitarit.c', + 'gallivm/lp_bld_const.c', + 'gallivm/lp_bld_conv.c', + 'gallivm/lp_bld_debug.c', + 'gallivm/lp_bld_flow.c', + 'gallivm/lp_bld_format_aos.c', + 'gallivm/lp_bld_format_soa.c', + 'gallivm/lp_bld_format_yuv.c', + 'gallivm/lp_bld_gather.c', + 'gallivm/lp_bld_init.c', + 'gallivm/lp_bld_intr.c', + 'gallivm/lp_bld_logic.c', + 'gallivm/lp_bld_misc.cpp', + 'gallivm/lp_bld_pack.c', + 'gallivm/lp_bld_printf.c', + 'gallivm/lp_bld_quad.c', + 'gallivm/lp_bld_sample.c', + 'gallivm/lp_bld_sample_aos.c', + 'gallivm/lp_bld_sample_soa.c', + 'gallivm/lp_bld_struct.c', + 'gallivm/lp_bld_swizzle.c', + 'gallivm/lp_bld_tgsi_aos.c', + 'gallivm/lp_bld_tgsi_info.c', + 'gallivm/lp_bld_tgsi_soa.c', + 'gallivm/lp_bld_type.c', + 'draw/draw_llvm.c', + 'draw/draw_llvm_sample.c', + 'draw/draw_llvm_translate.c', + 'draw/draw_pt_fetch_shade_pipeline_llvm.c', + 'draw/draw_vs_llvm.c' ] gallium = env.ConvenienceLibrary( @@ -242,4 +243,6 @@ gallium = env.ConvenienceLibrary( source = source, ) +env.Alias('gallium', gallium) + Export('gallium') diff --git a/src/gallium/drivers/i915/SConscript b/src/gallium/drivers/i915/SConscript index d4bf6fef134..1197bbf9620 100644 --- a/src/gallium/drivers/i915/SConscript +++ b/src/gallium/drivers/i915/SConscript @@ -2,7 +2,7 @@ Import('*') env = env.Clone() -if msvc: +if env['msvc']: print 'warning: not building i915g' Return() diff --git a/src/gallium/drivers/i965/SConscript b/src/gallium/drivers/i965/SConscript index 119f914a16d..198275b655c 100644 --- a/src/gallium/drivers/i965/SConscript +++ b/src/gallium/drivers/i965/SConscript @@ -2,7 +2,7 @@ Import('*') env = env.Clone() -if msvc: +if env['msvc']: print 'warning: not building i965g' Return(); diff --git a/src/gallium/drivers/llvmpipe/README b/src/gallium/drivers/llvmpipe/README index ec30d4d7084..e9374cc6efa 100644 --- a/src/gallium/drivers/llvmpipe/README +++ b/src/gallium/drivers/llvmpipe/README @@ -1,53 +1,6 @@ LLVMPIPE -- a fork of softpipe that employs LLVM for code generation. -Status -====== - -Done so far is: - - - the whole fragment pipeline is code generated in a single function - - - input interpolation - - - depth testing - - - texture sampling - - 1D/2D/3D/cube maps supported - - all texture wrap modes supported - - all texture filtering modes supported - - perhaps not all texture formats yet supported - - - fragment shader TGSI translation - - same level of support as the TGSI SSE2 exec machine, with the exception - we don't fallback to TGSI interpretation when an unsupported opcode is - found, but just ignore it - - done in SoA layout - - input interpolation also code generated - - - alpha testing - - - blend (including logic ops) - - both in SoA and AoS layouts, but only the former used for now - - - code is generic - - intermediates can be vectors of floats, ubytes, fixed point, etc, and of - any width and length - - not all operations are implemented for these types yet though - -Most mesa/progs/demos/* work. - -To do (probably by this order): - - - code generate stipple and stencil testing - - - translate TGSI control flow instructions, and all other remaining opcodes - - - integrate with the draw module for VS code generation - - - code generate the triangle setup and rasterization - - Requirements ============ @@ -98,7 +51,7 @@ Building To build everything on Linux invoke scons as: - scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=xlib dri=false + scons build=debug libgl-xlib Alternatively, you can build it with GNU make, if you prefer, by invoking it as @@ -108,19 +61,16 @@ but the rest of these instructions assume that scons is used. For windows is everything the except except the winsys: - scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=gdi dri=false + scons build=debug libgl-gdi Using ===== -On Linux, building will create a drop-in alternative for libGL.so. To use it -set the environment variables: - - export LD_LIBRARY_PATH=$PWD/build/linux-x86_64-debug/lib:$LD_LIBRARY_PATH +On Linux, building will create a drop-in alternative for libGL.so into -or + build/foo/gallium/targets/libgl-xlib/libGL.so - export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/lib:$LD_LIBRARY_PATH +To use it set the LD_LIBRARY_PATH environment variable accordingly. For performance evaluation pass debug=no to scons, and use the corresponding lib directory without the "-debug" suffix. @@ -136,7 +86,7 @@ Profiling To profile llvmpipe you should pass the options - scons debug=no profile=yes + scons build=profile This will ensure that frame pointers are used both in C and JIT functions, and that no tail call optimizations are done by gcc. @@ -200,5 +150,4 @@ Development Notes interfaces very closely, and appear to be complete enough for code generation. See http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html - for a stand-alone example. - See the llvm-c/Core.h file for reference. + for a stand-alone example. See the llvm-c/Core.h file for reference. diff --git a/src/gallium/drivers/llvmpipe/SConscript b/src/gallium/drivers/llvmpipe/SConscript index 49950153a4f..26b258b9569 100644 --- a/src/gallium/drivers/llvmpipe/SConscript +++ b/src/gallium/drivers/llvmpipe/SConscript @@ -9,8 +9,6 @@ if not env['llvm']: env = env.Clone() -env.Tool('udis86') - env.Append(CPPPATH = ['.']) env.CodeGenerate( @@ -78,6 +76,8 @@ llvmpipe = env.ConvenienceLibrary( lp_tile_soa_os, ]) +env.Alias('llvmpipe', llvmpipe) + if env['platform'] != 'embedded': env = env.Clone() @@ -92,7 +92,7 @@ if env['platform'] != 'embedded': 'sincos', ] - if not msvc: + if not env['msvc']: tests.append('round') for test in tests: diff --git a/src/gallium/drivers/rbug/README b/src/gallium/drivers/rbug/README index b6d3a5cf351..9d7bd4e7695 100644 --- a/src/gallium/drivers/rbug/README +++ b/src/gallium/drivers/rbug/README @@ -7,24 +7,10 @@ This directory contains a Gallium3D remote debugger pipe driver. It provides remote debugging functionality. -= Build Instructions = - -To build, invoke scons on the top dir as - - scons dri=no statetrackers=mesa winsys=xlib - - = Usage = -To use do - - export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/lib - -ensure the right libGL.so is being picked by doing - - ldd progs/trivial/tri +Do - export XMESA_TRACE=y GALLIUM_RBUG=true progs/trivial/tri which should open gallium remote debugging session. While the program is running diff --git a/src/gallium/drivers/softpipe/SConscript b/src/gallium/drivers/softpipe/SConscript index d5f4d28aeff..ea10e8a9f98 100644 --- a/src/gallium/drivers/softpipe/SConscript +++ b/src/gallium/drivers/softpipe/SConscript @@ -37,4 +37,6 @@ softpipe = env.ConvenienceLibrary( 'sp_tile_cache.c', ]) +env.Alias('softpipe', softpipe) + Export('softpipe') diff --git a/src/gallium/drivers/sw/SConscript b/src/gallium/drivers/sw/SConscript index e9ebf751ddd..40d01db2f6d 100644 --- a/src/gallium/drivers/sw/SConscript +++ b/src/gallium/drivers/sw/SConscript @@ -20,7 +20,6 @@ if True: if env['llvm']: env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') - env.Tool('udis86') env.Prepend(LIBS = [llvmpipe]) extra.append(llvmpipe) diff --git a/src/gallium/drivers/trace/README b/src/gallium/drivers/trace/README index cdcd8d2b4be..c210cba032a 100644 --- a/src/gallium/drivers/trace/README +++ b/src/gallium/drivers/trace/README @@ -7,23 +7,8 @@ This directory contains a Gallium3D trace debugger pipe driver. It can traces all incoming calls. -= Build Instructions = - -To build, invoke scons on the top dir as - - scons dri=no statetrackers=mesa winsys=xlib - - = Usage = -To use do - - export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/lib - -ensure the right libGL.so is being picked by doing - - ldd progs/trivial/tri - == Tracing == For tracing then do @@ -40,6 +25,7 @@ For remote debugging see: src/gallium/drivers/rbug/README + = Integrating = You can integrate the trace pipe driver either inside the state tracker or the @@ -60,5 +46,5 @@ are automatically wrapped by trace_screen. -- -Jose Fonseca +Jose Fonseca Jakob Bornecrantz diff --git a/src/gallium/state_trackers/egl/SConscript b/src/gallium/state_trackers/egl/SConscript index efcce25e317..8d34e47df0e 100644 --- a/src/gallium/state_trackers/egl/SConscript +++ b/src/gallium/state_trackers/egl/SConscript @@ -3,34 +3,35 @@ Import('*') -if 'egl' in env['statetrackers']: +if env['platform'] != 'windows': + Return() - env = env.Clone() +env = env.Clone() - env.Append(CPPPATH = [ - '#/src/egl/main', - '#/src/gallium/winsys/sw', - '.', - ]) - env.Append(CPPDEFINES = [ - 'HAVE_GDI_BACKEND', - ]) +env.Append(CPPPATH = [ + '#/src/egl/main', + '#/src/gallium/winsys/sw', + '.', +]) +env.Append(CPPDEFINES = [ + 'HAVE_GDI_BACKEND', +]) - common_sources = [ - 'common/egl_g3d.c', - 'common/egl_g3d_api.c', - 'common/egl_g3d_image.c', - 'common/egl_g3d_st.c', - 'common/egl_g3d_sync.c', - 'common/native_helper.c', - ] +common_sources = [ + 'common/egl_g3d.c', + 'common/egl_g3d_api.c', + 'common/egl_g3d_image.c', + 'common/egl_g3d_st.c', + 'common/egl_g3d_sync.c', + 'common/native_helper.c', +] - gdi_sources = common_sources + [ - 'gdi/native_gdi.c', - ] +gdi_sources = common_sources + [ + 'gdi/native_gdi.c', +] - st_egl_gdi = env.ConvenienceLibrary( - target = 'st_egl_gdi', - source = gdi_sources, - ) - Export('st_egl_gdi') +st_egl_gdi = env.ConvenienceLibrary( + target = 'st_egl_gdi', + source = gdi_sources, +) +Export('st_egl_gdi') diff --git a/src/gallium/state_trackers/glx/xlib/SConscript b/src/gallium/state_trackers/glx/xlib/SConscript index 9df351a2769..775000eacce 100644 --- a/src/gallium/state_trackers/glx/xlib/SConscript +++ b/src/gallium/state_trackers/glx/xlib/SConscript @@ -3,25 +3,25 @@ Import('*') -if env['platform'] == 'linux' \ - and 'mesa' in env['statetrackers']: +if not env['x11']: + Return() - env = env.Clone() +env = env.Clone() - env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', - '#/src/mesa/main', - ]) +env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/mesa', + '#/src/mesa/main', +]) - st_xlib = env.ConvenienceLibrary( - target = 'st_xlib', - source = [ - 'glx_api.c', - 'glx_getproc.c', - 'glx_usefont.c', - 'xm_api.c', - 'xm_st.c', - ] - ) - Export('st_xlib') +st_xlib = env.ConvenienceLibrary( +target = 'st_xlib', +source = [ + 'glx_api.c', + 'glx_getproc.c', + 'glx_usefont.c', + 'xm_api.c', + 'xm_st.c', + ] +) +Export('st_xlib') diff --git a/src/gallium/state_trackers/python/SConscript b/src/gallium/state_trackers/python/SConscript index aadeaa0a359..5cb7960f9b5 100644 --- a/src/gallium/state_trackers/python/SConscript +++ b/src/gallium/state_trackers/python/SConscript @@ -3,57 +3,61 @@ import os.path Import('*') -if 'python' in env['statetrackers']: - - env = env.Clone() - - env.Tool('python') - - env.Tool('swig') - env.Append(SWIGPATH = ['#src/gallium/include', '#src/gallium/include/pipe']) - env.Append(SWIGFLAGS = ['-python', '-keyword']) - - env.Append(CPPPATH = '.') - - if env['platform'] == 'windows': - env.Append(LIBS = [ - 'opengl32', - 'gdi32', - 'user32', - 'kernel32', - 'ws2_32', - ]) - else: - env.Append(CPPDEFINES = ['GCC_HASCLASSVISIBILITY']) - env.Append(LIBS = [ - 'GL', - 'X11', - ]) - - sources = [ - 'gallium.i', - 'st_device.c', - 'st_sample.c', - 'st_hardpipe_winsys.c', - 'st_softpipe_winsys.c', - ] - - env.Prepend(LIBS = [ - ws_null, - trace, - gallium, - ]) +if env['toolchain'] == 'crossmingw': + # Cross-compilation not supported + Return() + +env = env.Clone() + +env.Tool('python') - if env['llvm']: - env.Append(CPPDEFINES = ['HAVE_LLVMPIPE']) - env.Prepend(LIBS = [llvmpipe]) - if True: - env.Append(CPPDEFINES = ['HAVE_SOFTPIPE']) - env.Prepend(LIBS = [softpipe]) +env.Tool('swig') +env.Append(SWIGPATH = ['#src/gallium/include', '#src/gallium/include/pipe']) +env.Append(SWIGFLAGS = ['-python', '-keyword']) - env['no_import_lib'] = 1 +env.Append(CPPPATH = '.') + +if env['platform'] == 'windows': + env.Append(LIBS = [ + 'opengl32', + 'gdi32', + 'user32', + 'kernel32', + 'ws2_32', + ]) +else: + env.Append(CPPDEFINES = ['GCC_HASCLASSVISIBILITY']) + env.Append(LIBS = [ + 'GL', + 'X11', + ]) - env.SharedLibrary( - target = '_gallium', - source = sources, - ) +sources = [ + 'gallium.i', + 'st_device.c', + 'st_sample.c', + 'st_hardpipe_winsys.c', + 'st_softpipe_winsys.c', +] + +env.Prepend(LIBS = [ + ws_null, + trace, + gallium, +]) + +if env['llvm']: + env.Append(CPPDEFINES = ['HAVE_LLVMPIPE']) + env.Prepend(LIBS = [llvmpipe]) +if True: + env.Append(CPPDEFINES = ['HAVE_SOFTPIPE']) + env.Prepend(LIBS = [softpipe]) + +env['no_import_lib'] = 1 + +pyst = env.SharedLibrary( + target = '_gallium', + source = sources, +) + +env.Alias('python', pyst) diff --git a/src/gallium/state_trackers/vega/SConscript b/src/gallium/state_trackers/vega/SConscript index 548053eb646..4c6e18f42b2 100644 --- a/src/gallium/state_trackers/vega/SConscript +++ b/src/gallium/state_trackers/vega/SConscript @@ -3,49 +3,48 @@ Import('*') -if 'egl' in env['statetrackers']: +env = env.Clone() - env = env.Clone() +env.Append(CPPPATH = [ + '#/src/mapi', +]) - env.Append(CPPPATH = [ - '#/src/mapi', - ]) +vega_sources = [ + 'api.c', + 'api_context.c', + 'api_filters.c', + 'api_images.c', + 'api_masks.c', + 'api_misc.c', + 'api_paint.c', + 'api_params.c', + 'api_path.c', + 'api_text.c', + 'api_transform.c', + 'vgu.c', + 'vg_context.c', + 'vg_manager.c', + 'vg_state.c', + 'vg_translate.c', + 'polygon.c', + 'bezier.c', + 'path.c', + 'paint.c', + 'arc.c', + 'image.c', + 'renderer.c', + 'stroker.c', + 'mask.c', + 'shader.c', + 'shaders_cache.c', +] - vega_sources = [ - 'api.c', - 'api_context.c', - 'api_filters.c', - 'api_images.c', - 'api_masks.c', - 'api_misc.c', - 'api_paint.c', - 'api_params.c', - 'api_path.c', - 'api_text.c', - 'api_transform.c', - 'vgu.c', - 'vg_context.c', - 'vg_manager.c', - 'vg_state.c', - 'vg_translate.c', - 'polygon.c', - 'bezier.c', - 'path.c', - 'paint.c', - 'arc.c', - 'image.c', - 'renderer.c', - 'stroker.c', - 'mask.c', - 'shader.c', - 'shaders_cache.c', - ] +# vgapi_header must be generated first +env.Depends(vega_sources, vgapi_header) - # vgapi_header must be generated first - env.Depends(vega_sources, vgapi_header) +st_vega = env.ConvenienceLibrary( + target = 'st_vega', + source = vega_sources, +) - st_vega = env.ConvenienceLibrary( - target = 'st_vega', - source = vega_sources, - ) - Export('st_vega') +Export('st_vega') diff --git a/src/gallium/state_trackers/xorg/SConscript b/src/gallium/state_trackers/xorg/SConscript index 0b598dab6e3..ffaa1c26846 100644 --- a/src/gallium/state_trackers/xorg/SConscript +++ b/src/gallium/state_trackers/xorg/SConscript @@ -3,34 +3,35 @@ Import('*') -if 'xorg' in env['statetrackers']: - - env = env.Clone() - - env.Append(CPPPATH = [ - '#/src/mesa', - ]) - - env.ParseConfig('pkg-config --cflags --libs libdrm xorg-server') - - conf = env.Configure() - - if conf.CheckHeader('X11/extensions/dpmsconst.h'): - env.Append(CPPDEFINES = [('HAVE_XEXTPROTO_71', '1')]) - - conf.Finish() - - st_xorg = env.ConvenienceLibrary( - target = 'st_xorg', - source = [ 'xorg_composite.c', - 'xorg_crtc.c', - 'xorg_dri2.c', - 'xorg_driver.c', - 'xorg_exa.c', - 'xorg_exa_tgsi.c', - 'xorg_output.c', - 'xorg_renderer.c', - 'xorg_xv.c', - ] - ) - Export('st_xorg') +if not env['x11'] or not env['dri'] or not env['xorg']: + Return() + +env = env.Clone() + +env.Append(CPPPATH = [ + '#/src/mesa', +]) + +env.ParseConfig('pkg-config --cflags --libs libdrm xorg-server') + +conf = env.Configure() + +if conf.CheckHeader('X11/extensions/dpmsconst.h'): + env.Append(CPPDEFINES = [('HAVE_XEXTPROTO_71', '1')]) + +conf.Finish() + +st_xorg = env.ConvenienceLibrary( +target = 'st_xorg', +source = [ 'xorg_composite.c', + 'xorg_crtc.c', + 'xorg_dri2.c', + 'xorg_driver.c', + 'xorg_exa.c', + 'xorg_exa_tgsi.c', + 'xorg_output.c', + 'xorg_renderer.c', + 'xorg_xv.c', + ] +) +Export('st_xorg') diff --git a/src/gallium/targets/SConscript b/src/gallium/targets/SConscript deleted file mode 100644 index e447d093610..00000000000 --- a/src/gallium/targets/SConscript +++ /dev/null @@ -1,41 +0,0 @@ -import os -Import('*') - -# Compatibility with old build scripts: -# -if 'mesa' in env['statetrackers']: - if 'xlib' in env['winsys'] and 'libgl-xlib' not in env['targets']: - env['targets'].append('libgl-xlib') - if 'gdi' in env['winsys'] and 'libgl-gdi' not in env['targets']: - env['targets'].append('libgl-gdi') - -if not 'graw-xlib' in env['targets'] and not 'graw-null' in env['targets'] and not env['msvc']: - # XXX: disable until MSVC can link correctly - SConscript('graw-null/SConscript') - - -if env['dri']: - SConscript([ - 'SConscript.dri' - ]) - -if 'xorg' in env['statetrackers']: - if 'vmware' in env['winsys']: - SConscript([ - 'xorg-vmwgfx/SConscript', - ]) - -if 'egl' in env['statetrackers']: - SConscript([ - 'egl-gdi/SConscript', - ]) - -# Ideally all non-target directories would produce convenience -# libraries, and the actual shared libraries and other installables -# would be finally assembled in the targets subtree: -# -for target in env['targets']: - SConscript(os.path.join(target, 'SConscript')) - - - diff --git a/src/gallium/targets/SConscript.dri b/src/gallium/targets/SConscript.dri index bc8d179e3d9..092223b3690 100644 --- a/src/gallium/targets/SConscript.dri +++ b/src/gallium/targets/SConscript.dri @@ -3,6 +3,9 @@ Import('*') +if not env['dri']: + Return() + drienv = env.Clone() drienv.Replace(CPPPATH = [ @@ -77,32 +80,3 @@ Export([ 'COMMON_DRI_SW_OBJECTS', 'COMMON_DRI_DRM_OBJECTS', ]) - -SConscript([ - 'dri-swrast/SConscript', -]) - -if 'vmware' in env['winsys']: - SConscript([ - 'dri-vmwgfx/SConscript', - ]) - -if 'i915' in env['winsys']: - SConscript([ - 'dri-i915/SConscript', - ]) - -if 'i965' in env['winsys']: - SConscript([ - 'dri-i965/SConscript', - ]) - -if 'radeon' in env['winsys']: - SConscript([ - 'dri-radeong/SConscript', - ]) - -if 'r600' in env['winsys']: - SConscript([ - 'dri-r600/SConscript', - ]) diff --git a/src/gallium/targets/dri-i915/SConscript b/src/gallium/targets/dri-i915/SConscript index 172f92d6b82..ab60013830e 100644 --- a/src/gallium/targets/dri-i915/SConscript +++ b/src/gallium/targets/dri-i915/SConscript @@ -1,9 +1,5 @@ Import('*') -if not 'i915' in env['drivers']: - print 'warning: i915 pipe driver not built skipping i915_dri.so' - Return() - env = drienv.Clone() env.ParseConfig('pkg-config --cflags --libs libdrm_intel') @@ -24,8 +20,10 @@ env.Prepend(LIBS = [ COMMON_DRI_DRM_OBJECTS ]) -env.LoadableModule( +module = env.LoadableModule( target = 'i915_dri.so', source = 'target.c', SHLIBPREFIX = '', ) + +env.Alias('dri-i915', module) \ No newline at end of file diff --git a/src/gallium/targets/dri-i965/SConscript b/src/gallium/targets/dri-i965/SConscript index 684e3488f71..669f70d6b8d 100644 --- a/src/gallium/targets/dri-i965/SConscript +++ b/src/gallium/targets/dri-i965/SConscript @@ -1,9 +1,5 @@ Import('*') -if not 'i965' in env['drivers']: - print 'warning: i965 pipe driver not built skipping i965_dri.so' - Return() - env = drienv.Clone() env.ParseConfig('pkg-config --cflags --libs libdrm_intel') @@ -27,8 +23,10 @@ env.Prepend(LIBS = [ COMMON_DRI_DRM_OBJECTS ]) -env.LoadableModule( +module = env.LoadableModule( target = 'i965_dri.so', source = 'target.c', SHLIBPREFIX = '', ) + +env.Alias('dri-i965', module) \ No newline at end of file diff --git a/src/gallium/targets/dri-r300/SConscript b/src/gallium/targets/dri-r300/SConscript index 33a458f2e68..005b4bbf7f1 100644 --- a/src/gallium/targets/dri-r300/SConscript +++ b/src/gallium/targets/dri-r300/SConscript @@ -1,9 +1,5 @@ Import('*') -if not 'r300' in env['drivers']: - print 'warning: r300 pipe driver not built skipping r300_dri.so' - Return() - env = drienv.Clone() env.ParseConfig('pkg-config --cflags --libs libdrm_radeon') @@ -23,8 +19,10 @@ env.Prepend(LIBS = [ COMMON_DRI_DRM_OBJECTS ]) -env.SharedLibrary( +module = env.SharedLibrary( target ='r300_dri.so', source = 'target.c', SHLIBPREFIX = '', ) + +env.Alias('dri-r300', module) \ No newline at end of file diff --git a/src/gallium/targets/dri-r600/SConscript b/src/gallium/targets/dri-r600/SConscript index 64d6d2a7f6f..aa771db2d1a 100644 --- a/src/gallium/targets/dri-r600/SConscript +++ b/src/gallium/targets/dri-r600/SConscript @@ -1,9 +1,5 @@ Import('*') -if not 'r600' in env['drivers']: - print 'warning: r600 pipe driver not built skipping r600_dri.so' - Return() - env = drienv.Clone() env.ParseConfig('pkg-config --cflags --libs libdrm_radeon') @@ -22,8 +18,10 @@ env.Prepend(LIBS = [ COMMON_DRI_DRM_OBJECTS ]) -env.SharedLibrary( +module = env.SharedLibrary( target ='r600_dri.so', source = 'target.c', SHLIBPREFIX = '', ) + +env.Alias('dri-r600', module) diff --git a/src/gallium/targets/dri-swrast/SConscript b/src/gallium/targets/dri-swrast/SConscript index d8143471194..b67483800e4 100644 --- a/src/gallium/targets/dri-swrast/SConscript +++ b/src/gallium/targets/dri-swrast/SConscript @@ -27,15 +27,16 @@ if True: if env['llvm']: env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') - env.Tool('udis86') env.Prepend(LIBS = [llvmpipe]) swrastg_sources = [ 'swrast_drm_api.c' ] -env.LoadableModule( +module = env.LoadableModule( target ='swrastg_dri.so', source = swrastg_sources, SHLIBPREFIX = '', ) + +env.Alias('dri-swrast', module) diff --git a/src/gallium/targets/dri-vmwgfx/SConscript b/src/gallium/targets/dri-vmwgfx/SConscript index 7afabc7429f..7888e4f2c8b 100644 --- a/src/gallium/targets/dri-vmwgfx/SConscript +++ b/src/gallium/targets/dri-vmwgfx/SConscript @@ -1,9 +1,5 @@ Import('*') -if not 'svga' in env['drivers']: - print 'warning: svga pipe driver not built skipping vmwgfx_dri.so' - Return() - env = drienv.Clone() env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE']) @@ -20,8 +16,10 @@ env.Prepend(LIBS = [ COMMON_DRI_DRM_OBJECTS ]) -env.LoadableModule( +module = env.LoadableModule( target = 'vmwgfx_dri.so', source = 'target.c', SHLIBPREFIX = '', ) + +env.Alias('dri-vmwgfx', module) \ No newline at end of file diff --git a/src/gallium/targets/egl-gdi/SConscript b/src/gallium/targets/egl-gdi/SConscript index 8f8b28ef67b..d52eeb70fd5 100644 --- a/src/gallium/targets/egl-gdi/SConscript +++ b/src/gallium/targets/egl-gdi/SConscript @@ -3,45 +3,53 @@ Import('*') -if env['platform'] == 'windows': - - env = env.Clone() - - env.Append(CPPPATH = [ - '#/src/gallium/state_trackers/egl', - '#/src/gallium/state_trackers/vega', - '#/src/egl/main', - '#/src/mesa', - ]) - - env.Append(CPPDEFINES = [ - 'FEATURE_VG=1', - 'GALLIUM_SOFTPIPE', - 'GALLIUM_RBUG', - 'GALLIUM_TRACE', - ]) - - env.Append(LIBS = [ - 'gdi32', - 'user32', - 'kernel32', - 'ws2_32', - ]) - - env['no_import_lib'] = 1 - - drivers = [softpipe] - if env['llvm']: - env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') - drivers += [llvmpipe] - drivers += [identity, trace, rbug] - - apis = [vgapi, st_vega] - - egl_gallium = env.SharedLibrary( - target ='egl_gallium', - source = 'egl-static.c', - LIBS = st_egl_gdi + ws_gdi + drivers + apis + gallium + egl + env['LIBS'], - ) - - env.InstallSharedLibrary(egl_gallium) +env = env.Clone() + +env.Append(CPPPATH = [ + '#/src/gallium/state_trackers/egl', + '#/src/gallium/state_trackers/vega', + '#/src/egl/main', + '#/src/mesa', +]) + +env.Append(CPPDEFINES = [ + 'FEATURE_VG=1', + 'GALLIUM_SOFTPIPE', + 'GALLIUM_RBUG', + 'GALLIUM_TRACE', +]) + +env.Append(LIBS = [ + 'gdi32', + 'user32', + 'kernel32', + 'ws2_32', +]) + +env.Prepend(LIBS = [ + st_egl_gdi, + ws_gdi, + identity, + trace, + rbug, + softpipe, + vgapi, + st_vega, + gallium, + egl, +]) + +if env['llvm']: + env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') + env.Prepend(LIBS = [llvmpipe]) + +egl_gallium = env.SharedLibrary( + target ='egl_gallium', + source = 'egl-static.c', +) + +env['no_import_lib'] = 1 + +egl_gdi = env.InstallSharedLibrary(egl_gallium) + +env.Alias('egl-gdi', egl_gdi) diff --git a/src/gallium/targets/graw-null/SConscript b/src/gallium/targets/graw-null/SConscript index 3416989d8eb..ebac1728f04 100644 --- a/src/gallium/targets/graw-null/SConscript +++ b/src/gallium/targets/graw-null/SConscript @@ -5,54 +5,28 @@ Import('*') env = env.Clone() -env.Prepend(LIBS = [ - ws_null, - trace, - rbug, - identity, -# gallium, -]) - -env.Append(CPPPATH = [ - '#src/gallium/drivers', -]) +graw_util = env.SharedObject( + source = ['graw_util.c'], +) -if env['platform'] == 'windows': - # For trace - env.Append(LIBS = [ - 'ws2_32', - ]) +env = env.Clone() sources = [ 'graw_null.c', - '../graw-xlib/graw_util.c', + graw_util, ] -if True: - env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE') - env.Prepend(LIBS = [softpipe]) - -if env['llvm']: - env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') - env.Tool('udis86') - env.Prepend(LIBS = [llvmpipe]) - -# Need this for trace, identity drivers referenced by -# gallium_wrap_screen(). -# env.Prepend(LIBS = [gallium]) # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions graw = env.SharedLibrary( - target ='graw', + target = 'graw', source = sources, ) -env.InstallSharedLibrary(graw, version=(1, 0)) - if env['platform'] == 'windows': graw = env.FindIxes(graw, 'LIBPREFIX', 'LIBSUFFIX') else: graw = env.FindIxes(graw, 'SHLIBPREFIX', 'SHLIBSUFFIX') -Export('graw') +Export('graw_util', 'graw') diff --git a/src/gallium/targets/graw-null/graw_null.c b/src/gallium/targets/graw-null/graw_null.c index 5939a5acd3c..f1fe3872c94 100644 --- a/src/gallium/targets/graw-null/graw_null.c +++ b/src/gallium/targets/graw-null/graw_null.c @@ -1,31 +1,5 @@ -#include "pipe/p_compiler.h" -#include "util/u_debug.h" -#include "util/u_memory.h" -#include "target-helpers/wrap_screen.h" -#include "sw/null/null_sw_winsys.h" -#include "os/os_time.h" #include "state_tracker/graw.h" -#ifdef GALLIUM_SOFTPIPE -#include "softpipe/sp_public.h" -#endif - -#ifdef GALLIUM_LLVMPIPE -#include "llvmpipe/lp_public.h" -#endif - -/* Haven't figured out a decent way to build the helper code yet - - * #include it here temporarily. - */ -#include "sw/sw_public.h" -#include "sw/sw.c" - -#include - - -static struct { - void (*draw)(void); -} graw; @@ -37,45 +11,7 @@ graw_create_window_and_screen( int x, enum pipe_format format, void **handle) { - const char *default_driver; - const char *driver; - struct pipe_screen *screen = NULL; - struct sw_winsys *winsys = NULL; - static int dummy; - - - /* Create the underlying winsys, which performs presents to Xlib - * drawables: - */ - winsys = null_sw_create(); - if (winsys == NULL) - return NULL; - -#if defined(GALLIUM_LLVMPIPE) - default_driver = "llvmpipe"; -#elif defined(GALLIUM_SOFTPIPE) - default_driver = "softpipe"; -#else - default_driver = ""; -#endif - - driver = debug_get_option("GALLIUM_DRIVER", default_driver); - -#if defined(GALLIUM_LLVMPIPE) - if (screen == NULL && strcmp(driver, "llvmpipe") == 0) - screen = llvmpipe_create_screen( winsys ); -#endif - -#if defined(GALLIUM_SOFTPIPE) - if (screen == NULL) - screen = softpipe_create_screen( winsys ); -#endif - - *handle = &dummy; - - /* Inject any wrapping layers we want to here: - */ - return gallium_wrap_screen( screen ); + return NULL; } @@ -83,13 +19,10 @@ graw_create_window_and_screen( int x, void graw_set_display_func( void (*draw)( void ) ) { - graw.draw = draw; } void graw_main_loop( void ) { - graw.draw(); - os_time_sleep(100000); } diff --git a/src/gallium/targets/graw-null/graw_util.c b/src/gallium/targets/graw-null/graw_util.c new file mode 100644 index 00000000000..531757f1457 --- /dev/null +++ b/src/gallium/targets/graw-null/graw_util.c @@ -0,0 +1,53 @@ + +#include "pipe/p_compiler.h" +#include "pipe/p_context.h" +#include "pipe/p_state.h" +#include "tgsi/tgsi_text.h" +#include "util/u_memory.h" +#include "state_tracker/graw.h" + + +/* Helper functions. These are the same for all graw implementations. + */ +PUBLIC void * +graw_parse_geometry_shader(struct pipe_context *pipe, + const char *text) +{ + struct tgsi_token tokens[1024]; + struct pipe_shader_state state; + + if (!tgsi_text_translate(text, tokens, Elements(tokens))) + return NULL; + + state.tokens = tokens; + return pipe->create_gs_state(pipe, &state); +} + +PUBLIC void * +graw_parse_vertex_shader(struct pipe_context *pipe, + const char *text) +{ + struct tgsi_token tokens[1024]; + struct pipe_shader_state state; + + if (!tgsi_text_translate(text, tokens, Elements(tokens))) + return NULL; + + state.tokens = tokens; + return pipe->create_vs_state(pipe, &state); +} + +PUBLIC void * +graw_parse_fragment_shader(struct pipe_context *pipe, + const char *text) +{ + struct tgsi_token tokens[1024]; + struct pipe_shader_state state; + + if (!tgsi_text_translate(text, tokens, Elements(tokens))) + return NULL; + + state.tokens = tokens; + return pipe->create_fs_state(pipe, &state); +} + diff --git a/src/gallium/targets/graw-xlib/SConscript b/src/gallium/targets/graw-xlib/SConscript index 21fce948f43..f7953097872 100644 --- a/src/gallium/targets/graw-xlib/SConscript +++ b/src/gallium/targets/graw-xlib/SConscript @@ -3,13 +3,8 @@ Import('*') -if env['platform'] != 'linux': - Return() - env = env.Clone() -env.Tool('x11') - env.Prepend(LIBS = [ ws_xlib, trace, @@ -18,26 +13,24 @@ env.Prepend(LIBS = [ # gallium, ]) +env.Prepend(LIBS = env['X11_LIBS']) + env.Append(CPPPATH = [ '#src/gallium/drivers', '#src/gallium/include/state_tracker', ]) - sources = [ 'graw_xlib.c', - 'graw_util.c', + graw_util ] -env.Tool('x11') - if True: env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE') env.Prepend(LIBS = [softpipe]) if env['llvm']: env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') - env.Tool('udis86') env.Prepend(LIBS = [llvmpipe]) # Need this for trace, identity drivers referenced by @@ -51,8 +44,6 @@ graw = env.SharedLibrary( source = sources, ) -env.InstallSharedLibrary(graw, version=(1, 0)) - -graw = env.FindIxes(graw, 'SHLIBPREFIX', 'SHLIBSUFFIX') +graw = env.InstallSharedLibrary(graw, version=(1, 0)) -Export('graw') +env.Alias('graw-xlib', graw) diff --git a/src/gallium/targets/graw-xlib/graw_util.c b/src/gallium/targets/graw-xlib/graw_util.c deleted file mode 100644 index fc7c9ae6f92..00000000000 --- a/src/gallium/targets/graw-xlib/graw_util.c +++ /dev/null @@ -1,50 +0,0 @@ - -#include "pipe/p_compiler.h" -#include "pipe/p_context.h" -#include "pipe/p_state.h" -#include "tgsi/tgsi_text.h" -#include "util/u_memory.h" -#include "state_tracker/graw.h" - - -/* Helper functions. These are the same for all graw implementations. - */ -void *graw_parse_geometry_shader(struct pipe_context *pipe, - const char *text) -{ - struct tgsi_token tokens[1024]; - struct pipe_shader_state state; - - if (!tgsi_text_translate(text, tokens, Elements(tokens))) - return NULL; - - state.tokens = tokens; - return pipe->create_gs_state(pipe, &state); -} - -void *graw_parse_vertex_shader(struct pipe_context *pipe, - const char *text) -{ - struct tgsi_token tokens[1024]; - struct pipe_shader_state state; - - if (!tgsi_text_translate(text, tokens, Elements(tokens))) - return NULL; - - state.tokens = tokens; - return pipe->create_vs_state(pipe, &state); -} - -void *graw_parse_fragment_shader(struct pipe_context *pipe, - const char *text) -{ - struct tgsi_token tokens[1024]; - struct pipe_shader_state state; - - if (!tgsi_text_translate(text, tokens, Elements(tokens))) - return NULL; - - state.tokens = tokens; - return pipe->create_fs_state(pipe, &state); -} - diff --git a/src/gallium/targets/libgl-gdi/SConscript b/src/gallium/targets/libgl-gdi/SConscript index 12fe403f62f..339238756ab 100644 --- a/src/gallium/targets/libgl-gdi/SConscript +++ b/src/gallium/targets/libgl-gdi/SConscript @@ -3,45 +3,46 @@ Import('*') -if env['platform'] == 'windows': - - env = env.Clone() - - env.Append(CPPPATH = [ - '#src/gallium/state_trackers/wgl', - '#src/gallium/winsys/sw', - ]) - - env.Append(LIBS = [ - 'gdi32', - 'user32', - 'kernel32', - 'ws2_32', - talloc, - ]) - - sources = [] - drivers = [] - - if True: - sources = ['gdi_softpipe_winsys.c'] - drivers = [softpipe] - - if env['llvm']: - sources = ['gdi_llvmpipe_winsys.c'] - drivers = [llvmpipe] - - if env['gcc']: - sources += ['#src/gallium/state_trackers/wgl/opengl32.mingw.def'] - else: - sources += ['#src/gallium/state_trackers/wgl/opengl32.def'] - - drivers += [trace, rbug] - - env['no_import_lib'] = 1 - - env.SharedLibrary( - target ='opengl32', - source = sources, - LIBS = wgl + ws_gdi + glapi + mesa + drivers + gallium + glsl + env['LIBS'], - ) +env = env.Clone() + +env.Append(CPPPATH = [ + '#src/gallium/state_trackers/wgl', + '#src/gallium/winsys/sw', +]) + +env.Append(LIBS = [ + 'gdi32', + 'user32', + 'kernel32', + 'ws2_32', + talloc, +]) + +sources = [] +drivers = [] + +if True: + sources = ['gdi_softpipe_winsys.c'] + drivers = [softpipe] + +if env['llvm']: + sources = ['gdi_llvmpipe_winsys.c'] + drivers = [llvmpipe] + +if env['gcc']: + sources += ['#src/gallium/state_trackers/wgl/opengl32.mingw.def'] +else: + sources += ['#src/gallium/state_trackers/wgl/opengl32.def'] + +drivers += [trace, rbug] + +env['no_import_lib'] = 1 + +opengl32 = env.SharedLibrary( + target ='opengl32', + source = sources, + LIBS = wgl + ws_gdi + glapi + mesa + drivers + gallium + glsl + env['LIBS'], +) + +env.Alias('opengl32', opengl32) +env.Alias('libgl-gdi', opengl32) diff --git a/src/gallium/targets/libgl-xlib/SConscript b/src/gallium/targets/libgl-xlib/SConscript index 27b562e1d5d..582760eac93 100644 --- a/src/gallium/targets/libgl-xlib/SConscript +++ b/src/gallium/targets/libgl-xlib/SConscript @@ -3,17 +3,6 @@ Import('*') -if env['platform'] != 'linux': - Return() - -if 'mesa' not in env['statetrackers']: - print 'warning: Mesa state tracker disabled: skipping build of xlib libGL.so' - Return() - -if env['dri']: - print 'warning: DRI enabled: skipping build of xlib libGL.so' - Return() - env = env.Clone() env.Append(CPPPATH = [ @@ -25,6 +14,8 @@ env.Append(CPPPATH = [ env.Append(CPPDEFINES = ['USE_XSHM']) +env.Prepend(LIBS = env['X11_LIBS']) + env.Prepend(LIBS = [ st_xlib, ws_xlib, @@ -42,8 +33,6 @@ sources = [ 'xlib.c', ] -env.Tool('x11') - if True: env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE') env.Prepend(LIBS = [softpipe]) @@ -54,10 +43,10 @@ if True: if env['llvm']: env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') - env.Tool('udis86') env.Prepend(LIBS = [llvmpipe]) -if 'cell' in env['drivers']: +if False: + # TODO: Detect Cell SDK env.Append(CPPDEFINES = 'GALLIUM_CELL') env.Prepend(LIBS = [cell]) @@ -67,6 +56,8 @@ libgl = env.SharedLibrary( source = sources, ) -if not env['dri']: - # Only install this libGL.so if DRI not enabled - env.InstallSharedLibrary(libgl, version=(1, 5)) +if True: + # XXX: Only install this libGL.so if DRI not enabled + libgl = env.InstallSharedLibrary(libgl, version=(1, 5)) + +env.Alias('libgl-xlib', libgl) diff --git a/src/gallium/targets/xorg-vmwgfx/SConscript b/src/gallium/targets/xorg-vmwgfx/SConscript index 43b2c74f9ce..0a81b33651f 100644 --- a/src/gallium/targets/xorg-vmwgfx/SConscript +++ b/src/gallium/targets/xorg-vmwgfx/SConscript @@ -2,62 +2,58 @@ import os.path Import('*') -if not 'svga' in env['drivers']: - print 'warning: svga pipe driver not built skipping vmwgfx_drv.so' - Return() - -if env['platform'] == 'linux': - - env = env.Clone() - - env.ParseConfig('pkg-config --cflags --libs libdrm xorg-server') - - env.Prepend(CPPPATH = [ - '#/include', - '#/src/gallium', - '#/src/mesa', - '#/src/gallium/drivers/svga', - '#/src/gallium/drivers/svga/include', - ]) - - env.Append(CPPDEFINES = [ - ]) - - if env['gcc']: - env.Append(CPPDEFINES = [ - 'HAVE_STDINT_H', - 'HAVE_SYS_TYPES_H', - ]) - - env.Append(CFLAGS = [ - '-std=gnu99', - '-D_FILE_OFFSET_BITS=64', - ]) - - env.Prepend(LIBPATH = [ - ]) - - env.Prepend(LIBS = [ - trace, - rbug, - st_xorg, - svgadrm, - svga, - gallium, - ]) - - sources = [ - 'vmw_ioctl.c', - 'vmw_ctrl.c', - 'vmw_screen.c', - 'vmw_video.c', - 'vmw_xorg.c', - ] - - # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions - env.LoadableModule( - target ='vmwgfx_drv.so', - source = sources, - LIBS = env['LIBS'], - SHLIBPREFIX = '', - ) +env = env.Clone() + +env.ParseConfig('pkg-config --cflags --libs libdrm xorg-server') + +env.Prepend(CPPPATH = [ + '#/include', + '#/src/gallium', + '#/src/mesa', + '#/src/gallium/drivers/svga', + '#/src/gallium/drivers/svga/include', +]) + +env.Append(CPPDEFINES = [ +]) + +if env['gcc']: + env.Append(CPPDEFINES = [ + 'HAVE_STDINT_H', + 'HAVE_SYS_TYPES_H', + ]) + +env.Append(CFLAGS = [ + '-std=gnu99', + '-D_FILE_OFFSET_BITS=64', +]) + +env.Prepend(LIBPATH = [ +]) + +env.Prepend(LIBS = [ + trace, + rbug, + st_xorg, + svgadrm, + svga, + gallium, +]) + +sources = [ + 'vmw_ioctl.c', + 'vmw_ctrl.c', + 'vmw_screen.c', + 'vmw_video.c', + 'vmw_xorg.c', +] + +# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions +module = env.LoadableModule( + target ='vmwgfx_drv.so', + source = sources, + LIBS = env['LIBS'], + SHLIBPREFIX = '', +) + +env.Alias('xorg-vmwgfx', module) diff --git a/src/gallium/tests/graw/SConscript b/src/gallium/tests/graw/SConscript index ffde61965b4..3341b884985 100644 --- a/src/gallium/tests/graw/SConscript +++ b/src/gallium/tests/graw/SConscript @@ -1,20 +1,17 @@ Import('*') -try: - graw -except NameError: - print 'warning: graw library not avaiable: skipping build of graw test' - Return() - env = env.Clone() +env.Prepend(LIBS = [gallium]) + env.Prepend(LIBPATH = [graw.dir]) -env.Prepend(LIBS = ['graw'] + gallium) +env.Prepend(LIBS = ['graw']) + -if platform in ('freebsd8', 'sunos5'): +if env['platform'] in ('freebsd8', 'sunos5'): env.Append(LIBS = ['m']) -if platform == 'freebsd8': +if env['platform'] == 'freebsd8': env.Append(LIBS = ['pthread']) progs = [ @@ -29,9 +26,10 @@ progs = [ 'tri-gs', ] -for prog in progs: - env.Program( - target = prog, - source = prog + '.c', +for name in progs: + program = env.Program( + target = name, + source = name + '.c', ) - + #env.Depends(program, graw) + env.Alias('graw-progs', program) diff --git a/src/gallium/tests/unit/SConscript b/src/gallium/tests/unit/SConscript index 359759e22b2..655e8a9b41c 100644 --- a/src/gallium/tests/unit/SConscript +++ b/src/gallium/tests/unit/SConscript @@ -4,10 +4,10 @@ env = env.Clone() env.Prepend(LIBS = [gallium]) -if platform in ('freebsd8', 'sunos5'): +if env['platform'] in ('freebsd8', 'sunos5'): env.Append(LIBS = ['m']) -if platform == 'freebsd8': +if env['platform'] == 'freebsd8': env.Append(LIBS = ['pthread']) progs = [ diff --git a/src/gallium/winsys/SConscript b/src/gallium/winsys/SConscript index 65b12287df7..d74f8a2e989 100644 --- a/src/gallium/winsys/SConscript +++ b/src/gallium/winsys/SConscript @@ -2,45 +2,38 @@ Import('*') SConscript([ - 'sw/wrapper/SConscript', + 'sw/wrapper/SConscript', ]) -if 'xlib' in env['winsys']: - SConscript([ - 'sw/xlib/SConscript', - ]) +SConscript([ + 'sw/xlib/SConscript', +]) -if 'gdi' in env['winsys']: - SConscript([ - 'sw/gdi/SConscript', - ]) +SConscript([ + 'sw/gdi/SConscript', +]) if env['dri']: - SConscript([ - 'sw/dri/SConscript', - ]) - - if 'vmware' in env['winsys']: - SConscript([ - 'svga/drm/SConscript', - ]) - - if 'i915' in env['winsys']: - SConscript([ - 'i915/drm/SConscript', - ]) - - if 'i965' in env['winsys']: - SConscript([ - 'i965/drm/SConscript', - ]) - - if 'radeon' in env['winsys']: - SConscript([ - 'radeon/drm/SConscript', - ]) - - if 'r600' in env['winsys']: - SConscript([ - 'r600/drm/SConscript', - ]) + SConscript([ + 'sw/dri/SConscript', + ]) + + SConscript([ + 'svga/drm/SConscript', + ]) + + SConscript([ + 'i915/drm/SConscript', + ]) + + SConscript([ + 'i965/drm/SConscript', + ]) + + SConscript([ + 'radeon/drm/SConscript', + ]) + + SConscript([ + 'r600/drm/SConscript', + ]) diff --git a/src/glut/glx/SConscript b/src/glut/glx/SConscript index 29d2cc01494..9363b5ca5cc 100644 --- a/src/glut/glx/SConscript +++ b/src/glut/glx/SConscript @@ -78,7 +78,6 @@ if env['platform'] == 'windows': 'glut.def', ] else: - env.Tool('x11') env.PrependUnique(LIBS = [ 'GLU', 'GL', diff --git a/src/mapi/glapi/SConscript b/src/mapi/glapi/SConscript index 40db237fcbc..77a5f9bd2e3 100644 --- a/src/mapi/glapi/SConscript +++ b/src/mapi/glapi/SConscript @@ -6,77 +6,78 @@ Import('*') if env['platform'] != 'winddk': - env = env.Clone() - - env.Append(CPPDEFINES = [ - 'MAPI_GLAPI_CURRENT', - ]) + env = env.Clone() + + env.Append(CPPDEFINES = [ + 'MAPI_GLAPI_CURRENT', + ]) - if env['platform'] == 'windows': - env.Append(CPPDEFINES = [ - '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers - 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers - 'WIN32_THREADS', # use Win32 thread API - ]) + if env['platform'] == 'windows': + env.Append(CPPDEFINES = [ + '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers + 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers + 'WIN32_THREADS', # use Win32 thread API + ]) - env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', - ]) - - glapi_sources = [ - 'glapi_dispatch.c', - 'glapi_entrypoint.c', - 'glapi_getproc.c', - 'glapi_nop.c', - 'glthread.c', - ] - - mapi_sources = [ - 'u_current.c', - 'u_execmem.c', - 'u_thread.c', - ] - for s in mapi_sources: - o = env.SharedObject(s[:-2], '../mapi/' + s) - glapi_sources.append(o) + env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/mesa', + ]) + + glapi_sources = [ + 'glapi_dispatch.c', + 'glapi_entrypoint.c', + 'glapi_getproc.c', + 'glapi_nop.c', + 'glthread.c', + ] + + mapi_sources = [ + 'u_current.c', + 'u_execmem.c', + 'u_thread.c', + ] + for s in mapi_sources: + o = env.SharedObject(s[:-2], '../mapi/' + s) + glapi_sources.append(o) - # - # Assembly sources - # - if gcc and env['machine'] == 'x86': - env.Append(CPPDEFINES = [ - 'USE_X86_ASM', - 'USE_MMX_ASM', - 'USE_3DNOW_ASM', - 'USE_SSE_ASM', - ]) - glapi_sources += [ - 'glapi_x86.S', - ] - elif gcc and env['machine'] == 'x86_64': - env.Append(CPPDEFINES = [ - 'USE_X86_64_ASM', - ]) - glapi_sources += [ - 'glapi_x86-64.S' - ] - elif gcc and env['machine'] == 'ppc': - env.Append(CPPDEFINES = [ - 'USE_PPC_ASM', - 'USE_VMX_ASM', - ]) - glapi_sources += [ - ] - elif gcc and env['machine'] == 'sparc': - glapi_sources += [ - 'glapi_sparc.S' - ] - else: - pass - - glapi = env.ConvenienceLibrary( - target = 'glapi', - source = glapi_sources, - ) - Export('glapi') + # + # Assembly sources + # + if env['gcc'] and env['platform'] != 'windows': + if env['machine'] == 'x86': + env.Append(CPPDEFINES = [ + 'USE_X86_ASM', + 'USE_MMX_ASM', + 'USE_3DNOW_ASM', + 'USE_SSE_ASM', + ]) + glapi_sources += [ + 'glapi_x86.S', + ] + elif env['machine'] == 'x86_64': + env.Append(CPPDEFINES = [ + 'USE_X86_64_ASM', + ]) + glapi_sources += [ + 'glapi_x86-64.S' + ] + elif env['machine'] == 'ppc': + env.Append(CPPDEFINES = [ + 'USE_PPC_ASM', + 'USE_VMX_ASM', + ]) + glapi_sources += [ + ] + elif env['machine'] == 'sparc': + glapi_sources += [ + 'glapi_sparc.S' + ] + else: + pass + + glapi = env.ConvenienceLibrary( + target = 'glapi', + source = glapi_sources, + ) + Export('glapi') diff --git a/src/mapi/vgapi/.gitignore b/src/mapi/vgapi/.gitignore new file mode 100644 index 00000000000..5becb993861 --- /dev/null +++ b/src/mapi/vgapi/.gitignore @@ -0,0 +1 @@ +vgapi_tmp.h diff --git a/src/mesa/SConscript b/src/mesa/SConscript index e54737aed18..7550c6d5ed4 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -4,322 +4,323 @@ Import('*') -if env['platform'] != 'winddk': +env = env.Clone() - env = env.Clone() - - env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/glsl', - '#/src/mesa', - ]) - - if env['platform'] == 'windows': - env.Append(CPPDEFINES = [ - '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers - 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers - 'WIN32_THREADS', # use Win32 thread API - ]) - env.Prepend(CPPPATH = ['#src/talloc']) +env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/glsl', + '#/src/mesa', +]) - # - # Source files - # - - main_sources = [ - 'main/api_arrayelt.c', - 'main/api_exec.c', - 'main/api_loopback.c', - 'main/api_noop.c', - 'main/api_validate.c', - 'main/accum.c', - 'main/arbprogram.c', - 'main/atifragshader.c', - 'main/attrib.c', - 'main/arrayobj.c', - 'main/blend.c', - 'main/bufferobj.c', - 'main/buffers.c', - 'main/clear.c', - 'main/clip.c', - 'main/colortab.c', - 'main/condrender.c', - 'main/context.c', - 'main/convolve.c', - 'main/cpuinfo.c', - 'main/debug.c', - 'main/depth.c', - 'main/depthstencil.c', - 'main/dlist.c', - 'main/dlopen.c', - 'main/drawpix.c', - 'main/drawtex.c', - 'main/enable.c', - 'main/enums.c', - 'main/eval.c', - 'main/execmem.c', - 'main/extensions.c', - 'main/fbobject.c', - 'main/feedback.c', - 'main/ffvertex_prog.c', - 'main/fog.c', - 'main/formats.c', - 'main/framebuffer.c', - 'main/get.c', - 'main/getstring.c', - 'main/hash.c', - 'main/hint.c', - 'main/histogram.c', - 'main/image.c', - 'main/imports.c', - 'main/light.c', - 'main/lines.c', - 'main/matrix.c', - 'main/mipmap.c', - 'main/mm.c', - 'main/multisample.c', - 'main/nvprogram.c', - 'main/pack.c', - 'main/pixel.c', - 'main/pixelstore.c', - 'main/pixeltransfer.c', - 'main/points.c', - 'main/polygon.c', - 'main/querymatrix.c', - 'main/queryobj.c', - 'main/rastpos.c', - 'main/readpix.c', - 'main/remap.c', - 'main/renderbuffer.c', - 'main/scissor.c', - 'main/shaderapi.c', - 'main/shaderobj.c', - 'main/shared.c', - 'main/state.c', - 'main/stencil.c', - 'main/syncobj.c', - 'main/texcompress.c', - 'main/texcompress_s3tc.c', - 'main/texcompress_fxt1.c', - 'main/texenv.c', - 'main/texenvprogram.c', - 'main/texfetch.c', - 'main/texformat.c', - 'main/texgen.c', - 'main/texgetimage.c', - 'main/teximage.c', - 'main/texobj.c', - 'main/texpal.c', - 'main/texparam.c', - 'main/texrender.c', - 'main/texstate.c', - 'main/texstore.c', - 'main/transformfeedback.c', - 'main/uniforms.c', - 'main/varray.c', - 'main/version.c', - 'main/viewport.c', - 'main/vtxfmt.c', - ] - - math_sources = [ - 'math/m_debug_clip.c', - 'math/m_debug_norm.c', - 'math/m_debug_xform.c', - 'math/m_eval.c', - 'math/m_matrix.c', - 'math/m_translate.c', - 'math/m_vector.c', - 'math/m_xform.c', - ] - - vbo_sources = [ - 'vbo/vbo_context.c', - 'vbo/vbo_exec.c', - 'vbo/vbo_exec_api.c', - 'vbo/vbo_exec_array.c', - 'vbo/vbo_exec_draw.c', - 'vbo/vbo_exec_eval.c', - 'vbo/vbo_rebase.c', - 'vbo/vbo_split.c', - 'vbo/vbo_split_copy.c', - 'vbo/vbo_split_inplace.c', - 'vbo/vbo_save.c', - 'vbo/vbo_save_api.c', - 'vbo/vbo_save_draw.c', - 'vbo/vbo_save_loopback.c', - ] - - vf_sources = [ - 'vf/vf.c', - 'vf/vf_generic.c', - 'vf/vf_sse.c', - ] - - statetracker_sources = [ - 'state_tracker/st_atom.c', - 'state_tracker/st_atom_blend.c', - 'state_tracker/st_atom_clip.c', - 'state_tracker/st_atom_constbuf.c', - 'state_tracker/st_atom_depth.c', - 'state_tracker/st_atom_framebuffer.c', - 'state_tracker/st_atom_msaa.c', - 'state_tracker/st_atom_pixeltransfer.c', - 'state_tracker/st_atom_sampler.c', - 'state_tracker/st_atom_scissor.c', - 'state_tracker/st_atom_shader.c', - 'state_tracker/st_atom_rasterizer.c', - 'state_tracker/st_atom_stipple.c', - 'state_tracker/st_atom_texture.c', - 'state_tracker/st_atom_viewport.c', - 'state_tracker/st_cb_accum.c', - 'state_tracker/st_cb_bitmap.c', - 'state_tracker/st_cb_blit.c', - 'state_tracker/st_cb_bufferobjects.c', - 'state_tracker/st_cb_clear.c', - 'state_tracker/st_cb_condrender.c', - 'state_tracker/st_cb_flush.c', - 'state_tracker/st_cb_drawpixels.c', - 'state_tracker/st_cb_drawtex.c', - 'state_tracker/st_cb_eglimage.c', - 'state_tracker/st_cb_fbo.c', - 'state_tracker/st_cb_feedback.c', - 'state_tracker/st_cb_program.c', - 'state_tracker/st_cb_queryobj.c', - 'state_tracker/st_cb_rasterpos.c', - 'state_tracker/st_cb_readpixels.c', - 'state_tracker/st_cb_strings.c', - 'state_tracker/st_cb_texture.c', - 'state_tracker/st_cb_viewport.c', - 'state_tracker/st_cb_xformfb.c', - 'state_tracker/st_context.c', - 'state_tracker/st_debug.c', - 'state_tracker/st_draw.c', - 'state_tracker/st_draw_feedback.c', - 'state_tracker/st_extensions.c', - 'state_tracker/st_format.c', - 'state_tracker/st_gen_mipmap.c', - 'state_tracker/st_manager.c', - 'state_tracker/st_mesa_to_tgsi.c', - 'state_tracker/st_program.c', - 'state_tracker/st_texture.c', - ] - - program_sources = [ - 'program/arbprogparse.c', - 'program/hash_table.c', - 'program/ir_to_mesa.cpp', - 'program/lex.yy.c', - 'program/nvfragparse.c', - 'program/nvvertparse.c', - 'program/program.c', - 'program/program_parse.tab.c', - 'program/program_parse_extra.c', - 'program/prog_cache.c', - 'program/prog_execute.c', - 'program/prog_instruction.c', - 'program/prog_noise.c', - 'program/prog_optimize.c', - 'program/prog_parameter.c', - 'program/prog_parameter_layout.c', - 'program/prog_print.c', - 'program/prog_statevars.c', - 'program/prog_uniform.c', - 'program/programopt.c', - 'program/sampler.cpp', - 'program/symbol_table.c', - ] - - mesa_sources = ( - main_sources + - math_sources + - program_sources + - vbo_sources + - vf_sources + - statetracker_sources - ) +if env['platform'] == 'windows': + env.Append(CPPDEFINES = [ + '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers + 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers + 'WIN32_THREADS', # use Win32 thread API + ]) + env.Prepend(CPPPATH = ['#src/talloc']) - # - # Assembly sources - # - if gcc and env['machine'] == 'x86': - env.Append(CPPDEFINES = [ - 'USE_X86_ASM', - 'USE_MMX_ASM', - 'USE_3DNOW_ASM', - 'USE_SSE_ASM', - ]) - mesa_sources += [ - 'x86/common_x86.c', - 'x86/x86_xform.c', - 'x86/3dnow.c', - 'x86/sse.c', - 'x86/common_x86_asm.S', - 'x86/x86_xform2.S', - 'x86/x86_xform3.S', - 'x86/x86_xform4.S', - 'x86/x86_cliptest.S', - 'x86/mmx_blend.S', - 'x86/3dnow_xform1.S', - 'x86/3dnow_xform2.S', - 'x86/3dnow_xform3.S', - 'x86/3dnow_xform4.S', - 'x86/3dnow_normal.S', - 'x86/sse_xform1.S', - 'x86/sse_xform2.S', - 'x86/sse_xform3.S', - 'x86/sse_xform4.S', - 'x86/sse_normal.S', - 'x86/read_rgba_span_x86.S', - ] - elif gcc and env['machine'] == 'x86_64': - env.Append(CPPDEFINES = [ - 'USE_X86_64_ASM', - ]) - mesa_sources += [ - 'x86-64/x86-64.c', - 'x86-64/xform4.S', - ] - elif gcc and env['machine'] == 'ppc': - env.Append(CPPDEFINES = [ - 'USE_PPC_ASM', - 'USE_VMX_ASM', - ]) - mesa_sources += [ - 'ppc/common_ppc.c', - ] - elif gcc and env['machine'] == 'sparc': - mesa_sources += [ - 'sparc/sparc.c', - 'sparc/clip.S', - 'sparc/norm.S', - 'sparc/xform.S', - ] - else: - pass - - # Generate matypes.h - if gcc and env['machine'] in ('x86', 'x86_64'): - # See http://www.scons.org/wiki/UsingCodeGenerators - gen_matypes = env.Program( - target = 'gen_matypes', - source = 'x86/gen_matypes.c', - ) - matypes = env.Command( - 'matypes.h', - gen_matypes, - gen_matypes[0].abspath + ' > $TARGET', - ) - # Add the dir containing the generated header (somewhere inside the - # build dir) to the include path - env.Append(CPPPATH = [matypes[0].dir]) +# +# Source files +# - # - # Libraries - # +main_sources = [ + 'main/api_arrayelt.c', + 'main/api_exec.c', + 'main/api_loopback.c', + 'main/api_noop.c', + 'main/api_validate.c', + 'main/accum.c', + 'main/arbprogram.c', + 'main/atifragshader.c', + 'main/attrib.c', + 'main/arrayobj.c', + 'main/blend.c', + 'main/bufferobj.c', + 'main/buffers.c', + 'main/clear.c', + 'main/clip.c', + 'main/colortab.c', + 'main/condrender.c', + 'main/context.c', + 'main/convolve.c', + 'main/cpuinfo.c', + 'main/debug.c', + 'main/depth.c', + 'main/depthstencil.c', + 'main/dlist.c', + 'main/dlopen.c', + 'main/drawpix.c', + 'main/drawtex.c', + 'main/enable.c', + 'main/enums.c', + 'main/eval.c', + 'main/execmem.c', + 'main/extensions.c', + 'main/fbobject.c', + 'main/feedback.c', + 'main/ffvertex_prog.c', + 'main/fog.c', + 'main/formats.c', + 'main/framebuffer.c', + 'main/get.c', + 'main/getstring.c', + 'main/hash.c', + 'main/hint.c', + 'main/histogram.c', + 'main/image.c', + 'main/imports.c', + 'main/light.c', + 'main/lines.c', + 'main/matrix.c', + 'main/mipmap.c', + 'main/mm.c', + 'main/multisample.c', + 'main/nvprogram.c', + 'main/pack.c', + 'main/pixel.c', + 'main/pixelstore.c', + 'main/pixeltransfer.c', + 'main/points.c', + 'main/polygon.c', + 'main/querymatrix.c', + 'main/queryobj.c', + 'main/rastpos.c', + 'main/readpix.c', + 'main/remap.c', + 'main/renderbuffer.c', + 'main/scissor.c', + 'main/shaderapi.c', + 'main/shaderobj.c', + 'main/shared.c', + 'main/state.c', + 'main/stencil.c', + 'main/syncobj.c', + 'main/texcompress.c', + 'main/texcompress_s3tc.c', + 'main/texcompress_fxt1.c', + 'main/texenv.c', + 'main/texenvprogram.c', + 'main/texfetch.c', + 'main/texformat.c', + 'main/texgen.c', + 'main/texgetimage.c', + 'main/teximage.c', + 'main/texobj.c', + 'main/texpal.c', + 'main/texparam.c', + 'main/texrender.c', + 'main/texstate.c', + 'main/texstore.c', + 'main/transformfeedback.c', + 'main/uniforms.c', + 'main/varray.c', + 'main/version.c', + 'main/viewport.c', + 'main/vtxfmt.c', +] - mesa = env.ConvenienceLibrary( - target = 'mesa', - source = mesa_sources, - ) - Export('mesa') +math_sources = [ + 'math/m_debug_clip.c', + 'math/m_debug_norm.c', + 'math/m_debug_xform.c', + 'math/m_eval.c', + 'math/m_matrix.c', + 'math/m_translate.c', + 'math/m_vector.c', + 'math/m_xform.c', +] + +vbo_sources = [ + 'vbo/vbo_context.c', + 'vbo/vbo_exec.c', + 'vbo/vbo_exec_api.c', + 'vbo/vbo_exec_array.c', + 'vbo/vbo_exec_draw.c', + 'vbo/vbo_exec_eval.c', + 'vbo/vbo_rebase.c', + 'vbo/vbo_split.c', + 'vbo/vbo_split_copy.c', + 'vbo/vbo_split_inplace.c', + 'vbo/vbo_save.c', + 'vbo/vbo_save_api.c', + 'vbo/vbo_save_draw.c', + 'vbo/vbo_save_loopback.c', +] + +vf_sources = [ + 'vf/vf.c', + 'vf/vf_generic.c', + 'vf/vf_sse.c', +] + +statetracker_sources = [ + 'state_tracker/st_atom.c', + 'state_tracker/st_atom_blend.c', + 'state_tracker/st_atom_clip.c', + 'state_tracker/st_atom_constbuf.c', + 'state_tracker/st_atom_depth.c', + 'state_tracker/st_atom_framebuffer.c', + 'state_tracker/st_atom_msaa.c', + 'state_tracker/st_atom_pixeltransfer.c', + 'state_tracker/st_atom_sampler.c', + 'state_tracker/st_atom_scissor.c', + 'state_tracker/st_atom_shader.c', + 'state_tracker/st_atom_rasterizer.c', + 'state_tracker/st_atom_stipple.c', + 'state_tracker/st_atom_texture.c', + 'state_tracker/st_atom_viewport.c', + 'state_tracker/st_cb_accum.c', + 'state_tracker/st_cb_bitmap.c', + 'state_tracker/st_cb_blit.c', + 'state_tracker/st_cb_bufferobjects.c', + 'state_tracker/st_cb_clear.c', + 'state_tracker/st_cb_condrender.c', + 'state_tracker/st_cb_flush.c', + 'state_tracker/st_cb_drawpixels.c', + 'state_tracker/st_cb_drawtex.c', + 'state_tracker/st_cb_eglimage.c', + 'state_tracker/st_cb_fbo.c', + 'state_tracker/st_cb_feedback.c', + 'state_tracker/st_cb_program.c', + 'state_tracker/st_cb_queryobj.c', + 'state_tracker/st_cb_rasterpos.c', + 'state_tracker/st_cb_readpixels.c', + 'state_tracker/st_cb_strings.c', + 'state_tracker/st_cb_texture.c', + 'state_tracker/st_cb_viewport.c', + 'state_tracker/st_cb_xformfb.c', + 'state_tracker/st_context.c', + 'state_tracker/st_debug.c', + 'state_tracker/st_draw.c', + 'state_tracker/st_draw_feedback.c', + 'state_tracker/st_extensions.c', + 'state_tracker/st_format.c', + 'state_tracker/st_gen_mipmap.c', + 'state_tracker/st_manager.c', + 'state_tracker/st_mesa_to_tgsi.c', + 'state_tracker/st_program.c', + 'state_tracker/st_texture.c', +] + +program_sources = [ + 'program/arbprogparse.c', + 'program/hash_table.c', + 'program/ir_to_mesa.cpp', + 'program/lex.yy.c', + 'program/nvfragparse.c', + 'program/nvvertparse.c', + 'program/program.c', + 'program/program_parse.tab.c', + 'program/program_parse_extra.c', + 'program/prog_cache.c', + 'program/prog_execute.c', + 'program/prog_instruction.c', + 'program/prog_noise.c', + 'program/prog_optimize.c', + 'program/prog_parameter.c', + 'program/prog_parameter_layout.c', + 'program/prog_print.c', + 'program/prog_statevars.c', + 'program/prog_uniform.c', + 'program/programopt.c', + 'program/sampler.cpp', + 'program/symbol_table.c', +] + +mesa_sources = ( + main_sources + + math_sources + + program_sources + + vbo_sources + + vf_sources + + statetracker_sources +) + +# +# Assembly sources +# +if env['gcc'] and env['machine'] == 'x86': + env.Append(CPPDEFINES = [ + 'USE_X86_ASM', + 'USE_MMX_ASM', + 'USE_3DNOW_ASM', + 'USE_SSE_ASM', + ]) + mesa_sources += [ + 'x86/common_x86.c', + 'x86/x86_xform.c', + 'x86/3dnow.c', + 'x86/sse.c', + 'x86/common_x86_asm.S', + 'x86/x86_xform2.S', + 'x86/x86_xform3.S', + 'x86/x86_xform4.S', + 'x86/x86_cliptest.S', + 'x86/mmx_blend.S', + 'x86/3dnow_xform1.S', + 'x86/3dnow_xform2.S', + 'x86/3dnow_xform3.S', + 'x86/3dnow_xform4.S', + 'x86/3dnow_normal.S', + 'x86/sse_xform1.S', + 'x86/sse_xform2.S', + 'x86/sse_xform3.S', + 'x86/sse_xform4.S', + 'x86/sse_normal.S', + 'x86/read_rgba_span_x86.S', + ] +elif env['gcc'] and env['machine'] == 'x86_64': + env.Append(CPPDEFINES = [ + 'USE_X86_64_ASM', + ]) + mesa_sources += [ + 'x86-64/x86-64.c', + 'x86-64/xform4.S', + ] +elif env['gcc'] and env['machine'] == 'ppc': + env.Append(CPPDEFINES = [ + 'USE_PPC_ASM', + 'USE_VMX_ASM', + ]) + mesa_sources += [ + 'ppc/common_ppc.c', + ] +elif env['gcc'] and env['machine'] == 'sparc': + mesa_sources += [ + 'sparc/sparc.c', + 'sparc/clip.S', + 'sparc/norm.S', + 'sparc/xform.S', + ] +else: + pass + +# Generate matypes.h +if env['gcc'] and env['machine'] in ('x86', 'x86_64'): + # See http://www.scons.org/wiki/UsingCodeGenerators + gen_matypes = env.Program( + target = 'gen_matypes', + source = 'x86/gen_matypes.c', + ) + matypes = env.Command( + 'matypes.h', + gen_matypes, + gen_matypes[0].abspath + ' > $TARGET', + ) + # Add the dir containing the generated header (somewhere inside the + # build dir) to the include path + env.Append(CPPPATH = [matypes[0].dir]) + +# +# Libraries +# + +mesa = env.ConvenienceLibrary( + target = 'mesa', + source = mesa_sources, +) + +env.Alias('mesa', mesa) + +Export('mesa') -- cgit v1.2.3 From 4f8dbd2f5ecfa3142a43876146ea054cf11f80eb Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 2 Nov 2010 12:34:52 +0000 Subject: r600g: List recently added files in SConscript. --- src/gallium/drivers/r600/SConscript | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/SConscript b/src/gallium/drivers/r600/SConscript index bf0ad8571ba..cdeec191398 100644 --- a/src/gallium/drivers/r600/SConscript +++ b/src/gallium/drivers/r600/SConscript @@ -25,7 +25,9 @@ r600 = env.ConvenienceLibrary( 'r600_resource.c', 'r600_shader.c', 'r600_state.c', + 'r600_state_common.c', 'r600_texture.c', + 'r600_translate.c', 'r700_asm.c', 'evergreen_state.c', 'eg_asm.c', -- cgit v1.2.3 From 3ae04dd910d59dd2f044579f3e098b52fc577700 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 2 Nov 2010 12:35:23 +0000 Subject: scons: Add aliases for several pipe drivers. --- src/gallium/drivers/failover/SConscript | 2 ++ src/gallium/drivers/galahad/SConscript | 2 ++ src/gallium/drivers/i915/SConscript | 6 ++---- src/gallium/drivers/i965/SConscript | 4 ---- src/gallium/drivers/r300/SConscript | 2 ++ src/gallium/drivers/r600/SConscript | 2 ++ src/gallium/drivers/rbug/SConscript | 2 ++ src/gallium/drivers/trace/SConscript | 2 ++ 8 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/failover/SConscript b/src/gallium/drivers/failover/SConscript index f8e9b1b4911..9347431f4e5 100644 --- a/src/gallium/drivers/failover/SConscript +++ b/src/gallium/drivers/failover/SConscript @@ -10,4 +10,6 @@ failover = env.ConvenienceLibrary( 'fo_context.c', ]) +env.Alias('failover', failover) + Export('failover') diff --git a/src/gallium/drivers/galahad/SConscript b/src/gallium/drivers/galahad/SConscript index b398a3f0615..1343dfd4548 100644 --- a/src/gallium/drivers/galahad/SConscript +++ b/src/gallium/drivers/galahad/SConscript @@ -10,4 +10,6 @@ galahad = env.ConvenienceLibrary( 'glhd_screen.c', ]) +env.Alias('galahad', galahad) + Export('galahad') diff --git a/src/gallium/drivers/i915/SConscript b/src/gallium/drivers/i915/SConscript index 1197bbf9620..8f5deed64a9 100644 --- a/src/gallium/drivers/i915/SConscript +++ b/src/gallium/drivers/i915/SConscript @@ -2,10 +2,6 @@ Import('*') env = env.Clone() -if env['msvc']: - print 'warning: not building i915g' - Return() - i915 = env.ConvenienceLibrary( target = 'i915', source = [ @@ -34,4 +30,6 @@ i915 = env.ConvenienceLibrary( 'i915_resource_texture.c', ]) +env.Alias('i915', i915) + Export('i915') diff --git a/src/gallium/drivers/i965/SConscript b/src/gallium/drivers/i965/SConscript index 198275b655c..019af682f68 100644 --- a/src/gallium/drivers/i965/SConscript +++ b/src/gallium/drivers/i965/SConscript @@ -2,10 +2,6 @@ Import('*') env = env.Clone() -if env['msvc']: - print 'warning: not building i965g' - Return(); - i965 = env.ConvenienceLibrary( target = 'i965', source = [ diff --git a/src/gallium/drivers/r300/SConscript b/src/gallium/drivers/r300/SConscript index bf023daaa56..b49db937994 100644 --- a/src/gallium/drivers/r300/SConscript +++ b/src/gallium/drivers/r300/SConscript @@ -39,5 +39,7 @@ r300 = env.ConvenienceLibrary( 'r300_transfer.c', ] + r300compiler) + r300compiler +env.Alias('r300', r300) + Export('r300') diff --git a/src/gallium/drivers/r600/SConscript b/src/gallium/drivers/r600/SConscript index cdeec191398..3fc1fa94c27 100644 --- a/src/gallium/drivers/r600/SConscript +++ b/src/gallium/drivers/r600/SConscript @@ -33,4 +33,6 @@ r600 = env.ConvenienceLibrary( 'eg_asm.c', ]) +env.Alias('r600', r600) + Export('r600') diff --git a/src/gallium/drivers/rbug/SConscript b/src/gallium/drivers/rbug/SConscript index 3da6ac104a4..169c2718dc3 100644 --- a/src/gallium/drivers/rbug/SConscript +++ b/src/gallium/drivers/rbug/SConscript @@ -11,4 +11,6 @@ rbug = env.ConvenienceLibrary( 'rbug_screen.c', ]) +env.Alias('rbug', rbug) + Export('rbug') diff --git a/src/gallium/drivers/trace/SConscript b/src/gallium/drivers/trace/SConscript index 06b0c4863a4..1384fe33d72 100644 --- a/src/gallium/drivers/trace/SConscript +++ b/src/gallium/drivers/trace/SConscript @@ -12,4 +12,6 @@ trace = env.ConvenienceLibrary( 'tr_texture.c', ]) +env.Alias('trace', trace) + Export('trace') -- cgit v1.2.3 From 98445b43071414a6bd82d0618002611c6ad70257 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 2 Nov 2010 14:20:20 +0000 Subject: llvmpipe: avoid generating tri_16 for tris which extend past tile bounds Don't trim triangle bounding box to scissor/draw-region until after the logic for emitting tri_16. Don't generate tri_16 commands for triangles with untrimmed bounding boxes outside the current tile. This is important as the tri-16 itself can extend past tile bounds and we don't want to add code to it to check against tile bounds (slow) or restrict it to locations within a tile (pessimistic). --- src/gallium/drivers/llvmpipe/lp_setup_line.c | 15 ++++++++---- src/gallium/drivers/llvmpipe/lp_setup_tri.c | 34 ++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 14 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/llvmpipe/lp_setup_line.c b/src/gallium/drivers/llvmpipe/lp_setup_line.c index 827413bb33e..29c231714e1 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_line.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_line.c @@ -569,7 +569,10 @@ try_setup_line( struct lp_setup_context *setup, return TRUE; } - u_rect_find_intersection(&setup->draw_region, &bbox); + /* Can safely discard negative regions: + */ + bbox.x0 = MAX2(bbox.x0, 0); + bbox.y0 = MAX2(bbox.y0, 0); line = lp_setup_alloc_triangle(scene, key->num_inputs, @@ -680,24 +683,26 @@ try_setup_line( struct lp_setup_context *setup, * these planes elsewhere. */ if (nr_planes == 8) { + const struct u_rect *scissor = &setup->scissor; + plane[4].dcdx = -1; plane[4].dcdy = 0; - plane[4].c = 1-bbox.x0; + plane[4].c = 1-scissor->x0; plane[4].eo = 1; plane[5].dcdx = 1; plane[5].dcdy = 0; - plane[5].c = bbox.x1+1; + plane[5].c = scissor->x1+1; plane[5].eo = 0; plane[6].dcdx = 0; plane[6].dcdy = 1; - plane[6].c = 1-bbox.y0; + plane[6].c = 1-scissor->y0; plane[6].eo = 1; plane[7].dcdx = 0; plane[7].dcdy = -1; - plane[7].c = bbox.y1+1; + plane[7].c = scissor->y1+1; plane[7].eo = 0; } diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index 4ab0b72a574..11dfe639312 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -295,7 +295,12 @@ do_triangle_ccw(struct lp_setup_context *setup, return TRUE; } - u_rect_find_intersection(&setup->draw_region, &bbox); + /* Can safely discard negative regions, but need to keep hold of + * information about when the triangle extends past screen + * boundaries. See trimmed_box in lp_setup_bin_triangle(). + */ + bbox.x0 = MAX2(bbox.x0, 0); + bbox.y0 = MAX2(bbox.y0, 0); tri = lp_setup_alloc_triangle(scene, key->num_inputs, @@ -501,24 +506,26 @@ do_triangle_ccw(struct lp_setup_context *setup, * these planes elsewhere. */ if (nr_planes == 7) { + const struct u_rect *scissor = &setup->scissor; + plane[3].dcdx = -1; plane[3].dcdy = 0; - plane[3].c = 1-bbox.x0; + plane[3].c = 1-scissor->x0; plane[3].eo = 1; plane[4].dcdx = 1; plane[4].dcdy = 0; - plane[4].c = bbox.x1+1; + plane[4].c = scissor->x1+1; plane[4].eo = 0; plane[5].dcdx = 0; plane[5].dcdy = 1; - plane[5].c = 1-bbox.y0; + plane[5].c = 1-scissor->y0; plane[5].eo = 1; plane[6].dcdx = 0; plane[6].dcdy = -1; - plane[6].c = bbox.y1+1; + plane[6].c = scissor->y1+1; plane[6].eo = 0; } @@ -559,6 +566,7 @@ lp_setup_bin_triangle( struct lp_setup_context *setup, int nr_planes ) { struct lp_scene *scene = setup->scene; + struct u_rect trimmed_box = *bbox; int i; /* What is the largest power-of-two boundary this triangle crosses: @@ -572,6 +580,13 @@ lp_setup_bin_triangle( struct lp_setup_context *setup, int sz = floor_pot((bbox->x1 - (bbox->x0 & ~3)) | (bbox->y1 - (bbox->y0 & ~3))); + /* Now apply scissor, etc to the bounding box. Could do this + * earlier, but it confuses the logic for tri-16 and would force + * the rasterizer to also respect scissor, etc, just for the rare + * cases where a small triangle extends beyond the scissor. + */ + u_rect_find_intersection(&setup->draw_region, &trimmed_box); + /* Determine which tile(s) intersect the triangle's bounding box */ if (dx < TILE_SIZE) @@ -626,15 +641,16 @@ lp_setup_bin_triangle( struct lp_setup_context *setup, struct lp_rast_plane *plane = GET_PLANES(tri); int c[MAX_PLANES]; int ei[MAX_PLANES]; + int eo[MAX_PLANES]; int xstep[MAX_PLANES]; int ystep[MAX_PLANES]; int x, y; - int ix0 = bbox->x0 / TILE_SIZE; - int iy0 = bbox->y0 / TILE_SIZE; - int ix1 = bbox->x1 / TILE_SIZE; - int iy1 = bbox->y1 / TILE_SIZE; + int ix0 = trimmed_box.x0 / TILE_SIZE; + int iy0 = trimmed_box.y0 / TILE_SIZE; + int ix1 = trimmed_box.x1 / TILE_SIZE; + int iy1 = trimmed_box.y1 / TILE_SIZE; for (i = 0; i < nr_planes; i++) { c[i] = (plane[i].c + -- cgit v1.2.3 From debcb434891756573ed2dc102ad1b673a8dce7da Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 2 Nov 2010 12:05:46 +0000 Subject: llvmpipe: guard against NULL task->query pointer This doesn't seem like it should be possible, but some test suites manage to hit this case. Avoid crashing release builds under those circumstances. --- src/gallium/drivers/llvmpipe/lp_rast.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index d358a983943..decf3bd4499 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -485,8 +485,11 @@ static void lp_rast_end_query(struct lp_rasterizer_task *task, const union lp_rast_cmd_arg arg) { - task->query->count[task->thread_index] += task->vis_counter; - task->query = NULL; + assert(task->query); + if (task->query) { + task->query->count[task->thread_index] += task->vis_counter; + task->query = NULL; + } } -- cgit v1.2.3 From 8dfafbf0861fe3d2542332658dd5493851053c78 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 2 Nov 2010 16:29:10 +0000 Subject: st/mesa: unbind constant buffer when not in use Important as more constant buffers per shader start to get used. Fix up r600 (tested) and nv50 (untested) to cope with this. Drivers previously didn't see unbinds of constant buffers often or ever, so this isn't always dealt with cleanly. For r600 just return and keep the reference. Will try to do better in a followup change. --- src/gallium/drivers/nv50/nv50_shader_state.c | 3 +++ src/gallium/drivers/r600/r600_state.c | 7 +++++++ src/mesa/state_tracker/st_atom_constbuf.c | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/nv50/nv50_shader_state.c b/src/gallium/drivers/nv50/nv50_shader_state.c index 6c41e8f4561..306aa81d985 100644 --- a/src/gallium/drivers/nv50/nv50_shader_state.c +++ b/src/gallium/drivers/nv50/nv50_shader_state.c @@ -39,6 +39,9 @@ nv50_transfer_constbuf(struct nv50_context *nv50, uint32_t *map; unsigned count, start; + if (buf == NULL) + return; + map = pipe_buffer_map(pipe, buf, PIPE_TRANSFER_READ, &transfer); if (!map) return; diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index b3e0d493217..ccd74210b78 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -1018,6 +1018,13 @@ static void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx; struct r600_resource *rbuffer = (struct r600_resource*)buffer; + /* Note that the state tracker can unbind constant buffers by + * passing NULL here. + */ + if (buffer == NULL) { + return; + } + switch (shader) { case PIPE_SHADER_VERTEX: rctx->vs_const_buffer.nregs = 0; diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 6f9d71e845b..8d1dc792bc8 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -90,8 +90,11 @@ void st_upload_constants( struct st_context *st, st->pipe->set_constant_buffer(st->pipe, shader_type, 0, *cbuf); } - else { + else if (*cbuf) { st->constants.tracked_state[shader_type].dirty.mesa = 0x0; + + pipe_resource_reference(cbuf, NULL); + st->pipe->set_constant_buffer(st->pipe, shader_type, 0, NULL); } } -- cgit v1.2.3 From 9fbf744389cc13e96324086a1a94afbac933e6ea Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 2 Nov 2010 11:49:10 -0600 Subject: llvmpipe: assign context's frag shader pointer before using it The call to draw_bind_fragment_shader() was using the old fragment shader. This bug would have really only effected the draw module's use of the fragment shader in the wide point stage. --- src/gallium/drivers/llvmpipe/lp_state_fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index e4495e33d09..1b3c32f040f 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -1062,11 +1062,11 @@ llvmpipe_bind_fs_state(struct pipe_context *pipe, void *fs) draw_flush(llvmpipe->draw); + llvmpipe->fs = fs; + draw_bind_fragment_shader(llvmpipe->draw, (llvmpipe->fs ? llvmpipe->fs->draw_data : NULL)); - llvmpipe->fs = fs; - llvmpipe->dirty |= LP_NEW_FS; } -- cgit v1.2.3 From 2996ce72b142c774101f8df8bd6050d4755ccdcc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 2 Nov 2010 11:53:14 -0600 Subject: llvmpipe: add a cast --- src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 1b3c32f040f..48971510f21 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -1062,7 +1062,7 @@ llvmpipe_bind_fs_state(struct pipe_context *pipe, void *fs) draw_flush(llvmpipe->draw); - llvmpipe->fs = fs; + llvmpipe->fs = (struct lp_fragment_shader *) fs; draw_bind_fragment_shader(llvmpipe->draw, (llvmpipe->fs ? llvmpipe->fs->draw_data : NULL)); -- cgit v1.2.3 From c49dcaef65296dd51d374d3f903734c46b601b2d Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sat, 30 Oct 2010 17:32:24 +0200 Subject: r600g: We don't support PIPE_CAP_PRIMITIVE_RESTART. Signed-off-by: Tilman Sauerbeck --- src/gallium/drivers/r600/r600_pipe.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 35645398437..d25de556644 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -273,6 +273,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param) /* Unsupported features (boolean caps). */ case PIPE_CAP_TIMER_QUERY: case PIPE_CAP_STREAM_OUTPUT: + case PIPE_CAP_PRIMITIVE_RESTART: case PIPE_CAP_INDEP_BLEND_FUNC: /* FIXME allow this */ return 0; -- cgit v1.2.3 From ecb1b8b98f7b2464e29e56a1f1bf87f74129ac08 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sun, 31 Oct 2010 12:16:03 +0100 Subject: r600g: Delete custom_dsa_flush on shutdown. Signed-off-by: Tilman Sauerbeck --- src/gallium/drivers/r600/r600_pipe.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index d25de556644..952c7f6b87f 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -77,6 +77,8 @@ static void r600_destroy_context(struct pipe_context *context) { struct r600_pipe_context *rctx = (struct r600_pipe_context *)context; + rctx->context.delete_depth_stencil_alpha_state(&rctx->context, rctx->custom_dsa_flush); + r600_context_fini(&rctx->ctx); for (int i = 0; i < R600_PIPE_NSTATES; i++) { free(rctx->states[i]); -- cgit v1.2.3 From 52ba68d0b071620c891122d8049ec77568aa8d19 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sun, 31 Oct 2010 15:51:55 +0100 Subject: r600g: Destroy the winsys in r600_destroy_screen(). Signed-off-by: Tilman Sauerbeck --- src/gallium/drivers/r600/r600_pipe.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 952c7f6b87f..55370f06fd8 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -431,6 +431,9 @@ static void r600_destroy_screen(struct pipe_screen* pscreen) if (rscreen == NULL) return; + + radeon_decref(rscreen->radeon); + FREE(rscreen); } -- cgit v1.2.3 From 14c0bbf469642722f86df315b9f85d23f9753956 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 15 Oct 2010 14:44:30 +0100 Subject: r600g: propagate usage flags in texture transfers --- src/gallium/drivers/r600/r600_texture.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 4ebd5b754b3..7222b43af65 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -31,6 +31,7 @@ #include #include #include "state_tracker/drm_driver.h" +#include "pipebuffer/pb_buffer.h" #include "r600_pipe.h" #include "r600_resource.h" #include "r600_state_inlines.h" @@ -537,6 +538,7 @@ void* r600_texture_transfer_map(struct pipe_context *ctx, enum pipe_format format = transfer->resource->format; struct radeon *radeon = (struct radeon *)ctx->screen->winsys; unsigned offset = 0; + unsigned usage = 0; char *map; if (rtransfer->linear_texture) { @@ -553,7 +555,30 @@ void* r600_texture_transfer_map(struct pipe_context *ctx, transfer->box.y / util_format_get_blockheight(format) * transfer->stride + transfer->box.x / util_format_get_blockwidth(format) * util_format_get_blocksize(format); } - map = r600_bo_map(radeon, bo, 0, ctx); + + if (transfer->usage & PIPE_TRANSFER_WRITE) { + usage |= PB_USAGE_CPU_WRITE; + + if (transfer->usage & PIPE_TRANSFER_DISCARD) { + } + + if (transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT) { + } + } + + if (transfer->usage & PIPE_TRANSFER_READ) { + usage |= PB_USAGE_CPU_READ; + } + + if (transfer->usage & PIPE_TRANSFER_DONTBLOCK) { + usage |= PB_USAGE_DONTBLOCK; + } + + if (transfer->usage & PIPE_TRANSFER_UNSYNCHRONIZED) { + usage |= PB_USAGE_UNSYNCHRONIZED; + } + + map = r600_bo_map(radeon, bo, usage, ctx); if (!map) { return NULL; } -- cgit v1.2.3 From 29c4a15bf61a76cd71ffa5b8f09706d0eab84281 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 2 Nov 2010 17:47:06 +0000 Subject: r600g: propogate resource usage flags to winsys, use to choose bo domains This opens the question of what interface the winsys layer should really have for talking about these concepts. For now I'm using the existing gallium resource usage concept, but there is no reason not use terms closer to what the hardware understands - eg. the domains themselves. --- src/gallium/drivers/r600/r600.h | 3 ++- src/gallium/drivers/r600/r600_buffer.c | 7 ++++--- src/gallium/drivers/r600/r600_shader.c | 2 +- src/gallium/drivers/r600/r600_texture.c | 2 +- src/gallium/winsys/r600/drm/r600_bo.c | 24 +++++++++++++++++++++--- src/gallium/winsys/r600/drm/r600_hw_context.c | 13 +++++++++---- src/gallium/winsys/r600/drm/r600_priv.h | 1 + 7 files changed, 39 insertions(+), 13 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h index 62d983269f5..5ec607bbd85 100644 --- a/src/gallium/drivers/r600/r600.h +++ b/src/gallium/drivers/r600/r600.h @@ -112,7 +112,8 @@ struct r600_tiling_info *r600_get_tiling_info(struct radeon *radeon); /* r600_bo.c */ struct r600_bo; struct r600_bo *r600_bo(struct radeon *radeon, - unsigned size, unsigned alignment, unsigned usage); + unsigned size, unsigned alignment, + unsigned binding, unsigned usage); struct r600_bo *r600_bo_handle(struct radeon *radeon, unsigned handle, unsigned *array_mode); void *r600_bo_map(struct radeon *radeon, struct r600_bo *bo, unsigned usage, void *ctx); diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c index 455aa2e81f6..3c45d782a2c 100644 --- a/src/gallium/drivers/r600/r600_buffer.c +++ b/src/gallium/drivers/r600/r600_buffer.c @@ -86,7 +86,7 @@ struct pipe_resource *r600_buffer_create(struct pipe_screen *screen, rbuffer->r.base.vtbl = &r600_buffer_vtbl; rbuffer->r.size = rbuffer->r.base.b.width0; rbuffer->r.domain = r600_domain_from_usage(rbuffer->r.base.b.bind); - bo = r600_bo((struct radeon*)screen->winsys, rbuffer->r.base.b.width0, alignment, rbuffer->r.base.b.bind); + bo = r600_bo((struct radeon*)screen->winsys, rbuffer->r.base.b.width0, alignment, rbuffer->r.base.b.bind, rbuffer->r.base.b.usage); if (bo == NULL) { FREE(rbuffer); return NULL; @@ -156,8 +156,9 @@ static void *r600_buffer_transfer_map(struct pipe_context *pipe, r600_bo_reference((struct radeon*)pipe->winsys, &rbuffer->r.bo, NULL); rbuffer->num_ranges = 0; rbuffer->r.bo = r600_bo((struct radeon*)pipe->winsys, - rbuffer->r.base.b.width0, 0, - rbuffer->r.base.b.bind); + rbuffer->r.base.b.width0, 0, + rbuffer->r.base.b.bind, + rbuffer->r.base.b.usage); break; } } diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 4106587398b..1a0b35d9bf5 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -218,7 +218,7 @@ static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *s /* copy new shader */ if (shader->bo == NULL) { - shader->bo = r600_bo(rctx->radeon, rshader->bc.ndw * 4, 4096, 0); + shader->bo = r600_bo(rctx->radeon, rshader->bc.ndw * 4, 4096, 0, 0); if (shader->bo == NULL) { return -ENOMEM; } diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 7222b43af65..9a52cfa46e2 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -294,7 +294,7 @@ r600_texture_create_object(struct pipe_screen *screen, resource->size = rtex->size; if (!resource->bo) { - resource->bo = r600_bo(radeon, rtex->size, 4096, 0); + resource->bo = r600_bo(radeon, rtex->size, 4096, base->bind, base->usage); if (!resource->bo) { FREE(rtex); return NULL; diff --git a/src/gallium/winsys/r600/drm/r600_bo.c b/src/gallium/winsys/r600/drm/r600_bo.c index 7d54ff18fc2..9b9aec5f64c 100644 --- a/src/gallium/winsys/r600/drm/r600_bo.c +++ b/src/gallium/winsys/r600/drm/r600_bo.c @@ -29,23 +29,37 @@ #include "radeon_drm.h" #include "r600_priv.h" #include "r600d.h" +#include "radeon_drm.h" struct r600_bo *r600_bo(struct radeon *radeon, - unsigned size, unsigned alignment, unsigned usage) + unsigned size, unsigned alignment, + unsigned binding, unsigned usage) { struct r600_bo *ws_bo = calloc(1, sizeof(struct r600_bo)); struct pb_desc desc; struct pb_manager *man; desc.alignment = alignment; - desc.usage = usage; + desc.usage = (PB_USAGE_CPU_READ_WRITE | PB_USAGE_GPU_READ_WRITE); ws_bo->size = size; - if (usage & (PIPE_BIND_CONSTANT_BUFFER | PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER)) + if (binding & (PIPE_BIND_CONSTANT_BUFFER | PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER)) man = radeon->cman; else man = radeon->kman; + /* Staging resources particpate in transfers and blits only + * and are used for uploads and downloads from regular + * resources. We generate them internally for some transfers. + */ + if (usage == PIPE_USAGE_STAGING) + ws_bo->domains = RADEON_GEM_DOMAIN_CPU | RADEON_GEM_DOMAIN_GTT; + else + ws_bo->domains = (RADEON_GEM_DOMAIN_CPU | + RADEON_GEM_DOMAIN_GTT | + RADEON_GEM_DOMAIN_VRAM); + + ws_bo->pb = man->create_buffer(man, size, &desc); if (ws_bo->pb == NULL) { free(ws_bo); @@ -69,6 +83,10 @@ struct r600_bo *r600_bo_handle(struct radeon *radeon, } bo = radeon_bo_pb_get_bo(ws_bo->pb); ws_bo->size = bo->size; + ws_bo->domains = (RADEON_GEM_DOMAIN_CPU | + RADEON_GEM_DOMAIN_GTT | + RADEON_GEM_DOMAIN_VRAM); + pipe_reference_init(&ws_bo->reference, 1); radeon_bo_get_tiling_flags(radeon, bo, &ws_bo->tiling_flags, diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c index 82d5deaad28..8b4521b86cd 100644 --- a/src/gallium/winsys/r600/drm/r600_hw_context.c +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c @@ -44,7 +44,7 @@ int r600_context_init_fence(struct r600_context *ctx) { ctx->fence = 1; - ctx->fence_bo = r600_bo(ctx->radeon, 4096, 0, 0); + ctx->fence_bo = r600_bo(ctx->radeon, 4096, 0, 0, 0); if (ctx->fence_bo == NULL) { return -ENOMEM; } @@ -787,8 +787,8 @@ void r600_context_bo_reloc(struct r600_context *ctx, u32 *pm4, struct r600_bo *r bo->reloc = &ctx->reloc[ctx->creloc]; bo->reloc_id = ctx->creloc * sizeof(struct r600_reloc) / 4; ctx->reloc[ctx->creloc].handle = bo->handle; - ctx->reloc[ctx->creloc].read_domain = RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM; - ctx->reloc[ctx->creloc].write_domain = RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM; + ctx->reloc[ctx->creloc].read_domain = rbo->domains & (RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM); + ctx->reloc[ctx->creloc].write_domain = rbo->domains & (RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM); ctx->reloc[ctx->creloc].flags = 0; radeon_bo_reference(ctx->radeon, &ctx->bo[ctx->creloc], bo); ctx->creloc++; @@ -1306,7 +1306,12 @@ struct r600_query *r600_context_query_create(struct r600_context *ctx, unsigned query->type = query_type; query->buffer_size = 4096; - query->buffer = r600_bo(ctx->radeon, query->buffer_size, 1, 0); + /* As of GL4, query buffers are normally read by the CPU after + * being written by the gpu, hence staging is probably a good + * usage pattern. + */ + query->buffer = r600_bo(ctx->radeon, query->buffer_size, 1, 0, + PIPE_USAGE_STAGING); if (!query->buffer) { free(query); return NULL; diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h index efecfebc2b1..97c582397a7 100644 --- a/src/gallium/winsys/r600/drm/r600_priv.h +++ b/src/gallium/winsys/r600/drm/r600_priv.h @@ -79,6 +79,7 @@ struct r600_bo { unsigned size; unsigned tiling_flags; unsigned kernel_pitch; + unsigned domains; }; -- cgit v1.2.3 From d4fab99c1c20334131b446b0032303a8b3c5c1a1 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 2 Nov 2010 17:51:34 +0000 Subject: r600g: use a buffer in GTT as intermediate on texture up and downloads Generalize the existing tiled_buffer path in texture transfers for use in some non-tiled up and downloads. Use a staging buffer, which the winsys will restrict to GTT memory. GTT buffers have the major advantage when they are mapped, they are cachable, which is a very nice property for downloads, usually the CPU will want to do look at the data it downloaded. --- src/gallium/drivers/r600/r600_resource.h | 2 +- src/gallium/drivers/r600/r600_texture.c | 85 +++++++++++++++++++++++--------- 2 files changed, 64 insertions(+), 23 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_resource.h b/src/gallium/drivers/r600/r600_resource.h index d152285815c..d24d5a102dd 100644 --- a/src/gallium/drivers/r600/r600_resource.h +++ b/src/gallium/drivers/r600/r600_resource.h @@ -35,7 +35,7 @@ struct r600_transfer { /* Buffer transfer. */ struct pipe_transfer *buffer_transfer; unsigned offset; - struct pipe_resource *linear_texture; + struct pipe_resource *staging_texture; }; /* This gets further specialized into either buffer or texture diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 9a52cfa46e2..8fbe4a04879 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -40,8 +40,8 @@ extern struct u_resource_vtbl r600_texture_vtbl; -/* Copy from a tiled texture to a detiled one. */ -static void r600_copy_from_tiled_texture(struct pipe_context *ctx, struct r600_transfer *rtransfer) +/* Copy from a full GPU texture to a transfer's staging one. */ +static void r600_copy_to_staging_texture(struct pipe_context *ctx, struct r600_transfer *rtransfer) { struct pipe_transfer *transfer = (struct pipe_transfer*)rtransfer; struct pipe_resource *texture = transfer->resource; @@ -49,15 +49,15 @@ static void r600_copy_from_tiled_texture(struct pipe_context *ctx, struct r600_t subdst.face = 0; subdst.level = 0; - ctx->resource_copy_region(ctx, rtransfer->linear_texture, + ctx->resource_copy_region(ctx, rtransfer->staging_texture, subdst, 0, 0, 0, texture, transfer->sr, transfer->box.x, transfer->box.y, transfer->box.z, transfer->box.width, transfer->box.height); } -/* Copy from a detiled texture to a tiled one. */ -static void r600_copy_into_tiled_texture(struct pipe_context *ctx, struct r600_transfer *rtransfer) +/* Copy from a transfer's staging texture to a full GPU one. */ +static void r600_copy_from_staging_texture(struct pipe_context *ctx, struct r600_transfer *rtransfer) { struct pipe_transfer *transfer = (struct pipe_transfer*)rtransfer; struct pipe_resource *texture = transfer->resource; @@ -67,7 +67,7 @@ static void r600_copy_into_tiled_texture(struct pipe_context *ctx, struct r600_t subsrc.level = 0; ctx->resource_copy_region(ctx, texture, transfer->sr, transfer->box.x, transfer->box.y, transfer->box.z, - rtransfer->linear_texture, subsrc, + rtransfer->staging_texture, subsrc, 0, 0, 0, transfer->box.width, transfer->box.height); @@ -435,10 +435,20 @@ int r600_texture_depth_flush(struct pipe_context *ctx, } out: + /* XXX: only do this if the depth texture has actually changed: + */ r600_blit_uncompress_depth_ptr(ctx, rtex); return 0; } +/* Needs adjustment for pixelformat: + */ +static INLINE unsigned u_box_volume( const struct pipe_box *box ) +{ + return box->width * box->depth * box->height; +}; + + struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, struct pipe_resource *texture, struct pipe_subresource sr, @@ -449,6 +459,35 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, struct pipe_resource resource; struct r600_transfer *trans; int r; + boolean use_staging_texture = FALSE; + boolean discard = FALSE; + + if (!(usage & PIPE_TRANSFER_READ) && (usage & PIPE_TRANSFER_DISCARD)) + discard = TRUE; + + /* We cannot map a tiled texture directly because the data is + * in a different order, therefore we do detiling using a blit. + * + * Also, use a temporary in GTT memory for read transfers, as + * the CPU is much happier reading out of cached system memory + * than uncached VRAM. + */ + if (rtex->tiled) + use_staging_texture = TRUE; + + if (usage & PIPE_TRANSFER_READ && + u_box_volume(box) > 1024) + use_staging_texture = TRUE; + + /* XXX: Use a staging texture for uploads if the underlying BO + * is busy. No interface for checking that currently? so do + * it eagerly whenever the transfer doesn't require a readback + * and might block. + */ + if ((usage & PIPE_TRANSFER_WRITE) && + discard && + !(usage & (PIPE_TRANSFER_DONTBLOCK | PIPE_TRANSFER_UNSYNCHRONIZED))) + use_staging_texture = TRUE; trans = CALLOC_STRUCT(r600_transfer); if (trans == NULL) @@ -458,6 +497,10 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, trans->transfer.usage = usage; trans->transfer.box = *box; if (rtex->depth) { + /* XXX: only readback the rectangle which is being mapped? + */ + /* XXX: when discard is true, no need to read back from depth texture + */ r = r600_texture_depth_flush(ctx, texture); if (r < 0) { R600_ERR("failed to create temporary texture to hold untiled copy\n"); @@ -465,7 +508,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, FREE(trans); return NULL; } - } else if (rtex->tiled) { + } else if (use_staging_texture) { resource.target = PIPE_TEXTURE_2D; resource.format = texture->format; resource.width0 = box->width; @@ -473,7 +516,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, resource.depth0 = 1; resource.last_level = 0; resource.nr_samples = 0; - resource.usage = PIPE_USAGE_DYNAMIC; + resource.usage = PIPE_USAGE_STAGING; resource.bind = 0; resource.flags = R600_RESOURCE_FLAG_TRANSFER; /* For texture reading, the temporary (detiled) texture is used as @@ -487,8 +530,8 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, resource.bind |= PIPE_BIND_SAMPLER_VIEW; } /* Create the temporary texture. */ - trans->linear_texture = ctx->screen->resource_create(ctx->screen, &resource); - if (trans->linear_texture == NULL) { + trans->staging_texture = ctx->screen->resource_create(ctx->screen, &resource); + if (trans->staging_texture == NULL) { R600_ERR("failed to create temporary texture to hold untiled copy\n"); pipe_resource_reference(&trans->transfer.resource, NULL); FREE(trans); @@ -496,11 +539,9 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, } trans->transfer.stride = - ((struct r600_resource_texture *)trans->linear_texture)->pitch_in_bytes[0]; - if (usage & PIPE_TRANSFER_READ) { - /* We cannot map a tiled texture directly because the data is - * in a different order, therefore we do detiling using a blit. */ - r600_copy_from_tiled_texture(ctx, trans); + ((struct r600_resource_texture *)trans->staging_texture)->pitch_in_bytes[0]; + if (!discard) { + r600_copy_to_staging_texture(ctx, trans); /* Always referenced in the blit. */ ctx->flush(ctx, 0, NULL); } @@ -517,11 +558,11 @@ void r600_texture_transfer_destroy(struct pipe_context *ctx, struct r600_transfer *rtransfer = (struct r600_transfer*)transfer; struct r600_resource_texture *rtex = (struct r600_resource_texture*)transfer->resource; - if (rtransfer->linear_texture) { + if (rtransfer->staging_texture) { if (transfer->usage & PIPE_TRANSFER_WRITE) { - r600_copy_into_tiled_texture(ctx, rtransfer); + r600_copy_from_staging_texture(ctx, rtransfer); } - pipe_resource_reference(&rtransfer->linear_texture, NULL); + pipe_resource_reference(&rtransfer->staging_texture, NULL); } if (rtex->flushed_depth_texture) { pipe_resource_reference((struct pipe_resource **)&rtex->flushed_depth_texture, NULL); @@ -541,8 +582,8 @@ void* r600_texture_transfer_map(struct pipe_context *ctx, unsigned usage = 0; char *map; - if (rtransfer->linear_texture) { - bo = ((struct r600_resource *)rtransfer->linear_texture)->bo; + if (rtransfer->staging_texture) { + bo = ((struct r600_resource *)rtransfer->staging_texture)->bo; } else { struct r600_resource_texture *rtex = (struct r600_resource_texture*)transfer->resource; @@ -593,8 +634,8 @@ void r600_texture_transfer_unmap(struct pipe_context *ctx, struct radeon *radeon = (struct radeon *)ctx->screen->winsys; struct r600_bo *bo; - if (rtransfer->linear_texture) { - bo = ((struct r600_resource *)rtransfer->linear_texture)->bo; + if (rtransfer->staging_texture) { + bo = ((struct r600_resource *)rtransfer->staging_texture)->bo; } else { struct r600_resource_texture *rtex = (struct r600_resource_texture*)transfer->resource; -- cgit v1.2.3 From 7b120ceac8738b73dcffe4d39e3e32b473dea3cf Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 2 Nov 2010 15:49:44 +0000 Subject: r600g: remove unused flink, domain fields from r600_resource These were being set but not used anywhere. --- src/gallium/drivers/r600/r600_buffer.c | 27 --------------------------- src/gallium/drivers/r600/r600_resource.h | 5 ----- src/gallium/drivers/r600/r600_texture.c | 1 - 3 files changed, 33 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c index 3c45d782a2c..ed97b6e69a3 100644 --- a/src/gallium/drivers/r600/r600_buffer.c +++ b/src/gallium/drivers/r600/r600_buffer.c @@ -38,32 +38,6 @@ extern struct u_resource_vtbl r600_buffer_vtbl; -u32 r600_domain_from_usage(unsigned usage) -{ - u32 domain = RADEON_GEM_DOMAIN_GTT; - - if (usage & PIPE_BIND_RENDER_TARGET) { - domain |= RADEON_GEM_DOMAIN_VRAM; - } - if (usage & PIPE_BIND_DEPTH_STENCIL) { - domain |= RADEON_GEM_DOMAIN_VRAM; - } - if (usage & PIPE_BIND_SAMPLER_VIEW) { - domain |= RADEON_GEM_DOMAIN_VRAM; - } - /* also need BIND_BLIT_SOURCE/DESTINATION ? */ - if (usage & PIPE_BIND_VERTEX_BUFFER) { - domain |= RADEON_GEM_DOMAIN_GTT; - } - if (usage & PIPE_BIND_INDEX_BUFFER) { - domain |= RADEON_GEM_DOMAIN_GTT; - } - if (usage & PIPE_BIND_CONSTANT_BUFFER) { - domain |= RADEON_GEM_DOMAIN_VRAM; - } - - return domain; -} struct pipe_resource *r600_buffer_create(struct pipe_screen *screen, const struct pipe_resource *templ) @@ -85,7 +59,6 @@ struct pipe_resource *r600_buffer_create(struct pipe_screen *screen, rbuffer->r.base.b.screen = screen; rbuffer->r.base.vtbl = &r600_buffer_vtbl; rbuffer->r.size = rbuffer->r.base.b.width0; - rbuffer->r.domain = r600_domain_from_usage(rbuffer->r.base.b.bind); bo = r600_bo((struct radeon*)screen->winsys, rbuffer->r.base.b.width0, alignment, rbuffer->r.base.b.bind, rbuffer->r.base.b.usage); if (bo == NULL) { FREE(rbuffer); diff --git a/src/gallium/drivers/r600/r600_resource.h b/src/gallium/drivers/r600/r600_resource.h index d24d5a102dd..7a2d1f44122 100644 --- a/src/gallium/drivers/r600/r600_resource.h +++ b/src/gallium/drivers/r600/r600_resource.h @@ -45,8 +45,6 @@ struct r600_transfer { struct r600_resource { struct u_resource base; struct r600_bo *bo; - u32 domain; - u32 flink; u32 size; }; @@ -68,9 +66,6 @@ struct r600_resource_texture { void r600_init_screen_resource_functions(struct pipe_screen *screen); -/* r600_buffer */ -u32 r600_domain_from_usage(unsigned usage); - /* r600_texture */ struct pipe_resource *r600_texture_create(struct pipe_screen *screen, const struct pipe_resource *templ); diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 8fbe4a04879..c92f6340047 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -284,7 +284,6 @@ r600_texture_create_object(struct pipe_screen *screen, pipe_reference_init(&resource->base.b.reference, 1); resource->base.b.screen = screen; resource->bo = bo; - resource->domain = r600_domain_from_usage(resource->base.b.bind); rtex->pitch_override = pitch_in_bytes_override; if (array_mode) -- cgit v1.2.3 From c3974dc837b4a11a30603bb00fa1d346e721af59 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sun, 17 Oct 2010 11:45:49 -0700 Subject: r600g: set hardware pixel centers according to gl_rasterization_rules These were previously being left in the default (D3D) mode. This mean that triangles were drawn slightly incorrectly, but also because this state is relied on by the u_blitter code, all blits were half a pixel off. --- src/gallium/drivers/r600/r600_state.c | 5 +++++ src/gallium/drivers/r600/r600d.h | 4 ++++ src/gallium/winsys/r600/drm/r600_hw_context.c | 1 + src/gallium/winsys/r600/drm/r600d.h | 1 + 4 files changed, 11 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index ccd74210b78..17e64b18e97 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -475,6 +475,11 @@ static void *r600_create_rs_state(struct pipe_context *ctx, r600_pipe_state_add_reg(rstate, R_028A0C_PA_SC_LINE_STIPPLE, 0x00000005, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028A48_PA_SC_MPASS_PS_CNTL, 0x00000000, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028C00_PA_SC_LINE_CNTL, 0x00000400, 0xFFFFFFFF, NULL); + + r600_pipe_state_add_reg(rstate, R_028C08_PA_SU_VTX_CNTL, + S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules), + 0xFFFFFFFF, NULL); + r600_pipe_state_add_reg(rstate, R_028C0C_PA_CL_GB_VERT_CLIP_ADJ, 0x3F800000, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028C10_PA_CL_GB_VERT_DISC_ADJ, 0x3F800000, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028C14_PA_CL_GB_HORZ_CLIP_ADJ, 0x3F800000, 0xFFFFFFFF, NULL); diff --git a/src/gallium/drivers/r600/r600d.h b/src/gallium/drivers/r600/r600d.h index a3cb5b86004..ae19bfb8285 100644 --- a/src/gallium/drivers/r600/r600d.h +++ b/src/gallium/drivers/r600/r600d.h @@ -2100,6 +2100,10 @@ #define G_028C00_LAST_PIXEL(x) (((x) >> 10) & 0x1) #define C_028C00_LAST_PIXEL 0xFFFFFBFF #define R_028C04_PA_SC_AA_CONFIG 0x028C04 +#define R_028C08_PA_SU_VTX_CNTL 0x028C08 +#define S_028C08_PIX_CENTER_HALF(x) (((x) & 0x1) << 0) +#define G_028C08_PIX_CENTER_HALF(x) (((x) >> 0) & 0x1) +#define C_028C08_PIX_CENTER_HALF 0xFFFFFFFE #define R_028C1C_PA_SC_AA_SAMPLE_LOCS_MCTX 0x028C1C #define R_028C48_PA_SC_AA_MASK 0x028C48 #define R_028810_PA_CL_CLIP_CNTL 0x028810 diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c index 8b4521b86cd..bcbe71e1267 100644 --- a/src/gallium/winsys/r600/drm/r600_hw_context.c +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c @@ -384,6 +384,7 @@ static const struct r600_reg r600_context_reg_list[] = { {PKT3_SET_CONTEXT_REG, R600_CONTEXT_REG_OFFSET, R_028A0C_PA_SC_LINE_STIPPLE, 0, 0, 0}, {PKT3_SET_CONTEXT_REG, R600_CONTEXT_REG_OFFSET, R_028A48_PA_SC_MPASS_PS_CNTL, 0, 0, 0}, {PKT3_SET_CONTEXT_REG, R600_CONTEXT_REG_OFFSET, R_028C00_PA_SC_LINE_CNTL, 0, 0, 0}, + {PKT3_SET_CONTEXT_REG, R600_CONTEXT_REG_OFFSET, R_028C08_PA_SU_VTX_CNTL, 0, 0, 0}, {PKT3_SET_CONTEXT_REG, R600_CONTEXT_REG_OFFSET, R_028C0C_PA_CL_GB_VERT_CLIP_ADJ, 0, 0, 0}, {PKT3_SET_CONTEXT_REG, R600_CONTEXT_REG_OFFSET, R_028C10_PA_CL_GB_VERT_DISC_ADJ, 0, 0, 0}, {PKT3_SET_CONTEXT_REG, R600_CONTEXT_REG_OFFSET, R_028C14_PA_CL_GB_HORZ_CLIP_ADJ, 0, 0, 0}, diff --git a/src/gallium/winsys/r600/drm/r600d.h b/src/gallium/winsys/r600/drm/r600d.h index d91f7737af3..5ca7456e906 100644 --- a/src/gallium/winsys/r600/drm/r600d.h +++ b/src/gallium/winsys/r600/drm/r600d.h @@ -795,6 +795,7 @@ #define R_028A48_PA_SC_MPASS_PS_CNTL 0x028A48 #define R_028C00_PA_SC_LINE_CNTL 0x028C00 #define R_028C04_PA_SC_AA_CONFIG 0x028C04 +#define R_028C08_PA_SU_VTX_CNTL 0x028C08 #define R_028C1C_PA_SC_AA_SAMPLE_LOCS_MCTX 0x028C1C #define R_028C48_PA_SC_AA_MASK 0x028C48 #define R_028810_PA_CL_CLIP_CNTL 0x028810 -- cgit v1.2.3 From b3462601cb69f277b9aafc2ee5179a0c2cf6cbcd Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 3 Nov 2010 10:24:28 +0000 Subject: evergreeng: protect against null constant buffers Should do better than this and actually unbind the buffer, but haven't yet gotten it to work. --- src/gallium/drivers/r600/evergreen_state.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 72223485067..ce8e93a1d25 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -826,6 +826,13 @@ static void evergreen_set_constant_buffer(struct pipe_context *ctx, uint shader, struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx; struct r600_resource *rbuffer = (struct r600_resource*)buffer; + /* Note that the state tracker can unbind constant buffers by + * passing NULL here. + */ + if (buffer == NULL) { + return; + } + switch (shader) { case PIPE_SHADER_VERTEX: rctx->vs_const_buffer.nregs = 0; -- cgit v1.2.3 From ee07e0e39ad1c4d13d540b23220fecc564d07b16 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 3 Nov 2010 10:31:55 +0000 Subject: r600g: don't call debug_get_bool_option for tiling more than once --- src/gallium/drivers/r600/r600_texture.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index c92f6340047..a63990fbffe 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -306,8 +306,14 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen, const struct pipe_resource *templ) { unsigned array_mode = 0; + static int force_tiling = -1; - if (debug_get_bool_option("R600_FORCE_TILING", FALSE)) { + /* Would like some magic "get_bool_option_once" routine. + */ + if (force_tiling == -1) + force_tiling = debug_get_bool_option("R600_FORCE_TILING", FALSE); + + if (force_tiling) { if (!(templ->flags & R600_RESOURCE_FLAG_TRANSFER) && !(templ->bind & PIPE_BIND_SCANOUT)) { array_mode = V_038000_ARRAY_2D_TILED_THIN1; -- cgit v1.2.3 From d6b6a0bc170bd61abbbe9cb6ba777c7192dbd018 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 1 Nov 2010 14:19:18 +0000 Subject: evergreeng: respect linewidth state, use integer widths only Discard fractional bits from linewidth. This matches the nvidia closed drivers, my reading of the OpenGL SI and current llvmpipe behaviour. It looks a lot nicer & avoids ugliness where lines alternate between n and n+1 pixels in width along their length. Also fix up r600g to match. --- src/gallium/drivers/r600/evergreen_state.c | 5 ++++- src/gallium/drivers/r600/evergreend.h | 3 +++ src/gallium/drivers/r600/r600_state.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index ce8e93a1d25..7dd261d7e23 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -281,7 +281,10 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx, tmp = (unsigned)(state->point_size * 8.0); r600_pipe_state_add_reg(rstate, R_028A00_PA_SU_POINT_SIZE, S_028A00_HEIGHT(tmp) | S_028A00_WIDTH(tmp), 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028A04_PA_SU_POINT_MINMAX, 0x80000000, 0xFFFFFFFF, NULL); - r600_pipe_state_add_reg(rstate, R_028A08_PA_SU_LINE_CNTL, 0x00000008, 0xFFFFFFFF, NULL); + + tmp = (unsigned)state->line_width * 8; + r600_pipe_state_add_reg(rstate, R_028A08_PA_SU_LINE_CNTL, S_028A08_WIDTH(tmp), 0xFFFFFFFF, NULL); + r600_pipe_state_add_reg(rstate, R_028C00_PA_SC_LINE_CNTL, 0x00000400, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028C0C_PA_CL_GB_VERT_CLIP_ADJ, 0x3F800000, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028C10_PA_CL_GB_VERT_DISC_ADJ, 0x3F800000, 0xFFFFFFFF, NULL); diff --git a/src/gallium/drivers/r600/evergreend.h b/src/gallium/drivers/r600/evergreend.h index 8e96f9355e6..7e7bd01291d 100644 --- a/src/gallium/drivers/r600/evergreend.h +++ b/src/gallium/drivers/r600/evergreend.h @@ -1636,6 +1636,9 @@ #define R_028980_ALU_CONST_CACHE_VS_0 0x00028980 #define R_028A04_PA_SU_POINT_MINMAX 0x00028A04 #define R_028A08_PA_SU_LINE_CNTL 0x00028A08 +#define S_028A08_WIDTH(x) (((x) & 0xFFFF) << 0) +#define G_028A08_WIDTH(x) (((x) >> 0) & 0xFFFF) +#define C_028A08_WIDTH 0xFFFF0000 #define R_028A10_VGT_OUTPUT_PATH_CNTL 0x00028A10 #define R_028A14_VGT_HOS_CNTL 0x00028A14 #define R_028A18_VGT_HOS_MAX_TESS_LEVEL 0x00028A18 diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 17e64b18e97..54cc79b1549 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -469,7 +469,7 @@ static void *r600_create_rs_state(struct pipe_context *ctx, r600_pipe_state_add_reg(rstate, R_028A00_PA_SU_POINT_SIZE, S_028A00_HEIGHT(tmp) | S_028A00_WIDTH(tmp), 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028A04_PA_SU_POINT_MINMAX, 0x80000000, 0xFFFFFFFF, NULL); - tmp = (unsigned)(state->line_width * 8.0); + tmp = (unsigned)state->line_width * 8; r600_pipe_state_add_reg(rstate, R_028A08_PA_SU_LINE_CNTL, S_028A08_WIDTH(tmp), 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028A0C_PA_SC_LINE_STIPPLE, 0x00000005, 0xFFFFFFFF, NULL); -- cgit v1.2.3 From 32bb65217ed048817d314062f2804c79f80d0ec7 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 3 Nov 2010 11:15:43 +0000 Subject: evergreeng: set hardware pixelcenters according to gl_rasterization_rules --- src/gallium/drivers/r600/evergreen_state.c | 6 +++++- src/gallium/drivers/r600/evergreend.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 7dd261d7e23..4725b5e75e2 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -291,7 +291,11 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx, r600_pipe_state_add_reg(rstate, R_028C14_PA_CL_GB_HORZ_CLIP_ADJ, 0x3F800000, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028C18_PA_CL_GB_HORZ_DISC_ADJ, 0x3F800000, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_028B7C_PA_SU_POLY_OFFSET_CLAMP, 0x0, 0xFFFFFFFF, NULL); - r600_pipe_state_add_reg(rstate, R_028C08_PA_SU_VTX_CNTL, 0x00000005, 0xFFFFFFFF, NULL); + + r600_pipe_state_add_reg(rstate, R_028C08_PA_SU_VTX_CNTL, + S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules), + 0xFFFFFFFF, NULL); + r600_pipe_state_add_reg(rstate, R_02820C_PA_SC_CLIPRECT_RULE, clip_rule, 0xFFFFFFFF, NULL); return rstate; } diff --git a/src/gallium/drivers/r600/evergreend.h b/src/gallium/drivers/r600/evergreend.h index 7e7bd01291d..a337916c098 100644 --- a/src/gallium/drivers/r600/evergreend.h +++ b/src/gallium/drivers/r600/evergreend.h @@ -1690,6 +1690,9 @@ #define R_028C00_PA_SC_LINE_CNTL 0x00028C00 #define R_028C04_PA_SC_AA_CONFIG 0x00028C04 #define R_028C08_PA_SU_VTX_CNTL 0x00028C08 +#define S_028C08_PIX_CENTER_HALF(x) (((x) & 0x1) << 0) +#define G_028C08_PIX_CENTER_HALF(x) (((x) >> 0) & 0x1) +#define C_028C08_PIX_CENTER_HALF 0xFFFFFFFE #define R_028C0C_PA_CL_GB_VERT_CLIP_ADJ 0x00028C0C #define R_028C10_PA_CL_GB_VERT_DISC_ADJ 0x00028C10 #define R_028C14_PA_CL_GB_HORZ_CLIP_ADJ 0x00028C14 -- cgit v1.2.3 From 01b39b053b0cb6c7493b560b26734f3c4fa52efa Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Nov 2010 20:22:28 +0000 Subject: r600g: Swap the util_blitter_destroy call order. Trivial change that avoids a segmentation fault when the blitter state happens to be bound when the context is destroyed. The free calls should probably removed altogether in the future -- the responsibility to destroy the state atoms lies with whoever created it, and the safest thing for the pipe driver is to not touch any bound state in its destructor. --- src/gallium/drivers/r600/r600_pipe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 55370f06fd8..128c998b931 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -80,12 +80,13 @@ static void r600_destroy_context(struct pipe_context *context) rctx->context.delete_depth_stencil_alpha_state(&rctx->context, rctx->custom_dsa_flush); r600_context_fini(&rctx->ctx); + + util_blitter_destroy(rctx->blitter); + for (int i = 0; i < R600_PIPE_NSTATES; i++) { free(rctx->states[i]); } - util_blitter_destroy(rctx->blitter); - u_upload_destroy(rctx->upload_vb); u_upload_destroy(rctx->upload_ib); -- cgit v1.2.3 From 560ad7e59940423a696e93e62ec3c41b1e553421 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Wed, 3 Nov 2010 22:14:00 +0100 Subject: r300g: Do not use buf param before checking for NULL. Commit 8dfafbf0861fe3d2542332658dd5493851053c78 forgot to update r300g. There is a buf == NULL check, but buf is used before for var init. Tested-by: Guillermo S. Romero --- src/gallium/drivers/r300/r300_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index f2479a994c8..f513f87ca41 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1789,7 +1789,7 @@ static void r300_set_constant_buffer(struct pipe_context *pipe, { struct r300_context* r300 = r300_context(pipe); struct r300_constant_buffer *cbuf; - uint32_t *mapped = r300_buffer(buf)->user_buffer; + uint32_t *mapped; switch (shader) { case PIPE_SHADER_VERTEX: -- cgit v1.2.3 From c8f1687ce70c3a2e0de7a7d50e1619cb4cf8cc50 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Nov 2010 17:52:49 -0600 Subject: llvmpipe: added some debug assertions, but disabled --- src/gallium/drivers/llvmpipe/lp_setup_tri.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index 11dfe639312..bfb6bf277bd 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -815,6 +815,16 @@ static void triangle_both( struct lp_setup_context *setup, { float area = calc_area(v0, v1, v2); + if (0) { + assert(!util_is_inf_or_nan(v0[0][0])); + assert(!util_is_inf_or_nan(v0[0][1])); + assert(!util_is_inf_or_nan(v1[0][0])); + assert(!util_is_inf_or_nan(v1[0][1])); + assert(!util_is_inf_or_nan(v2[0][0])); + assert(!util_is_inf_or_nan(v2[0][1])); + assert(!util_is_inf_or_nan(area)); + } + if (area > 0.0f) retry_triangle_ccw( setup, v0, v1, v2, setup->ccw_is_frontface ); else if (area < 0.0f) -- cgit v1.2.3 From e82fddfcd3fe47016863dde3302767f31889d7d5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Nov 2010 14:40:33 -0600 Subject: softpipe: disable vertex texturing with draw/llvm This is a temporary work around to prevent crashes with glean/glsl1 (for example) which try to do vertex shader texturing. --- src/gallium/drivers/softpipe/sp_screen.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index d90cf56808c..5f171d314a3 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -64,7 +64,12 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: return PIPE_MAX_SAMPLERS; case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: +#ifdef HAVE_LLVM + /* Softpipe doesn't yet know how to tell draw/llvm about textures */ + return 0; +#else return PIPE_MAX_VERTEX_SAMPLERS; +#endif case PIPE_CAP_MAX_COMBINED_SAMPLERS: return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS; case PIPE_CAP_NPOT_TEXTURES: -- cgit v1.2.3 From 9f064116458ff68b92f179a19be4615f003eaa3e Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Sun, 7 Nov 2010 18:40:12 +0100 Subject: r600g: Mention AMD in the renderer string. --- src/gallium/drivers/r600/r600_pipe.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 128c998b931..8bc545d4175 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -221,24 +221,24 @@ static const char* r600_get_vendor(struct pipe_screen* pscreen) static const char *r600_get_family_name(enum radeon_family family) { switch(family) { - case CHIP_R600: return "R600"; - case CHIP_RV610: return "RV610"; - case CHIP_RV630: return "RV630"; - case CHIP_RV670: return "RV670"; - case CHIP_RV620: return "RV620"; - case CHIP_RV635: return "RV635"; - case CHIP_RS780: return "RS780"; - case CHIP_RS880: return "RS880"; - case CHIP_RV770: return "RV770"; - case CHIP_RV730: return "RV730"; - case CHIP_RV710: return "RV710"; - case CHIP_RV740: return "RV740"; - case CHIP_CEDAR: return "CEDAR"; - case CHIP_REDWOOD: return "REDWOOD"; - case CHIP_JUNIPER: return "JUNIPER"; - case CHIP_CYPRESS: return "CYPRESS"; - case CHIP_HEMLOCK: return "HEMLOCK"; - default: return "unknown"; + case CHIP_R600: return "AMD R600"; + case CHIP_RV610: return "AMD RV610"; + case CHIP_RV630: return "AMD RV630"; + case CHIP_RV670: return "AMD RV670"; + case CHIP_RV620: return "AMD RV620"; + case CHIP_RV635: return "AMD RV635"; + case CHIP_RS780: return "AMD RS780"; + case CHIP_RS880: return "AMD RS880"; + case CHIP_RV770: return "AMD RV770"; + case CHIP_RV730: return "AMD RV730"; + case CHIP_RV710: return "AMD RV710"; + case CHIP_RV740: return "AMD RV740"; + case CHIP_CEDAR: return "AMD CEDAR"; + case CHIP_REDWOOD: return "AMD REDWOOD"; + case CHIP_JUNIPER: return "AMD JUNIPER"; + case CHIP_CYPRESS: return "AMD CYPRESS"; + case CHIP_HEMLOCK: return "AMD HEMLOCK"; + default: return "AMD unknown"; } } -- cgit v1.2.3 From 46c19700676e17bfaa0a88346d512449fbeede79 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Wed, 3 Nov 2010 21:41:48 +0100 Subject: r600g: implement texture_get_handle (needed for eglExportDRMImageMESA) --- src/gallium/drivers/r600/r600.h | 3 + src/gallium/drivers/r600/r600_texture.c | 14 +- src/gallium/winsys/r600/drm/r600_bo.c | 28 +- src/gallium/winsys/r600/drm/r600_priv.h | 3 + src/gallium/winsys/r600/drm/radeon_bo.c | 16 ++ src/glsl/glcpp/glcpp-lex.c | 8 +- src/glsl/glsl_parser.cpp | 490 ++++++++++++++++---------------- src/glsl/glsl_parser.h | 13 +- 8 files changed, 312 insertions(+), 263 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h index 5ec607bbd85..17858b2d381 100644 --- a/src/gallium/drivers/r600/r600.h +++ b/src/gallium/drivers/r600/r600.h @@ -43,6 +43,7 @@ typedef uint16_t u16; typedef uint8_t u8; struct radeon; +struct winsys_handle; enum radeon_family { CHIP_UNKNOWN, @@ -120,6 +121,8 @@ void *r600_bo_map(struct radeon *radeon, struct r600_bo *bo, unsigned usage, voi void r600_bo_unmap(struct radeon *radeon, struct r600_bo *bo); void r600_bo_reference(struct radeon *radeon, struct r600_bo **dst, struct r600_bo *src); +boolean r600_bo_get_winsys_handle(struct radeon *radeon, struct r600_bo *pb_bo, + unsigned stride, struct winsys_handle *whandle); static INLINE unsigned r600_bo_offset(struct r600_bo *bo) { return 0; diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index a63990fbffe..0c9b9993756 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -341,6 +341,18 @@ static void r600_texture_destroy(struct pipe_screen *screen, FREE(rtex); } +static boolean r600_texture_get_handle(struct pipe_screen* screen, + struct pipe_resource *ptex, + struct winsys_handle *whandle) +{ + struct r600_resource_texture *rtex = (struct r600_resource_texture*)ptex; + struct r600_resource *resource = &rtex->resource; + struct radeon *radeon = (struct radeon *)screen->winsys; + + return r600_bo_get_winsys_handle(radeon, resource->bo, + rtex->pitch_in_bytes[0], whandle); +} + static struct pipe_surface *r600_get_tex_surface(struct pipe_screen *screen, struct pipe_resource *texture, unsigned face, unsigned level, @@ -655,7 +667,7 @@ void r600_texture_transfer_unmap(struct pipe_context *ctx, struct u_resource_vtbl r600_texture_vtbl = { - u_default_resource_get_handle, /* get_handle */ + r600_texture_get_handle, /* get_handle */ r600_texture_destroy, /* resource_destroy */ r600_texture_is_referenced, /* is_resource_referenced */ r600_texture_get_transfer, /* get_transfer */ diff --git a/src/gallium/winsys/r600/drm/r600_bo.c b/src/gallium/winsys/r600/drm/r600_bo.c index 9b9aec5f64c..251f009a6b0 100644 --- a/src/gallium/winsys/r600/drm/r600_bo.c +++ b/src/gallium/winsys/r600/drm/r600_bo.c @@ -26,9 +26,10 @@ #include #include #include -#include "radeon_drm.h" +#include "state_tracker/drm_driver.h" #include "r600_priv.h" #include "r600d.h" +#include "drm.h" #include "radeon_drm.h" struct r600_bo *r600_bo(struct radeon *radeon, @@ -154,3 +155,28 @@ unsigned r600_bo_get_size(struct r600_bo *pb_bo) return bo->size; } + +boolean r600_bo_get_winsys_handle(struct radeon *radeon, struct r600_bo *pb_bo, + unsigned stride, struct winsys_handle *whandle) +{ + struct radeon_bo *bo; + + bo = radeon_bo_pb_get_bo(pb_bo->pb); + if (!bo) + return FALSE; + + whandle->stride = stride; + switch(whandle->type) { + case DRM_API_HANDLE_TYPE_KMS: + whandle->handle = r600_bo_get_handle(pb_bo); + break; + case DRM_API_HANDLE_TYPE_SHARED: + if (radeon_bo_get_name(radeon, bo, &whandle->handle)) + return FALSE; + break; + default: + return FALSE; + } + + return TRUE; +} diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h index 97c582397a7..9fd77b71c77 100644 --- a/src/gallium/winsys/r600/drm/r600_priv.h +++ b/src/gallium/winsys/r600/drm/r600_priv.h @@ -102,6 +102,9 @@ int radeon_bo_get_tiling_flags(struct radeon *radeon, struct radeon_bo *bo, uint32_t *tiling_flags, uint32_t *pitch); +int radeon_bo_get_name(struct radeon *radeon, + struct radeon_bo *bo, + uint32_t *name); /* radeon_bo_pb.c */ struct radeon_bo *radeon_bo_pb_get_bo(struct pb_buffer *_buf); diff --git a/src/gallium/winsys/r600/drm/radeon_bo.c b/src/gallium/winsys/r600/drm/radeon_bo.c index dcee00de864..3054782838b 100644 --- a/src/gallium/winsys/r600/drm/radeon_bo.c +++ b/src/gallium/winsys/r600/drm/radeon_bo.c @@ -216,3 +216,19 @@ int radeon_bo_get_tiling_flags(struct radeon *radeon, *pitch = args.pitch; return ret; } + +int radeon_bo_get_name(struct radeon *radeon, + struct radeon_bo *bo, + uint32_t *name) +{ + struct drm_gem_flink flink; + int ret; + + flink.handle = bo->handle; + ret = drmIoctl(radeon->fd, DRM_IOCTL_GEM_FLINK, &flink); + if (ret) + return ret; + + *name = flink.name; + return ret; +} diff --git a/src/glsl/glcpp/glcpp-lex.c b/src/glsl/glcpp/glcpp-lex.c index af8f07419aa..156af3008c0 100644 --- a/src/glsl/glcpp/glcpp-lex.c +++ b/src/glsl/glcpp/glcpp-lex.c @@ -795,10 +795,6 @@ int glcpp_get_lineno (yyscan_t yyscanner ); void glcpp_set_lineno (int line_number ,yyscan_t yyscanner ); -int glcpp_get_column (yyscan_t yyscanner ); - -void glcpp_set_column (int column_no ,yyscan_t yyscanner ); - YYSTYPE * glcpp_get_lval (yyscan_t yyscanner ); void glcpp_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); @@ -958,7 +954,7 @@ YY_DECL /* Single-line comments */ -#line 962 "glcpp/glcpp-lex.c" +#line 958 "glcpp/glcpp-lex.c" yylval = yylval_param; @@ -1475,7 +1471,7 @@ YY_RULE_SETUP #line 319 "glcpp/glcpp-lex.l" ECHO; YY_BREAK -#line 1479 "glcpp/glcpp-lex.c" +#line 1475 "glcpp/glcpp-lex.c" case YY_STATE_EOF(DONE): case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(UNREACHABLE): diff --git a/src/glsl/glsl_parser.cpp b/src/glsl/glsl_parser.cpp index e6c8e8a0ec2..cfbb2b83d61 100644 --- a/src/glsl/glsl_parser.cpp +++ b/src/glsl/glsl_parser.cpp @@ -1,9 +1,10 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ + +/* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.3" +#define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -113,7 +114,7 @@ /* Line 189 of yacc.c */ -#line 117 "glsl_parser.cpp" +#line 118 "glsl_parser.cpp" /* Enabling traces. */ #ifndef YYDEBUG @@ -371,7 +372,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 375 "glsl_parser.cpp" +#line 376 "glsl_parser.cpp" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -396,7 +397,7 @@ typedef struct YYLTYPE /* Line 264 of yacc.c */ -#line 400 "glsl_parser.cpp" +#line 401 "glsl_parser.cpp" #ifdef short # undef short @@ -446,7 +447,7 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS +# if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -1949,18 +1950,9 @@ static const yytype_uint16 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ + Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -2017,7 +2009,7 @@ while (YYID (0)) we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ @@ -2559,7 +2551,7 @@ YYLTYPE yylloc; YYLTYPE *yylsp; /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3]; + YYLTYPE yyerror_range[2]; YYSIZE_T yystacksize; @@ -2606,7 +2598,7 @@ YYLTYPE yylloc; yyvsp = yyvs; yylsp = yyls; -#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +#if YYLTYPE_IS_TRIVIAL /* Initialize the default location before parsing starts. */ yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = 1; @@ -2614,7 +2606,7 @@ YYLTYPE yylloc; /* User initialization code. */ -/* Line 1251 of yacc.c */ +/* Line 1242 of yacc.c */ #line 41 "glsl_parser.ypp" { yylloc.first_line = 1; @@ -2624,8 +2616,8 @@ YYLTYPE yylloc; yylloc.source = 0; } -/* Line 1251 of yacc.c */ -#line 2629 "glsl_parser.cpp" +/* Line 1242 of yacc.c */ +#line 2621 "glsl_parser.cpp" yylsp[0] = yylloc; goto yysetstate; @@ -2812,7 +2804,7 @@ yyreduce: { case 2: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 211 "glsl_parser.ypp" { _mesa_glsl_initialize_types(state); @@ -2821,7 +2813,7 @@ yyreduce: case 5: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 220 "glsl_parser.ypp" { switch ((yyvsp[(2) - (3)].n)) { @@ -2843,7 +2835,7 @@ yyreduce: case 12: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 252 "glsl_parser.ypp" { if (!_mesa_glsl_process_extension((yyvsp[(2) - (5)].identifier), & (yylsp[(2) - (5)]), (yyvsp[(4) - (5)].identifier), & (yylsp[(4) - (5)]), state)) { @@ -2854,7 +2846,7 @@ yyreduce: case 13: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 261 "glsl_parser.ypp" { /* FINISHME: The NULL test is only required because 'precision' @@ -2867,7 +2859,7 @@ yyreduce: case 14: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 269 "glsl_parser.ypp" { /* FINISHME: The NULL test is only required because 'precision' @@ -2880,7 +2872,7 @@ yyreduce: case 16: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 284 "glsl_parser.ypp" { void *ctx = state; @@ -2892,7 +2884,7 @@ yyreduce: case 17: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 291 "glsl_parser.ypp" { void *ctx = state; @@ -2904,7 +2896,7 @@ yyreduce: case 18: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 298 "glsl_parser.ypp" { void *ctx = state; @@ -2916,7 +2908,7 @@ yyreduce: case 19: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 305 "glsl_parser.ypp" { void *ctx = state; @@ -2928,7 +2920,7 @@ yyreduce: case 20: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 312 "glsl_parser.ypp" { void *ctx = state; @@ -2940,7 +2932,7 @@ yyreduce: case 21: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 319 "glsl_parser.ypp" { (yyval.expression) = (yyvsp[(2) - (3)].expression); @@ -2949,7 +2941,7 @@ yyreduce: case 23: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 327 "glsl_parser.ypp" { void *ctx = state; @@ -2960,7 +2952,7 @@ yyreduce: case 24: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 333 "glsl_parser.ypp" { (yyval.expression) = (yyvsp[(1) - (1)].expression); @@ -2969,7 +2961,7 @@ yyreduce: case 25: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 337 "glsl_parser.ypp" { void *ctx = state; @@ -2981,7 +2973,7 @@ yyreduce: case 26: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 344 "glsl_parser.ypp" { void *ctx = state; @@ -2992,7 +2984,7 @@ yyreduce: case 27: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 350 "glsl_parser.ypp" { void *ctx = state; @@ -3003,7 +2995,7 @@ yyreduce: case 31: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 368 "glsl_parser.ypp" { void *ctx = state; @@ -3014,7 +3006,7 @@ yyreduce: case 36: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 387 "glsl_parser.ypp" { (yyval.expression) = (yyvsp[(1) - (2)].expression); @@ -3025,7 +3017,7 @@ yyreduce: case 37: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 393 "glsl_parser.ypp" { (yyval.expression) = (yyvsp[(1) - (3)].expression); @@ -3036,7 +3028,7 @@ yyreduce: case 39: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 409 "glsl_parser.ypp" { void *ctx = state; @@ -3047,7 +3039,7 @@ yyreduce: case 40: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 415 "glsl_parser.ypp" { void *ctx = state; @@ -3059,7 +3051,7 @@ yyreduce: case 41: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 422 "glsl_parser.ypp" { void *ctx = state; @@ -3071,7 +3063,7 @@ yyreduce: case 43: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 434 "glsl_parser.ypp" { void *ctx = state; @@ -3082,7 +3074,7 @@ yyreduce: case 44: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 440 "glsl_parser.ypp" { void *ctx = state; @@ -3093,7 +3085,7 @@ yyreduce: case 45: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 446 "glsl_parser.ypp" { void *ctx = state; @@ -3104,35 +3096,35 @@ yyreduce: case 46: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 455 "glsl_parser.ypp" { (yyval.n) = ast_plus; ;} break; case 47: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 456 "glsl_parser.ypp" { (yyval.n) = ast_neg; ;} break; case 48: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 457 "glsl_parser.ypp" { (yyval.n) = ast_logic_not; ;} break; case 49: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 458 "glsl_parser.ypp" { (yyval.n) = ast_bit_not; ;} break; case 51: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 464 "glsl_parser.ypp" { void *ctx = state; @@ -3143,7 +3135,7 @@ yyreduce: case 52: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 470 "glsl_parser.ypp" { void *ctx = state; @@ -3154,7 +3146,7 @@ yyreduce: case 53: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 476 "glsl_parser.ypp" { void *ctx = state; @@ -3165,7 +3157,7 @@ yyreduce: case 55: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 486 "glsl_parser.ypp" { void *ctx = state; @@ -3176,7 +3168,7 @@ yyreduce: case 56: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 492 "glsl_parser.ypp" { void *ctx = state; @@ -3187,7 +3179,7 @@ yyreduce: case 58: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 502 "glsl_parser.ypp" { void *ctx = state; @@ -3198,7 +3190,7 @@ yyreduce: case 59: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 508 "glsl_parser.ypp" { void *ctx = state; @@ -3209,7 +3201,7 @@ yyreduce: case 61: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 518 "glsl_parser.ypp" { void *ctx = state; @@ -3220,7 +3212,7 @@ yyreduce: case 62: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 524 "glsl_parser.ypp" { void *ctx = state; @@ -3231,7 +3223,7 @@ yyreduce: case 63: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 530 "glsl_parser.ypp" { void *ctx = state; @@ -3242,7 +3234,7 @@ yyreduce: case 64: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 536 "glsl_parser.ypp" { void *ctx = state; @@ -3253,7 +3245,7 @@ yyreduce: case 66: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 546 "glsl_parser.ypp" { void *ctx = state; @@ -3264,7 +3256,7 @@ yyreduce: case 67: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 552 "glsl_parser.ypp" { void *ctx = state; @@ -3275,7 +3267,7 @@ yyreduce: case 69: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 562 "glsl_parser.ypp" { void *ctx = state; @@ -3286,7 +3278,7 @@ yyreduce: case 71: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 572 "glsl_parser.ypp" { void *ctx = state; @@ -3297,7 +3289,7 @@ yyreduce: case 73: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 582 "glsl_parser.ypp" { void *ctx = state; @@ -3308,7 +3300,7 @@ yyreduce: case 75: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 592 "glsl_parser.ypp" { void *ctx = state; @@ -3319,7 +3311,7 @@ yyreduce: case 77: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 602 "glsl_parser.ypp" { void *ctx = state; @@ -3330,7 +3322,7 @@ yyreduce: case 79: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 612 "glsl_parser.ypp" { void *ctx = state; @@ -3341,7 +3333,7 @@ yyreduce: case 81: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 622 "glsl_parser.ypp" { void *ctx = state; @@ -3352,7 +3344,7 @@ yyreduce: case 83: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 632 "glsl_parser.ypp" { void *ctx = state; @@ -3363,84 +3355,84 @@ yyreduce: case 84: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 640 "glsl_parser.ypp" { (yyval.n) = ast_assign; ;} break; case 85: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 641 "glsl_parser.ypp" { (yyval.n) = ast_mul_assign; ;} break; case 86: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 642 "glsl_parser.ypp" { (yyval.n) = ast_div_assign; ;} break; case 87: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 643 "glsl_parser.ypp" { (yyval.n) = ast_mod_assign; ;} break; case 88: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 644 "glsl_parser.ypp" { (yyval.n) = ast_add_assign; ;} break; case 89: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 645 "glsl_parser.ypp" { (yyval.n) = ast_sub_assign; ;} break; case 90: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 646 "glsl_parser.ypp" { (yyval.n) = ast_ls_assign; ;} break; case 91: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 647 "glsl_parser.ypp" { (yyval.n) = ast_rs_assign; ;} break; case 92: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 648 "glsl_parser.ypp" { (yyval.n) = ast_and_assign; ;} break; case 93: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 649 "glsl_parser.ypp" { (yyval.n) = ast_xor_assign; ;} break; case 94: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 650 "glsl_parser.ypp" { (yyval.n) = ast_or_assign; ;} break; case 95: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 655 "glsl_parser.ypp" { (yyval.expression) = (yyvsp[(1) - (1)].expression); @@ -3449,7 +3441,7 @@ yyreduce: case 96: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 659 "glsl_parser.ypp" { void *ctx = state; @@ -3467,7 +3459,7 @@ yyreduce: case 98: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 679 "glsl_parser.ypp" { (yyval.node) = (yyvsp[(1) - (2)].function); @@ -3476,7 +3468,7 @@ yyreduce: case 99: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 683 "glsl_parser.ypp" { (yyval.node) = (yyvsp[(1) - (2)].declarator_list); @@ -3485,7 +3477,7 @@ yyreduce: case 100: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 687 "glsl_parser.ypp" { if (((yyvsp[(3) - (4)].type_specifier)->type_specifier != ast_float) @@ -3501,7 +3493,7 @@ yyreduce: case 104: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 710 "glsl_parser.ypp" { (yyval.function) = (yyvsp[(1) - (2)].function); @@ -3511,7 +3503,7 @@ yyreduce: case 105: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 715 "glsl_parser.ypp" { (yyval.function) = (yyvsp[(1) - (3)].function); @@ -3521,7 +3513,7 @@ yyreduce: case 106: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 723 "glsl_parser.ypp" { void *ctx = state; @@ -3534,7 +3526,7 @@ yyreduce: case 107: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 734 "glsl_parser.ypp" { void *ctx = state; @@ -3549,7 +3541,7 @@ yyreduce: case 108: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 744 "glsl_parser.ypp" { void *ctx = state; @@ -3566,7 +3558,7 @@ yyreduce: case 109: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 759 "glsl_parser.ypp" { (yyvsp[(1) - (3)].type_qualifier).flags.i |= (yyvsp[(2) - (3)].type_qualifier).flags.i; @@ -3578,7 +3570,7 @@ yyreduce: case 110: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 766 "glsl_parser.ypp" { (yyval.parameter_declarator) = (yyvsp[(2) - (2)].parameter_declarator); @@ -3588,7 +3580,7 @@ yyreduce: case 111: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 771 "glsl_parser.ypp" { void *ctx = state; @@ -3604,7 +3596,7 @@ yyreduce: case 112: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 782 "glsl_parser.ypp" { void *ctx = state; @@ -3618,7 +3610,7 @@ yyreduce: case 113: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 794 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -3627,7 +3619,7 @@ yyreduce: case 114: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 798 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -3637,7 +3629,7 @@ yyreduce: case 115: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 803 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -3647,7 +3639,7 @@ yyreduce: case 116: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 808 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -3658,7 +3650,7 @@ yyreduce: case 119: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 822 "glsl_parser.ypp" { void *ctx = state; @@ -3672,7 +3664,7 @@ yyreduce: case 120: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 831 "glsl_parser.ypp" { void *ctx = state; @@ -3686,7 +3678,7 @@ yyreduce: case 121: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 840 "glsl_parser.ypp" { void *ctx = state; @@ -3700,7 +3692,7 @@ yyreduce: case 122: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 849 "glsl_parser.ypp" { void *ctx = state; @@ -3714,7 +3706,7 @@ yyreduce: case 123: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 858 "glsl_parser.ypp" { void *ctx = state; @@ -3728,7 +3720,7 @@ yyreduce: case 124: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 867 "glsl_parser.ypp" { void *ctx = state; @@ -3742,7 +3734,7 @@ yyreduce: case 125: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 880 "glsl_parser.ypp" { void *ctx = state; @@ -3758,7 +3750,7 @@ yyreduce: case 126: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 891 "glsl_parser.ypp" { void *ctx = state; @@ -3772,7 +3764,7 @@ yyreduce: case 127: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 900 "glsl_parser.ypp" { void *ctx = state; @@ -3786,7 +3778,7 @@ yyreduce: case 128: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 909 "glsl_parser.ypp" { void *ctx = state; @@ -3800,7 +3792,7 @@ yyreduce: case 129: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 918 "glsl_parser.ypp" { void *ctx = state; @@ -3814,7 +3806,7 @@ yyreduce: case 130: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 927 "glsl_parser.ypp" { void *ctx = state; @@ -3828,7 +3820,7 @@ yyreduce: case 131: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 936 "glsl_parser.ypp" { void *ctx = state; @@ -3842,7 +3834,7 @@ yyreduce: case 132: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 945 "glsl_parser.ypp" { void *ctx = state; @@ -3858,7 +3850,7 @@ yyreduce: case 133: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 959 "glsl_parser.ypp" { void *ctx = state; @@ -3870,7 +3862,7 @@ yyreduce: case 134: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 966 "glsl_parser.ypp" { void *ctx = state; @@ -3883,7 +3875,7 @@ yyreduce: case 135: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 977 "glsl_parser.ypp" { (yyval.type_qualifier) = (yyvsp[(3) - (4)].type_qualifier); @@ -3892,7 +3884,7 @@ yyreduce: case 137: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 985 "glsl_parser.ypp" { if (((yyvsp[(1) - (3)].type_qualifier).flags.i & (yyvsp[(3) - (3)].type_qualifier).flags.i) != 0) { @@ -3913,7 +3905,7 @@ yyreduce: case 138: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1004 "glsl_parser.ypp" { bool got_one = false; @@ -3947,7 +3939,7 @@ yyreduce: case 139: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1033 "glsl_parser.ypp" { bool got_one = false; @@ -3990,7 +3982,7 @@ yyreduce: case 140: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1074 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4000,7 +3992,7 @@ yyreduce: case 141: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1079 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4010,7 +4002,7 @@ yyreduce: case 142: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1084 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4020,7 +4012,7 @@ yyreduce: case 143: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1092 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4030,7 +4022,7 @@ yyreduce: case 146: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1102 "glsl_parser.ypp" { (yyval.type_qualifier) = (yyvsp[(1) - (2)].type_qualifier); @@ -4040,7 +4032,7 @@ yyreduce: case 148: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1108 "glsl_parser.ypp" { (yyval.type_qualifier) = (yyvsp[(1) - (2)].type_qualifier); @@ -4050,7 +4042,7 @@ yyreduce: case 149: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1113 "glsl_parser.ypp" { (yyval.type_qualifier) = (yyvsp[(2) - (2)].type_qualifier); @@ -4060,7 +4052,7 @@ yyreduce: case 150: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1118 "glsl_parser.ypp" { (yyval.type_qualifier) = (yyvsp[(2) - (3)].type_qualifier); @@ -4071,7 +4063,7 @@ yyreduce: case 151: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1124 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4081,7 +4073,7 @@ yyreduce: case 152: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1132 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4091,7 +4083,7 @@ yyreduce: case 153: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1137 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4101,7 +4093,7 @@ yyreduce: case 154: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1142 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4111,7 +4103,7 @@ yyreduce: case 155: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1147 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4122,7 +4114,7 @@ yyreduce: case 156: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1153 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4132,7 +4124,7 @@ yyreduce: case 157: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1158 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4142,7 +4134,7 @@ yyreduce: case 158: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1163 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4152,7 +4144,7 @@ yyreduce: case 159: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1168 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4162,7 +4154,7 @@ yyreduce: case 160: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1173 "glsl_parser.ypp" { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); @@ -4172,7 +4164,7 @@ yyreduce: case 162: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1182 "glsl_parser.ypp" { (yyval.type_specifier) = (yyvsp[(2) - (2)].type_specifier); @@ -4182,7 +4174,7 @@ yyreduce: case 164: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1191 "glsl_parser.ypp" { (yyval.type_specifier) = (yyvsp[(1) - (3)].type_specifier); @@ -4193,7 +4185,7 @@ yyreduce: case 165: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1197 "glsl_parser.ypp" { (yyval.type_specifier) = (yyvsp[(1) - (4)].type_specifier); @@ -4204,7 +4196,7 @@ yyreduce: case 166: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1206 "glsl_parser.ypp" { void *ctx = state; @@ -4215,7 +4207,7 @@ yyreduce: case 167: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1212 "glsl_parser.ypp" { void *ctx = state; @@ -4226,7 +4218,7 @@ yyreduce: case 168: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1218 "glsl_parser.ypp" { void *ctx = state; @@ -4237,364 +4229,364 @@ yyreduce: case 169: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1226 "glsl_parser.ypp" { (yyval.n) = ast_void; ;} break; case 170: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1227 "glsl_parser.ypp" { (yyval.n) = ast_float; ;} break; case 171: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1228 "glsl_parser.ypp" { (yyval.n) = ast_int; ;} break; case 172: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1229 "glsl_parser.ypp" { (yyval.n) = ast_uint; ;} break; case 173: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1230 "glsl_parser.ypp" { (yyval.n) = ast_bool; ;} break; case 174: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1231 "glsl_parser.ypp" { (yyval.n) = ast_vec2; ;} break; case 175: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1232 "glsl_parser.ypp" { (yyval.n) = ast_vec3; ;} break; case 176: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1233 "glsl_parser.ypp" { (yyval.n) = ast_vec4; ;} break; case 177: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1234 "glsl_parser.ypp" { (yyval.n) = ast_bvec2; ;} break; case 178: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1235 "glsl_parser.ypp" { (yyval.n) = ast_bvec3; ;} break; case 179: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1236 "glsl_parser.ypp" { (yyval.n) = ast_bvec4; ;} break; case 180: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1237 "glsl_parser.ypp" { (yyval.n) = ast_ivec2; ;} break; case 181: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1238 "glsl_parser.ypp" { (yyval.n) = ast_ivec3; ;} break; case 182: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1239 "glsl_parser.ypp" { (yyval.n) = ast_ivec4; ;} break; case 183: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1240 "glsl_parser.ypp" { (yyval.n) = ast_uvec2; ;} break; case 184: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1241 "glsl_parser.ypp" { (yyval.n) = ast_uvec3; ;} break; case 185: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1242 "glsl_parser.ypp" { (yyval.n) = ast_uvec4; ;} break; case 186: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1243 "glsl_parser.ypp" { (yyval.n) = ast_mat2; ;} break; case 187: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1244 "glsl_parser.ypp" { (yyval.n) = ast_mat2x3; ;} break; case 188: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1245 "glsl_parser.ypp" { (yyval.n) = ast_mat2x4; ;} break; case 189: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1246 "glsl_parser.ypp" { (yyval.n) = ast_mat3x2; ;} break; case 190: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1247 "glsl_parser.ypp" { (yyval.n) = ast_mat3; ;} break; case 191: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1248 "glsl_parser.ypp" { (yyval.n) = ast_mat3x4; ;} break; case 192: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1249 "glsl_parser.ypp" { (yyval.n) = ast_mat4x2; ;} break; case 193: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1250 "glsl_parser.ypp" { (yyval.n) = ast_mat4x3; ;} break; case 194: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1251 "glsl_parser.ypp" { (yyval.n) = ast_mat4; ;} break; case 195: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1252 "glsl_parser.ypp" { (yyval.n) = ast_sampler1d; ;} break; case 196: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1253 "glsl_parser.ypp" { (yyval.n) = ast_sampler2d; ;} break; case 197: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1254 "glsl_parser.ypp" { (yyval.n) = ast_sampler2drect; ;} break; case 198: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1255 "glsl_parser.ypp" { (yyval.n) = ast_sampler3d; ;} break; case 199: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1256 "glsl_parser.ypp" { (yyval.n) = ast_samplercube; ;} break; case 200: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1257 "glsl_parser.ypp" { (yyval.n) = ast_sampler1dshadow; ;} break; case 201: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1258 "glsl_parser.ypp" { (yyval.n) = ast_sampler2dshadow; ;} break; case 202: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1259 "glsl_parser.ypp" { (yyval.n) = ast_sampler2drectshadow; ;} break; case 203: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1260 "glsl_parser.ypp" { (yyval.n) = ast_samplercubeshadow; ;} break; case 204: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1261 "glsl_parser.ypp" { (yyval.n) = ast_sampler1darray; ;} break; case 205: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1262 "glsl_parser.ypp" { (yyval.n) = ast_sampler2darray; ;} break; case 206: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1263 "glsl_parser.ypp" { (yyval.n) = ast_sampler1darrayshadow; ;} break; case 207: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1264 "glsl_parser.ypp" { (yyval.n) = ast_sampler2darrayshadow; ;} break; case 208: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1265 "glsl_parser.ypp" { (yyval.n) = ast_isampler1d; ;} break; case 209: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1266 "glsl_parser.ypp" { (yyval.n) = ast_isampler2d; ;} break; case 210: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1267 "glsl_parser.ypp" { (yyval.n) = ast_isampler3d; ;} break; case 211: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1268 "glsl_parser.ypp" { (yyval.n) = ast_isamplercube; ;} break; case 212: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1269 "glsl_parser.ypp" { (yyval.n) = ast_isampler1darray; ;} break; case 213: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1270 "glsl_parser.ypp" { (yyval.n) = ast_isampler2darray; ;} break; case 214: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1271 "glsl_parser.ypp" { (yyval.n) = ast_usampler1d; ;} break; case 215: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1272 "glsl_parser.ypp" { (yyval.n) = ast_usampler2d; ;} break; case 216: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1273 "glsl_parser.ypp" { (yyval.n) = ast_usampler3d; ;} break; case 217: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1274 "glsl_parser.ypp" { (yyval.n) = ast_usamplercube; ;} break; case 218: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1275 "glsl_parser.ypp" { (yyval.n) = ast_usampler1darray; ;} break; case 219: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1276 "glsl_parser.ypp" { (yyval.n) = ast_usampler2darray; ;} break; case 220: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1280 "glsl_parser.ypp" { if (!state->es_shader && state->language_version < 130) @@ -4611,7 +4603,7 @@ yyreduce: case 221: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1291 "glsl_parser.ypp" { if (!state->es_shader && state->language_version < 130) @@ -4628,7 +4620,7 @@ yyreduce: case 222: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1302 "glsl_parser.ypp" { if (!state->es_shader && state->language_version < 130) @@ -4645,7 +4637,7 @@ yyreduce: case 223: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1317 "glsl_parser.ypp" { void *ctx = state; @@ -4656,7 +4648,7 @@ yyreduce: case 224: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1323 "glsl_parser.ypp" { void *ctx = state; @@ -4667,7 +4659,7 @@ yyreduce: case 225: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1332 "glsl_parser.ypp" { (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].declarator_list); @@ -4677,7 +4669,7 @@ yyreduce: case 226: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1337 "glsl_parser.ypp" { (yyval.node) = (ast_node *) (yyvsp[(1) - (2)].node); @@ -4687,7 +4679,7 @@ yyreduce: case 227: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1345 "glsl_parser.ypp" { void *ctx = state; @@ -4704,7 +4696,7 @@ yyreduce: case 228: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1360 "glsl_parser.ypp" { (yyval.declaration) = (yyvsp[(1) - (1)].declaration); @@ -4714,7 +4706,7 @@ yyreduce: case 229: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1365 "glsl_parser.ypp" { (yyval.declaration) = (yyvsp[(1) - (3)].declaration); @@ -4724,7 +4716,7 @@ yyreduce: case 230: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1373 "glsl_parser.ypp" { void *ctx = state; @@ -4735,7 +4727,7 @@ yyreduce: case 231: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1379 "glsl_parser.ypp" { void *ctx = state; @@ -4746,28 +4738,28 @@ yyreduce: case 234: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1397 "glsl_parser.ypp" { (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].compound_statement); ;} break; case 239: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1405 "glsl_parser.ypp" { (yyval.node) = NULL; ;} break; case 240: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1406 "glsl_parser.ypp" { (yyval.node) = NULL; ;} break; case 243: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1413 "glsl_parser.ypp" { void *ctx = state; @@ -4778,7 +4770,7 @@ yyreduce: case 244: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1419 "glsl_parser.ypp" { void *ctx = state; @@ -4789,14 +4781,14 @@ yyreduce: case 245: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1427 "glsl_parser.ypp" { (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].compound_statement); ;} break; case 247: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1433 "glsl_parser.ypp" { void *ctx = state; @@ -4807,7 +4799,7 @@ yyreduce: case 248: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1439 "glsl_parser.ypp" { void *ctx = state; @@ -4818,7 +4810,7 @@ yyreduce: case 249: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1448 "glsl_parser.ypp" { if ((yyvsp[(1) - (1)].node) == NULL) { @@ -4833,7 +4825,7 @@ yyreduce: case 250: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1458 "glsl_parser.ypp" { if ((yyvsp[(2) - (2)].node) == NULL) { @@ -4847,7 +4839,7 @@ yyreduce: case 251: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1470 "glsl_parser.ypp" { void *ctx = state; @@ -4858,7 +4850,7 @@ yyreduce: case 252: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1476 "glsl_parser.ypp" { void *ctx = state; @@ -4869,7 +4861,7 @@ yyreduce: case 253: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1485 "glsl_parser.ypp" { (yyval.node) = new(state) ast_selection_statement((yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].selection_rest_statement).then_statement, @@ -4880,7 +4872,7 @@ yyreduce: case 254: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1494 "glsl_parser.ypp" { (yyval.selection_rest_statement).then_statement = (yyvsp[(1) - (3)].node); @@ -4890,7 +4882,7 @@ yyreduce: case 255: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1499 "glsl_parser.ypp" { (yyval.selection_rest_statement).then_statement = (yyvsp[(1) - (1)].node); @@ -4900,7 +4892,7 @@ yyreduce: case 256: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1507 "glsl_parser.ypp" { (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].expression); @@ -4909,7 +4901,7 @@ yyreduce: case 257: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1511 "glsl_parser.ypp" { void *ctx = state; @@ -4925,7 +4917,7 @@ yyreduce: case 261: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1534 "glsl_parser.ypp" { void *ctx = state; @@ -4937,7 +4929,7 @@ yyreduce: case 262: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1541 "glsl_parser.ypp" { void *ctx = state; @@ -4949,7 +4941,7 @@ yyreduce: case 263: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1548 "glsl_parser.ypp" { void *ctx = state; @@ -4961,7 +4953,7 @@ yyreduce: case 267: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1564 "glsl_parser.ypp" { (yyval.node) = NULL; @@ -4970,7 +4962,7 @@ yyreduce: case 268: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1571 "glsl_parser.ypp" { (yyval.for_rest_statement).cond = (yyvsp[(1) - (2)].node); @@ -4980,7 +4972,7 @@ yyreduce: case 269: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1576 "glsl_parser.ypp" { (yyval.for_rest_statement).cond = (yyvsp[(1) - (3)].node); @@ -4990,7 +4982,7 @@ yyreduce: case 270: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1585 "glsl_parser.ypp" { void *ctx = state; @@ -5001,7 +4993,7 @@ yyreduce: case 271: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1591 "glsl_parser.ypp" { void *ctx = state; @@ -5012,7 +5004,7 @@ yyreduce: case 272: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1597 "glsl_parser.ypp" { void *ctx = state; @@ -5023,7 +5015,7 @@ yyreduce: case 273: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1603 "glsl_parser.ypp" { void *ctx = state; @@ -5034,7 +5026,7 @@ yyreduce: case 274: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1609 "glsl_parser.ypp" { void *ctx = state; @@ -5045,28 +5037,28 @@ yyreduce: case 275: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1617 "glsl_parser.ypp" { (yyval.node) = (yyvsp[(1) - (1)].function_definition); ;} break; case 276: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1618 "glsl_parser.ypp" { (yyval.node) = (yyvsp[(1) - (1)].node); ;} break; case 277: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1619 "glsl_parser.ypp" { (yyval.node) = NULL; ;} break; case 278: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 1624 "glsl_parser.ypp" { void *ctx = state; @@ -5079,8 +5071,8 @@ yyreduce: -/* Line 1464 of yacc.c */ -#line 5084 "glsl_parser.cpp" +/* Line 1455 of yacc.c */ +#line 5076 "glsl_parser.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -5152,7 +5144,7 @@ yyerrlab: #endif } - yyerror_range[1] = yylloc; + yyerror_range[0] = yylloc; if (yyerrstatus == 3) { @@ -5189,7 +5181,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - yyerror_range[1] = yylsp[1-yylen]; + yyerror_range[0] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); @@ -5223,7 +5215,7 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - yyerror_range[1] = *yylsp; + yyerror_range[0] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp, state); YYPOPSTACK (1); @@ -5233,10 +5225,10 @@ yyerrlab1: *++yyvsp = yylval; - yyerror_range[2] = yylloc; + yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; /* Shift the error token. */ diff --git a/src/glsl/glsl_parser.h b/src/glsl/glsl_parser.h index 1101d4977cf..9bb6ae62991 100644 --- a/src/glsl/glsl_parser.h +++ b/src/glsl/glsl_parser.h @@ -1,9 +1,10 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ + +/* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton interface for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -235,7 +236,7 @@ typedef union YYSTYPE { -/* Line 1685 of yacc.c */ +/* Line 1676 of yacc.c */ #line 52 "glsl_parser.ypp" int n; @@ -268,8 +269,8 @@ typedef union YYSTYPE -/* Line 1685 of yacc.c */ -#line 273 "glsl_parser.h" +/* Line 1676 of yacc.c */ +#line 274 "glsl_parser.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ -- cgit v1.2.3 From 61ea76c8da5511d8d3f1fc3ea409ddbef89e7488 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 9 Nov 2010 11:43:37 -0700 Subject: softpipe: can't no-op depth test stage when occlusion query is enabled Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31479 --- src/gallium/drivers/softpipe/sp_quad_depth_test.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c index c8f5f89568a..89b2a91fc1f 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c @@ -860,6 +860,7 @@ choose_depth_test(struct quad_stage *qs, /* look for special cases */ if (!alpha && !depth && + !occlusion && !stencil) { qs->run = depth_noop; } -- cgit v1.2.3 From e3ea4aec033643a629e2fa48eb538fdb856adf4e Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 3 Nov 2010 14:06:33 +0000 Subject: r600g: avoid recursion with staged uploads Don't use an intermediate for formats which don't support hardware blits under u_blitter.c, as these will recursively attempt to create a transfer. --- src/gallium/drivers/r600/r600_texture.c | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 0c9b9993756..06d17f7709a 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -466,6 +466,36 @@ static INLINE unsigned u_box_volume( const struct pipe_box *box ) }; +/* Figure out whether u_blitter will fallback to a transfer operation. + * If so, don't use a staging resource. + */ +static boolean permit_hardware_blit(struct pipe_screen *screen, + struct pipe_resource *res) +{ + unsigned bind; + + if (util_format_is_depth_or_stencil(res->format)) + bind = PIPE_BIND_DEPTH_STENCIL; + else + bind = PIPE_BIND_RENDER_TARGET; + + if (!screen->is_format_supported(screen, + res->format, + res->target, + res->nr_samples, + bind, 0)) + return FALSE; + + if (!screen->is_format_supported(screen, + res->format, + res->target, + res->nr_samples, + PIPE_BIND_SAMPLER_VIEW, 0)) + return FALSE; + + return TRUE; +} + struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, struct pipe_resource *texture, struct pipe_subresource sr, @@ -506,6 +536,10 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, !(usage & (PIPE_TRANSFER_DONTBLOCK | PIPE_TRANSFER_UNSYNCHRONIZED))) use_staging_texture = TRUE; + if (!permit_hardware_blit(ctx->screen, texture) || + (texture->flags & R600_RESOURCE_FLAG_TRANSFER)) + use_staging_texture = FALSE; + trans = CALLOC_STRUCT(r600_transfer); if (trans == NULL) return NULL; -- cgit v1.2.3 From c2c55547dc36f404e29dbc9253166f90df6783af Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 3 Nov 2010 14:23:45 +0000 Subject: r600g: attempt to turn on DXTn formats Seems to sort-of work for non-mipmapped textures. Better than just black anyway. --- src/gallium/drivers/r600/eg_state_inlines.h | 2 +- src/gallium/drivers/r600/r600_state_inlines.h | 2 +- src/gallium/drivers/r600/r600_texture.c | 17 +++++++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/eg_state_inlines.h b/src/gallium/drivers/r600/eg_state_inlines.h index be81c28b43f..59641976403 100644 --- a/src/gallium/drivers/r600/eg_state_inlines.h +++ b/src/gallium/drivers/r600/eg_state_inlines.h @@ -473,7 +473,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format) case PIPE_FORMAT_UYVY: case PIPE_FORMAT_YUYV: default: - R600_ERR("unsupported color format %d\n", format); + //R600_ERR("unsupported color format %d\n", format); return ~0; /* Unsupported. */ } } diff --git a/src/gallium/drivers/r600/r600_state_inlines.h b/src/gallium/drivers/r600/r600_state_inlines.h index 1c1978f8abb..1be5b156d35 100644 --- a/src/gallium/drivers/r600/r600_state_inlines.h +++ b/src/gallium/drivers/r600/r600_state_inlines.h @@ -472,7 +472,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format) case PIPE_FORMAT_UYVY: case PIPE_FORMAT_YUYV: default: - R600_ERR("unsupported color format %d %s\n", format, util_format_name(format)); + //R600_ERR("unsupported color format %d %s\n", format, util_format_name(format)); return ~0; /* Unsupported. */ } } diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 06d17f7709a..02160fd3bb6 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -806,7 +806,7 @@ uint32_t r600_translate_texformat(enum pipe_format format, result = FMT_24_8; goto out_word4; case PIPE_FORMAT_S8_USCALED: - result = V_0280A0_COLOR_8; + result = FMT_8; word4 |= S_038010_NUM_FORMAT_ALL(V_038010_SQ_NUM_FORMAT_INT); goto out_word4; default: @@ -835,7 +835,20 @@ uint32_t r600_translate_texformat(enum pipe_format format, /* S3TC formats. TODO */ if (desc->layout == UTIL_FORMAT_LAYOUT_S3TC) { - goto out_unknown; + switch (format) { + case PIPE_FORMAT_DXT1_RGB: + case PIPE_FORMAT_DXT1_RGBA: + result = FMT_BC1; + goto out_word4; + case PIPE_FORMAT_DXT3_RGBA: + result = FMT_BC2; + goto out_word4; + case PIPE_FORMAT_DXT5_RGBA: + result = FMT_BC3; + goto out_word4; + default: + goto out_unknown; + } } -- cgit v1.2.3 From 9f7ec103e26c67cb077fd7d94d2fb68562b86c40 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 3 Nov 2010 18:54:03 +0000 Subject: r600g: translate ARR instruction --- src/gallium/drivers/r600/r600_shader.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 1a0b35d9bf5..f6153c0e80f 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -2663,7 +2663,18 @@ static int tgsi_r600_arl(struct r600_shader_ctx *ctx) int r; memset(&alu, 0, sizeof(struct r600_bc_alu)); - alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_FLOOR; + switch (inst->Instruction.Opcode) { + case TGSI_OPCODE_ARL: + alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_FLOOR; + break; + case TGSI_OPCODE_ARR: + alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA; + break; + default: + assert(0); + return -1; + } + r = tgsi_src(ctx, &inst->Src[0], &alu.src[0]); if (r) @@ -3070,7 +3081,7 @@ static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[] = { {TGSI_OPCODE_UP4UB, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported}, {TGSI_OPCODE_X2D, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported}, {TGSI_OPCODE_ARA, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported}, - {TGSI_OPCODE_ARR, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported}, + {TGSI_OPCODE_ARR, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_r600_arl}, {TGSI_OPCODE_BRA, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported}, {TGSI_OPCODE_CAL, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported}, {TGSI_OPCODE_RET, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported}, -- cgit v1.2.3 From 63c3e3a3dc73f8a72e0d08ac4453df57bccdfdb9 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Nov 2010 20:08:45 +0000 Subject: r600: fix my pessimism about PIPE_TRANSFER_x flags For some reason I though we needed the _DISCARD flag to avoid readbacks, which isn't true at all. Now write operations should pipeline properly, gives a good speedup to demos/tunnel. --- src/gallium/drivers/r600/r600_texture.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 02160fd3bb6..ef5adaf6487 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -507,10 +507,6 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, struct r600_transfer *trans; int r; boolean use_staging_texture = FALSE; - boolean discard = FALSE; - - if (!(usage & PIPE_TRANSFER_READ) && (usage & PIPE_TRANSFER_DISCARD)) - discard = TRUE; /* We cannot map a tiled texture directly because the data is * in a different order, therefore we do detiling using a blit. @@ -522,7 +518,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, if (rtex->tiled) use_staging_texture = TRUE; - if (usage & PIPE_TRANSFER_READ && + if ((usage & PIPE_TRANSFER_READ) && u_box_volume(box) > 1024) use_staging_texture = TRUE; @@ -532,8 +528,9 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, * and might block. */ if ((usage & PIPE_TRANSFER_WRITE) && - discard && - !(usage & (PIPE_TRANSFER_DONTBLOCK | PIPE_TRANSFER_UNSYNCHRONIZED))) + !(usage & (PIPE_TRANSFER_READ | + PIPE_TRANSFER_DONTBLOCK | + PIPE_TRANSFER_UNSYNCHRONIZED))) use_staging_texture = TRUE; if (!permit_hardware_blit(ctx->screen, texture) || @@ -591,7 +588,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, trans->transfer.stride = ((struct r600_resource_texture *)trans->staging_texture)->pitch_in_bytes[0]; - if (!discard) { + if (usage & PIPE_TRANSFER_READ) { r600_copy_to_staging_texture(ctx, trans); /* Always referenced in the blit. */ ctx->flush(ctx, 0, NULL); -- cgit v1.2.3 From 88ddfc57e48ef86bd6f5d5f6617936ebcdce0efc Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 9 Nov 2010 14:53:42 +0100 Subject: r300g: mention ATI in the renderer string --- src/gallium/drivers/r300/r300_screen.c | 50 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index d445df408dd..1d59e38aac5 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -44,31 +44,31 @@ static const char* r300_get_vendor(struct pipe_screen* pscreen) } static const char* chip_families[] = { - "R300", - "R350", - "R360", - "RV350", - "RV370", - "RV380", - "R420", - "R423", - "R430", - "R480", - "R481", - "RV410", - "RS400", - "RC410", - "RS480", - "RS482", - "RS600", - "RS690", - "RS740", - "RV515", - "R520", - "RV530", - "R580", - "RV560", - "RV570" + "ATI R300", + "ATI R350", + "ATI R360", + "ATI RV350", + "ATI RV370", + "ATI RV380", + "ATI R420", + "ATI R423", + "ATI R430", + "ATI R480", + "ATI R481", + "ATI RV410", + "ATI RS400", + "ATI RC410", + "ATI RS480", + "ATI RS482", + "ATI RS600", + "ATI RS690", + "ATI RS740", + "ATI RV515", + "ATI R520", + "ATI RV530", + "ATI R580", + "ATI RV560", + "ATI RV570" }; static const char* r300_get_name(struct pipe_screen* pscreen) -- cgit v1.2.3 From 1d28936dea2062f89ecd204aabae5bfe06eb943a Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 7 Aug 2010 01:57:42 +0200 Subject: r300g: rename has_hyperz -> can_hyperz --- src/gallium/drivers/r300/r300_blit.c | 4 ++-- src/gallium/drivers/r300/r300_context.c | 4 ++-- src/gallium/drivers/r300/r300_emit.c | 4 ++-- src/gallium/drivers/r300/r300_hyperz.c | 2 +- src/gallium/drivers/r300/r300_state.c | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 91a374a5838..0ac4e4c6f12 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -176,12 +176,12 @@ static void r300_clear(struct pipe_context* pipe, fb->zsbuf ? r300_texture(fb->zsbuf->texture) : NULL; uint32_t width = fb->width; uint32_t height = fb->height; - boolean has_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ); + boolean can_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ); uint32_t hyperz_dcv = hyperz->zb_depthclearvalue; /* Enable fast Z clear. * The zbuffer must be in micro-tiled mode, otherwise it locks up. */ - if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && has_hyperz) { + if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && can_hyperz) { hyperz_dcv = hyperz->zb_depthclearvalue = r300_depth_clear_value(fb->zsbuf->format, depth, stencil); diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 624dadd07d7..fb099e2a7d0 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -184,7 +184,7 @@ static void r300_setup_atoms(struct r300_context* r300) boolean has_tcl = r300->screen->caps.has_tcl; boolean drm_2_3_0 = r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0); boolean drm_2_6_0 = r300->rws->get_value(r300->rws, R300_VID_DRM_2_6_0); - boolean has_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ); + boolean can_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ); boolean has_hiz_ram = r300->screen->caps.hiz_ram > 0; /* Create the actual atom list. @@ -240,7 +240,7 @@ static void r300_setup_atoms(struct r300_context* r300) /* TX. */ R300_INIT_ATOM(texture_cache_inval, 2); R300_INIT_ATOM(textures_state, 0); - if (has_hyperz) { + if (can_hyperz) { /* HiZ Clear */ if (has_hiz_ram) R300_INIT_ATOM(hiz_clear, 0); diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 3a1085d2dc5..c187f115da4 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -358,7 +358,7 @@ void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state) struct pipe_framebuffer_state* fb = (struct pipe_framebuffer_state*)state; struct r300_surface* surf; unsigned i; - boolean has_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ); + boolean can_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ); CS_LOCALS(r300); BEGIN_CS(size); @@ -411,7 +411,7 @@ void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state) OUT_CS_REG_SEQ(R300_ZB_DEPTHPITCH, 1); OUT_CS_RELOC(surf->buffer, surf->pitch, 0, surf->domain); - if (has_hyperz) { + if (can_hyperz) { uint32_t surf_pitch; struct r300_texture *tex; int level = surf->base.level; diff --git a/src/gallium/drivers/r300/r300_hyperz.c b/src/gallium/drivers/r300/r300_hyperz.c index eb5b0c36f8f..6e0e1b5bf4c 100644 --- a/src/gallium/drivers/r300/r300_hyperz.c +++ b/src/gallium/drivers/r300/r300_hyperz.c @@ -64,7 +64,7 @@ static bool r300_zfunc_same_direction(int func1, int func2) return FALSE; return TRUE; } - + static int r300_get_hiz_min(struct r300_context *r300) { struct r300_dsa_state *dsa_state = r300->dsa_state.state; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index f513f87ca41..bd08bf2d3fd 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -684,7 +684,7 @@ void r300_mark_fb_state_dirty(struct r300_context *r300, enum r300_fb_state_change change) { struct pipe_framebuffer_state *state = r300->fb_state.state; - boolean has_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ); + boolean can_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ); /* What is marked as dirty depends on the enum r300_fb_state_change. */ r300->gpu_flush.dirty = TRUE; @@ -703,7 +703,7 @@ void r300_mark_fb_state_dirty(struct r300_context *r300, r300->fb_state.size += 10; else if (state->zsbuf) { r300->fb_state.size += 10; - if (has_hyperz) + if (can_hyperz) r300->fb_state.size += r300->screen->caps.hiz_ram ? 8 : 4; } @@ -717,7 +717,7 @@ static void struct r300_context* r300 = r300_context(pipe); struct r300_aa_state *aa = (struct r300_aa_state*)r300->aa_state.state; struct pipe_framebuffer_state *old_state = r300->fb_state.state; - boolean has_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ); + boolean can_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ); unsigned max_width, max_height, i; uint32_t zbuffer_bpp = 0; int blocksize; @@ -764,7 +764,7 @@ static void zbuffer_bpp = 24; break; } - if (has_hyperz) { + if (can_hyperz) { struct r300_surface *zs_surf = r300_surface(state->zsbuf); struct r300_texture *tex; int compress = r300->screen->caps.is_rv350 ? RV350_Z_COMPRESS_88 : R300_Z_COMPRESS_44; -- cgit v1.2.3 From 93c04749be3e4a7e224b5dafe67f479264199908 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 9 Nov 2010 15:04:34 +0100 Subject: r300g: turn magic numbers into names in the hyperz code --- src/gallium/drivers/r300/r300_hyperz.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r300/r300_hyperz.c b/src/gallium/drivers/r300/r300_hyperz.c index 6e0e1b5bf4c..79f7f8abe9b 100644 --- a/src/gallium/drivers/r300/r300_hyperz.c +++ b/src/gallium/drivers/r300/r300_hyperz.c @@ -44,10 +44,10 @@ static bool r300_get_sc_hz_max(struct r300_context *r300) { struct r300_dsa_state *dsa_state = r300->dsa_state.state; - int func = dsa_state->z_stencil_control & 0x7; + int func = dsa_state->z_stencil_control & R300_ZS_MASK; int ret = R300_SC_HYPERZ_MIN; - if (func >= 4 && func <= 7) + if (func >= R300_ZS_GEQUAL && func <= R300_ZS_ALWAYS) ret = R300_SC_HYPERZ_MAX; return ret; } @@ -55,23 +55,26 @@ static bool r300_get_sc_hz_max(struct r300_context *r300) static bool r300_zfunc_same_direction(int func1, int func2) { /* func1 is less/lessthan */ - if (func1 == 1 || func1 == 2) - if (func2 == 3 || func2 == 4 || func2 == 5) + if ((func1 == R300_ZS_LESS || func1 == R300_ZS_LEQUAL) && + (func2 == R300_ZS_EQUAL || func2 == R300_ZS_GEQUAL || + func2 == R300_ZS_GREATER)) return FALSE; - if (func2 == 1 || func2 == 2) - if (func1 == 4 || func1 == 5) + /* func1 is greater/greaterthan */ + if ((func1 == R300_ZS_GEQUAL || func1 == R300_ZS_GREATER) && + (func2 == R300_ZS_LESS || func2 == R300_ZS_LEQUAL)) return FALSE; + return TRUE; } static int r300_get_hiz_min(struct r300_context *r300) { struct r300_dsa_state *dsa_state = r300->dsa_state.state; - int func = dsa_state->z_stencil_control & 0x7; + int func = dsa_state->z_stencil_control & R300_ZS_MASK; int ret = R300_HIZ_MIN; - if (func == 1 || func == 2) + if (func == R300_ZS_LESS || func == R300_ZS_LEQUAL) ret = R300_HIZ_MAX; return ret; } @@ -112,13 +115,16 @@ static boolean r300_can_hiz(struct r300_context *r300) } /* depth comparison function - if just cleared save and return okay */ if (z->current_func == -1) { - int func = dsa_state->z_stencil_control & 0x7; + int func = dsa_state->z_stencil_control & R300_ZS_MASK; if (func != 0 && func != 7) - z->current_func = dsa_state->z_stencil_control & 0x7; + z->current_func = dsa_state->z_stencil_control & R300_ZS_MASK; } else { /* simple don't change */ - if (!r300_zfunc_same_direction(z->current_func, (dsa_state->z_stencil_control & 0x7))) { - DBG(r300, DBG_HYPERZ, "z func changed direction - disabling hyper-z %d -> %d\n", z->current_func, dsa_state->z_stencil_control); + if (!r300_zfunc_same_direction(z->current_func, + (dsa_state->z_stencil_control & R300_ZS_MASK))) { + DBG(r300, DBG_HYPERZ, + "z func changed direction - disabling hyper-z %d -> %d\n", + z->current_func, dsa_state->z_stencil_control); return FALSE; } } -- cgit v1.2.3 From d4c60575f87241e9f1d0227c02c036a4bcf0967d Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 10 Nov 2010 22:36:33 +0000 Subject: galahad: Correct the name of the scons library --- src/gallium/drivers/galahad/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/galahad/SConscript b/src/gallium/drivers/galahad/SConscript index 1343dfd4548..3f39f99e517 100644 --- a/src/gallium/drivers/galahad/SConscript +++ b/src/gallium/drivers/galahad/SConscript @@ -3,7 +3,7 @@ Import('*') env = env.Clone() galahad = env.ConvenienceLibrary( - target = 'identity', + target = 'galahad', source = [ 'glhd_context.c', 'glhd_objects.c', -- cgit v1.2.3 From 089056a5f327debb9df11c83742c5bf7a5a90c81 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Wed, 10 Nov 2010 23:10:25 +0100 Subject: nvfx: fill PIPE_CAP_PRIMITIVE_RESTART and PIPE_CAP_SHADER_STENCIL_EXPORT Signed-off-by: Lucas Stach Signed-off-by: Francisco Jerez --- src/gallium/drivers/nvfx/nvfx_screen.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c b/src/gallium/drivers/nvfx/nvfx_screen.c index 8024800bd09..3949cdaef9a 100644 --- a/src/gallium/drivers/nvfx/nvfx_screen.c +++ b/src/gallium/drivers/nvfx/nvfx_screen.c @@ -77,6 +77,10 @@ nvfx_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) return 1; case PIPE_CAP_DEPTH_CLAMP: return 0; // TODO: implement depth clamp + case PIPE_CAP_PRIMITIVE_RESTART: + return 0; // TODO: implement primitive restart + case PIPE_CAP_SHADER_STENCIL_EXPORT: + return 0; default: NOUVEAU_ERR("Warning: unknown PIPE_CAP %d\n", param); return 0; -- cgit v1.2.3 From 6baad55f157387d0bb44144680a96bc32280109f Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 11 Nov 2010 14:26:52 +0000 Subject: r600g: guard experimental s3tc code with R600_ENABLE_S3TC --- src/gallium/drivers/r600/r600_texture.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index ef5adaf6487..a590858c852 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -832,6 +832,15 @@ uint32_t r600_translate_texformat(enum pipe_format format, /* S3TC formats. TODO */ if (desc->layout == UTIL_FORMAT_LAYOUT_S3TC) { + static int r600_enable_s3tc = -1; + + if (r600_enable_s3tc == -1) + r600_enable_s3tc = + debug_get_bool_option("R600_ENABLE_S3TC", FALSE); + + if (!r600_enable_s3tc) + goto out_unknown; + switch (format) { case PIPE_FORMAT_DXT1_RGB: case PIPE_FORMAT_DXT1_RGBA: -- cgit v1.2.3 From 8a3c181e9cc761abb647a8e813f25e3fa4441a9a Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 11 Nov 2010 15:41:49 +0000 Subject: r600g: do not try to use staging resource for depth textures Currently r600_resource_copy_region() will turn these copies into transfers + memcpys, so to avoid recursion we must not turn those transfers back into blits. --- src/gallium/drivers/r600/r600_texture.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index a590858c852..56313e992d8 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -479,6 +479,15 @@ static boolean permit_hardware_blit(struct pipe_screen *screen, else bind = PIPE_BIND_RENDER_TARGET; + /* See r600_resource_copy_region: there is something wrong + * with depth resource copies at the moment so avoid them for + * now. + */ + if (util_format_get_component_bits(res->format, + UTIL_FORMAT_COLORSPACE_ZS, + 0) != 0) + return FALSE; + if (!screen->is_format_supported(screen, res->format, res->target, -- cgit v1.2.3 From 7fb16423cc325efcdcf6e4954a5ac71d8f96dbf8 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 11 Nov 2010 16:20:24 +0000 Subject: r600g: enforce minimum stride on render target texture images Fixes piglit/fbo_readpixels since staging upload changes. --- src/gallium/drivers/r600/r600_texture.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 56313e992d8..e719f7fb983 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -169,6 +169,10 @@ static unsigned r600_texture_get_stride(struct pipe_screen *screen, stride = util_format_get_stride(ptex->format, width); if (chipc == EVERGREEN) stride = align(stride, 512); + + if (ptex->bind & PIPE_BIND_RENDER_TARGET) + stride = align(stride, 512); + return stride; } -- cgit v1.2.3