Merge branch 'upstream-gallium-0.1' into nouveau-gallium-0.1

This commit is contained in:
Ben Skeggs 2008-02-27 00:34:31 +11:00
commit 68ef528862
143 changed files with 1902 additions and 16710 deletions

2
.gitignore vendored
View file

@ -1,5 +1,7 @@
*.a
*.o
*.pyc
*.pyo
*.so
*.sw[a-z]
*~

View file

@ -1,88 +0,0 @@
# Mesa 3-D graphics library
# Version: 4.0
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP makefile for Mesa
#
# Author: Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Available options:
#
# Environment variables:
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most DMesa code and requires fxMesa.
# As a consequence, you'll need the DJGPP Glide3
# library to build any application.
# default = no
# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
# default = no
#
# Targets:
# all: build everything
# libgl: build GL
# libglu: build GLU
# libglut: build GLUT
# clean: remove object files
# realclean: remove all generated files
#
.PHONY : all libgl libglu libglut clean realclean
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math
export CFLAGS
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
all: libgl libglu libglut
libgl: lib
$(MAKE) -f Makefile.DJ -C src/mesa
libglu: lib
$(MAKE) -f Makefile.DJ -C src/glu/sgi
libglut: lib
$(MAKE) -f Makefile.DJ -C src/glut/dos
lib:
mkdir lib
clean:
$(MAKE) -f Makefile.DJ clean -C src/mesa
$(MAKE) -f Makefile.DJ clean -C src/glu/mesa
$(MAKE) -f Makefile.DJ clean -C src/glu/sgi
$(MAKE) -f Makefile.DJ clean -C src/glut/dos
realclean: clean
-$(call UNLINK,lib/*.a)
-$(call UNLINK,lib/*.dxe)

View file

@ -1,110 +0,0 @@
# Mesa 3-D graphics library
# Version: 4.0
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# MinGW makefile v1.2 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Available options:
#
# Environment variables:
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most WMesa code and requires fxMesa.
# As a consequence, you'll need the Win32 Glide3
# library to build any application.
# default = no
# ICD=1 build the installable client driver interface
# (windows opengl driver interface)
# default = no
# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
# default = no
#
# Targets:
# all: build everything
# libgl: build GL
# clean: remove object files
# realclean: remove all generated files
#
# MinGW core makefile updated for Mesa 7.0
#
# Updated : by Heromyth, on 2007-7-21
# Email : zxpmyth@yahoo.com.cn
# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
# The others havn't been tested yet.
# 2) The generated DLLs are *not* compatible with the ones built
# with the other compilers like VC8, especially for GLUT.
# 3) MAlthough more tests are needed, it can be used individually!
.PHONY : all libgl clean realclean
ifeq ($(ICD),1)
# when -std=c99 mingw will not define WIN32
CFLAGS = -Wall -Werror
else
# I love c89
CFLAGS = -Wall -pedantic
endif
CFLAGS += -O2 -ffast-math
export CFLAGS
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
all: libgl libglu libglut example
libgl: lib
$(MAKE) -f Makefile.mgw -C src/mesa
libglu: libgl
$(MAKE) -f Makefile.mgw -C src/glu/sgi
libglut: libglu
$(MAKE) -f Makefile.mgw -C src/glut/glx
example: libglut
$(MAKE) -f Makefile.mgw star -C progs/samples
copy progs\samples\star.exe lib
lib:
mkdir lib
clean:
$(MAKE) -f Makefile.mgw clean -C src/mesa
$(MAKE) -f Makefile.mgw clean -C src/glu/sgi
$(MAKE) -f Makefile.mgw clean -C src/glut/glx
realclean: clean
-$(call UNLINK,lib/*.a)
-$(call UNLINK,lib/*.dll)

View file

@ -33,17 +33,53 @@ platform_map = {
'win32': 'winddk',
}
platform = platform_map.get(sys.platform, sys.platform)
default_platform = platform_map.get(sys.platform, sys.platform)
if default_platform in ('linux', 'freebsd', 'darwin'):
default_statetrackers = 'mesa'
default_drivers = 'softpipe,failover,i915simple,i965simple'
default_winsys = 'xlib'
default_dri = 'yes'
elif default_platform in ('winddk',):
default_statetrackers = 'none'
default_drivers = 'softpipe,i915simple'
default_winsys = 'none'
default_dri = 'no'
else:
default_drivers = 'all'
default_winsys = 'all'
default_dri = 'no'
# TODO: auto-detect defaults
opts = Options('config.py')
opts.Add(BoolOption('debug', 'build debug version', False))
opts.Add(BoolOption('dri', 'build dri drivers', False))
opts.Add(BoolOption('llvm', 'use llvm', False))
opts.Add(EnumOption('machine', 'use machine-specific assembly code', 'x86',
allowed_values=('generic', 'x86', 'x86-64')))
opts.Add(EnumOption('platform', 'target platform', platform,
opts.Add(EnumOption('platform', 'target platform', default_platform,
allowed_values=('linux', 'cell', 'winddk')))
opts.Add(ListOption('statetrackers', 'state_trackers to build', default_statetrackers,
[
'mesa',
],
))
opts.Add(ListOption('drivers', 'pipe drivers to build', default_drivers,
[
'softpipe',
'failover',
'i915simple',
'i965simple',
'cell',
],
))
opts.Add(ListOption('winsys', 'winsys drivers to build', default_winsys,
[
'xlib',
'intel',
],
))
opts.Add(BoolOption('llvm', 'use LLVM', 'no'))
opts.Add(BoolOption('dri', 'build DRI drivers', default_dri))
env = Environment(
options = opts,
@ -84,26 +120,14 @@ Export([
if platform == 'winddk':
import ntpath
escape = env['ESCAPE']
env.Tool('msvc')
if 'BASEDIR' in os.environ:
WINDDK = os.environ['BASEDIR']
else:
WINDDK = "C:\\WINDDK\\3790.1830"
# NOTE: We need this elaborate construct to get the absolute paths and
# forward slashes to msvc unharmed when cross compiling from posix platforms
env.Append(CPPFLAGS = [
escape('/I' + ntpath.join(WINDDK, 'inc\\ddk\\wxp')),
escape('/I' + ntpath.join(WINDDK, 'inc\\ddk\\wdm\\wxp')),
escape('/I' + ntpath.join(WINDDK, 'inc\\crt')),
])
env.Append(CPPDEFINES = [
('i386', '1'),
])
if debug:
env.Append(CPPDEFINES = ['DBG'])
env.Tool('winddk', ['.'])
env.Append(CPPPATH = [
env['SDK_INC_PATH'],
env['DDK_INC_PATH'],
env['WDM_INC_PATH'],
env['CRT_INC_PATH'],
])
# Optimization flags
if gcc:
@ -114,17 +138,41 @@ if gcc:
env.Append(CFLAGS = '-O3 -g3')
env.Append(CXXFLAGS = '-O3 -g3')
env.Append(CFLAGS = '-Wall -Wmissing-prototypes -std=c99 -ffast-math -pedantic')
env.Append(CFLAGS = '-Wall -Wmissing-prototypes -Wno-long-long -ffast-math -pedantic')
env.Append(CXXFLAGS = '-Wall -pedantic')
# Be nice to Eclipse
env.Append(CFLAGS = '-fmessage-length=0')
env.Append(CXXFLAGS = '-fmessage-length=0')
if msvc:
env.Append(CFLAGS = '/W3')
if debug:
cflags = [
'/Od', # disable optimizations
'/Oy-', # disable frame pointer omission
'/Zi', # enable enable debugging information
]
else:
cflags = [
'/Ox', # maximum optimizations
'/Os', # favor code space
'/Zi', # enable enable debugging information
]
env.Append(CFLAGS = cflags)
env.Append(CXXFLAGS = cflags)
# Defines
if debug:
env.Append(CPPDEFINES = ['DEBUG'])
if gcc:
env.Append(CPPDEFINES = ['DEBUG'])
if msvc:
env.Append(CPPDEFINES = [
('DBG', '1'),
('DEBUG', '1'),
('_DEBUG', '1'),
])
else:
env.Append(CPPDEFINES = ['NDEBUG'])
@ -192,7 +240,7 @@ if llvm:
# libGL
if 1:
if platform not in ('winddk',):
env.Append(LIBS = [
'X11',
'Xext',

View file

@ -1,42 +0,0 @@
# MinGW config include file updated for Mesa 7.0
#
# Updated : by Heromyth, on 2007-7-21
# Email : zxpmyth@yahoo.com.cn
# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
# The others havn't been tested yet.
# 2) The generated DLLs are *not* compatible with the ones built
# with the other compilers like VC8, especially for GLUT.
# 3) Although more tests are needed, it can be used individually!
# The generated DLLs by MingW with STDCALL are not totally compatible
# with the ones linked by Microsoft's compilers.
#
# xxx_USING_STDCALL = 1 Compiling MESA with __stdcall. This is default!
#
# xxx_USING_STDCALL = 0 Compiling MESA without __stdcall. I like this:)
#
# In fact, GL_USING_STDCALL and GLUT_USING_STDCALL can be
# different. For example:
#
# GL_USING_STDCALL = 0
# GLUT_USING_STDCALL = 1
#
# Suggested setting:
#
# ALL_USING_STDCALL = 1
#
# That's default!
#
ALL_USING_STDCALL = 1
ifeq ($(ALL_USING_STDCALL),1)
GL_USING_STDCALL = 1
GLUT_USING_STDCALL = 1
else
GL_USING_STDCALL = 0
GLUT_USING_STDCALL = 0
endif

View file

@ -1,22 +0,0 @@
# Makefile for Mesa for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
macro :
@ macro=""
.ifdef NOSHARE
.else
@ if f$getsyi("HW_MODEL") .ge. 1024 then macro= "/MACRO=(SHARE=1)"
.endif
$(MMS)$(MMSQUALIFIERS)'macro' all
all :
if f$search("lib.dir") .eqs. "" then create/directory [.lib]
set default [.src]
$(MMS)$(MMSQUALIFIERS)
set default [-.progs.util]
$(MMS)$(MMSQUALIFIERS)
set default [-.demos]
$(MMS)$(MMSQUALIFIERS)
set default [-.xdemos]
$(MMS)$(MMSQUALIFIERS)
if f$search("[-]tests.DIR") .nes. "" then pipe set default [-.tests] ; $(MMS)$(MMSQUALIFIERS)

View file

@ -479,8 +479,7 @@ WARN_LOGFILE =
INPUT = gallium.doc \
../src/gallium \
../src/mesa/state_tracker \
../src/mesa/x86/rtasm
../src/mesa/state_tracker
# This tag can be used to specify the character encoding of the source files that
# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default

View file

@ -1,23 +0,0 @@
# Makefile for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
#vms
.ifdef SHARE
GL_SHAR = libMesaGL.exe
GLU_SHAR = libMesaGLU.exe
GLUT_SHAR = libglut.exe
.endif
GL_LIB = libMesaGL.olb
GLU_LIB = libMesaGLU.olb
GLUT_LIB = libglut.olb
CC = cc
CXX = cxx/define=(LIBRARYBUILD=1)/assume=(nostdnew,noglobal_array_new)
CFLAGS1 =
MAKELIB = library/create
RANLIB = true
.ifdef SHARE
XLIBS = [--.vms]xlib_share/opt
.else
XLIBS = [--.vms]xlib/opt
.endif

View file

@ -1,90 +0,0 @@
# Makefile for GLUT-based demo programs for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
# Last update : 20 May 2005
.first
define gl [--.include.gl]
.include [--]mms.config
##### MACROS #####
INCDIR = ([--.include],[-.util])
CFLAGS =/include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm
.ifdef SHARE
GL_LIBS = $(XLIBS)
LIB_DEP = [--.lib]$(GL_SHAR) [--.lib]$(GLU_SHAR) [--.lib]$(GLUT_SHAR)
.else
GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS)
LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB)
.endif
PROGS = bounce.exe;,clearspd.exe;,drawpix.exe;,gamma.exe;,gears.exe;,\
glinfo.exe;,glutfx.exe;,isosurf.exe;,morph3d.exe;,\
paltex.exe;,pointblast.exe;,reflect.exe;,spectex.exe;,stex3d.exe;,\
tessdemo.exe;,texcyl.exe;,texobj.exe;,trispd.exe;,winpos.exe;
##### RULES #####
.obj.exe :
cxxlink $(MMS$TARGET_NAME),$(GL_LIBS)
##### TARGETS #####
default :
$(MMS)$(MMSQUALIFIERS) $(PROGS)
clean :
delete *.obj;*
realclean :
delete $(PROGS)
delete *.obj;*
bounce.exe; : bounce.obj $(LIB_DEP)
clearspd.exe; : clearspd.obj $(LIB_DEP)
drawpix.exe; : drawpix.obj $(LIB_DEP) [-.util]readtex.obj
cxxlink $(MMS$TARGET_NAME),[-.util]readtex.obj,$(GL_LIBS)
gamma.exe; : gamma.obj $(LIB_DEP)
gears.exe; : gears.obj $(LIB_DEP)
glinfo.exe; : glinfo.obj $(LIB_DEP)
glutfx.exe; : glutfx.obj $(LIB_DEP)
isosurf.exe; : isosurf.obj $(LIB_DEP) [-.util]readtex.obj
cxxlink $(MMS$TARGET_NAME),[-.util]readtex.obj,$(GL_LIBS)
morph3d.exe; : morph3d.obj $(LIB_DEP)
paltex.exe; : paltex.obj $(LIB_DEP)
pointblast.exe; : pointblast.obj $(LIB_DEP)
reflect.exe; : reflect.obj [-.util]readtex.obj [-.util]showbuffer.obj\
$(LIB_DEP)
cxxlink $(MMS$TARGET_NAME),[-.util]readtex,showbuffer,$(GL_LIBS)
spectex.exe; : spectex.obj $(LIB_DEP)
stex3d.exe; : stex3d.obj $(LIB_DEP)
tessdemo.exe; : tessdemo.obj $(LIB_DEP)
texcyl.exe; : texcyl.obj [-.util]readtex.obj $(LIB_DEP)
cxxlink $(MMS$TARGET_NAME),[-.util]readtex.obj,$(GL_LIBS)
texobj.exe; : texobj.obj $(LIB_DEP)
trispd.exe; : trispd.obj $(LIB_DEP)
winpos.exe; : winpos.obj [-.util]readtex.obj $(LIB_DEP)
cxxlink $(MMS$TARGET_NAME),[-.util]readtex.obj,$(GL_LIBS)
bounce.obj : bounce.c
clearspd.obj : clearspd.c
drawpix.obj : drawpix.c
gamma.obj : gamma.c
gears.obj : gears.c
glinfo.obj : glinfo.c
glutfx.obj : glutfx.c
isosurf.obj : isosurf.c
morph3d.obj : morph3d.c
paltex.obj : paltex.c
pointblast.obj : pointblast.c
reflect.obj : reflect.c
spectex.obj : spectex.c
stex3d.obj : stex3d.c
tessdemo.obj : tessdemo.c
texcyl.obj : texcyl.c
texobj.obj : texobj.c
trispd.obj : trispd.c
winpos.obj : winpos.c

View file

@ -1,85 +0,0 @@
# Mesa 3-D graphics library
# Version: 4.0
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP samples makefile v1.6 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Available options:
#
# Environment variables:
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most DMesa code and requires fxMesa.
# As a consequence, you'll need the DJGPP Glide3
# library to build any application.
# default = no
# DXE=1 use DXE modules (see README.DJ for details).
# default = no
#
# Targets:
# <file.exe> build a specific file
#
.PHONY: all
.SUFFIXES: .c .o .exe
.SECONDARY: ../util/readtex.o ../util/showbuffer.o
TOP = ../..
GLIDE ?= $(TOP)/glide3
CC = gcc
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math
CFLAGS += -I$(TOP)/include -I../util
CFLAGS += -DGLUT_IMPORT_LIB
ifeq ($(FX),1)
CFLAGS += -DFX
endif
LD = gxx
LDFLAGS = -s -L$(TOP)/lib
ifeq ($(DXE),1)
LDLIBS += -liglut -liglu -ligl
else
LDLIBS = -lglut -lglu -lgl
ifeq ($(FX),1)
LDFLAGS += -L$(GLIDE)/lib
LDLIBS += -lgld3x
endif
endif
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
%.exe: ../util/readtex.o ../util/showbuffer.o %.o
$(LD) -o $@ $(LDFLAGS) $^ $(LDLIBS)
all:
$(error Must specify <filename.exe> to build)

View file

@ -1,93 +0,0 @@
# Mesa 3-D graphics library
# Version: 4.0
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# MinGW samples makefile v1.2 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
# MinGW samples makefile updated for Mesa 7.0
#
# Updated : by Heromyth, on 2007-7-21
# Email : zxpmyth@yahoo.com.cn
# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
# The others havn't been tested yet.
# 2) The generated DLLs are *not* compatible with the ones built
# with the other compilers like VC8, especially for GLUT.
# 3) Although more tests are needed, it can be used individually!
#
# Available options:
#
# Environment variables:
#
# Targets:
# <file.exe> build a specific file
#
.PHONY: all
.SUFFIXES: .c .o .exe
.SECONDARY: ../util/readtex.o ../util/showbuffer.o
TOP = ../..
include $(TOP)/configs/config.mgw
ALL_USING_STDCALL ?= 1
GL_USING_STDCALL ?= 1
GLUT_USING_STDCALL ?= 1
CC = mingw32-gcc
CFLAGS = -Wall -pedantic
CFLAGS += -O2 -ffast-math
CFLAGS += -I$(TOP)/include -I../util
ifeq ($(FX),1)
CFLAGS += -DFX
endif
CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK
ifeq ($(GL_USING_STDCALL),0)
CFLAGS += -DGL_NO_STDCALL
endif
ifeq ($(GLUT_USING_STDCALL),1)
CFLAGS += -D_STDCALL_SUPPORTED
else
CFLAGS += -DGLUT_NO_STDCALL
endif
LD = mingw32-g++
LDFLAGS = -s -L$(TOP)/lib
LDLIBS = -lglut32 -lglu32 -lopengl32
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
%.exe: ../util/readtex.o ../util/showbuffer.o %.o
$(LD) -o $@ $(LDFLAGS) $^ $(LDLIBS)
all:
$(error Must specify <filename.exe> to build)

View file

@ -1,84 +0,0 @@
# Makefile for GLUT-based demo programs for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
.first
define gl [--.include.gl]
.include [--]mms.config
##### MACROS #####
INCDIR = ([--.include],[-.util])
CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm
.ifdef SHARE
GL_LIBS = $(XLIBS)
.else
GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS)
.endif
LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB)
PROGS = cva.exe,\
dinoshade.exe,\
fogcoord.exe,\
manytex.exe,\
multipal.exe,\
projtex.exe,\
seccolor.exe,\
sharedtex.exe,\
texline.exe,\
texwrap.exe,\
vptest1.exe,\
vptest2.exe,\
vptest3.exe,\
vptorus.exe,\
vpwarpmesh.exe
##### RULES #####
.obj.exe :
cxxlink $(MMS$TARGET_NAME),$(GL_LIBS)
##### TARGETS #####
default :
$(MMS)$(MMSQUALIFIERS) $(PROGS)
clean :
delete *.obj;*
realclean :
delete $(PROGS)
delete *.obj;*
cva.exe : cva.obj $(LIB_DEP)
dinoshade.exe : dinoshade.obj $(LIB_DEP)
fogcoord.exe : fogcoord.obj $(LIB_DEP)
manytex.exe : manytex.obj $(LIB_DEP)
multipal.exe : multipal.obj $(LIB_DEP)
projtex.exe : projtex.obj $(LIB_DEP)
seccolor.exe : seccolor.obj $(LIB_DEP)
sharedtex.exe : sharedtex.obj $(LIB_DEP)
texline.exe : texline.obj $(LIB_DEP)
texwrap.exe : texwrap.obj $(LIB_DEP)
vptest1.exe : vptest1.obj $(LIB_DEP)
vptest2.exe : vptest2.obj $(LIB_DEP)
vptest3.exe : vptest3.obj $(LIB_DEP)
vptorus.exe : vptorus.obj $(LIB_DEP)
vpwarpmesh.exe : vpwarpmesh.obj $(LIB_DEP)
cva.obj : cva.c
dinoshade.obj : dinoshade.c
fogcoord.obj : fogcoord.c
manytex.obj : manytex.c
multipal.obj : multipal.c
projtex.obj : projtex.c
seccolor.obj : seccolor.c
sharedtex.obj : sharedtex.c
texline.obj : texline.c
texwrap.obj : texwrap.c
vptest1.obj : vptest1.c
vptest2.obj : vptest2.c
vptest3.obj : vptest3.c
vptorus.obj : vptorus.c
vpwarpmesh.obj : vpwarpmesh.c

View file

@ -27,6 +27,7 @@ linestrip
linestrip-flat-stipple
linestrip-stipple
linestrip-stipple-wide
pgon-mode
point
point-clip
point-param

View file

@ -25,6 +25,7 @@ SOURCES = \
fs-tri.c \
line-clip.c \
line-cull.c \
line-smooth.c \
line-stipple-wide.c \
line-userclip-clip.c \
line-userclip-nop-clip.c \

172
progs/trivial/line-smooth.c Normal file
View file

@ -0,0 +1,172 @@
/*
* Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the name of
* Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
* ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <GL/glut.h>
#define CI_OFFSET_1 16
#define CI_OFFSET_2 32
GLenum doubleBuffer;
GLboolean smooth = GL_TRUE;
GLfloat width = 1.0;
static void Init(void)
{
float range[2], aarange[2];
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
glGetFloatv(GL_LINE_WIDTH_RANGE, aarange);
glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, range);
printf("Non-AA line width range: %f .. %f\n", range[0], range[1]);
printf("AA line width range: %f .. %f\n", aarange[0], aarange[1]);
}
static void Reshape(int width, int height)
{
glViewport(0, 0, (GLint)width, (GLint)height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0, 0, -30);
}
static void Key(unsigned char key, int x, int y)
{
switch (key) {
case 'w':
width -= 0.5;
if (width < 0.5)
width = 0.5;
break;
case 'W':
width += 0.5;
break;
case 's':
smooth = !smooth;
break;
case 27:
exit(1);
default:
return;
}
printf("LineWidth: %g\n", width);
glutPostRedisplay();
}
static void Draw(void)
{
float a;
glClear(GL_COLOR_BUFFER_BIT);
glLineWidth(width);
if (smooth) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
}
glColor3f(1, 1, 1);
glBegin(GL_LINES);
for (a = 0; a < 3.14159; a += 0.2) {
float x = .9 * cos(a);
float y = .9 * sin(a);
glVertex2f(-x, -y);
glVertex2f( x, y);
}
glEnd();
glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);
glFlush();
if (doubleBuffer) {
glutSwapBuffers();
}
}
static GLenum Args(int argc, char **argv)
{
GLint i;
doubleBuffer = GL_FALSE;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-sb") == 0) {
doubleBuffer = GL_FALSE;
} else if (strcmp(argv[i], "-db") == 0) {
doubleBuffer = GL_TRUE;
} else {
fprintf(stderr, "%s (Bad option).\n", argv[i]);
return GL_FALSE;
}
}
return GL_TRUE;
}
int main(int argc, char **argv)
{
GLenum type;
glutInit(&argc, argv);
if (Args(argc, argv) == GL_FALSE) {
exit(1);
}
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
type = GLUT_RGB;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
if (glutCreateWindow(argv[0]) == GL_FALSE) {
exit(1);
}
Init();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
return 0;
}

View file

@ -1,42 +0,0 @@
# Makefile for GLUT-based demo programs for VMS
# contributed by Jouk Jansen joukj@crys.chem.uva.nl
.first
define gl [--.include.gl]
.include [--]mms.config
##### MACROS #####
INCDIR = ([--.include],[-.util])
CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm
.ifdef SHARE
GL_LIBS = $(XLIBS)
LIB_DEP = [--.lib]$(GL_SHAR) [--.lib]$(GLU_SHAR) [--.lib]$(GLUT_SHAR)
.else
GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS)
LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB)
.endif
OBJS =readtex.obj,showbuffer.obj
##### RULES #####
.obj.exe :
cxxlink $(MMS$TARGET_NAME),$(GL_LIBS)
##### TARGETS #####
default :
$(MMS)$(MMSQUALIFIERS) $(OBJS)
clean :
delete *.obj;*
realclean :
delete *.obj;*
readtex.obj : readtex.c
showbuffer.obj : showbuffer.c

View file

@ -1,83 +0,0 @@
# Makefile for GLUT-based demo programs for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
.first
define gl [--.include.gl]
.include [--]mms.config
##### MACROS #####
INCDIR = ([--.include],[-.util])
CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)/nowarn/float=ieee/ieee=denorm
.ifdef SHARE
GL_LIBS = $(XLIBS)
.else
GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS)
.endif
LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB)
PROGS =glthreads.exe,\
glxdemo.exe,\
glxgears.exe,\
glxheads.exe,\
glxinfo.exe,\
glxpixmap.exe,\
manywin.exe,\
offset.exe,\
pbinfo.exe,\
pbdemo.exe,\
wincopy.exe,\
xdemo.exe,\
xfont.exe
##### RULES #####
.obj.exe :
cxxlink $(MMS$TARGET_NAME),$(GL_LIBS)
##### TARGETS #####
default :
$(MMS)$(MMSQUALIFIERS) $(PROGS)
clean :
delete *.obj;*
realclean :
delete $(PROGS)
delete *.obj;*
glthreads.exe : glthreads.obj $(LIB_DEP)
glxdemo.exe : glxdemo.obj $(LIB_DEP)
glxgears.exe : glxgears.obj $(LIB_DEP)
glxheads.exe : glxheads.obj $(LIB_DEP)
glxinfo.exe : glxinfo.obj $(LIB_DEP)
glxpixmap.exe : glxpixmap.obj $(LIB_DEP)
manywin.exe : manywin.obj $(LIB_DEP)
offset.exe : offset.obj $(LIB_DEP)
pbinfo.exe : pbinfo.obj pbutil.obj $(LIB_DEP)
cxxlink pbinfo.obj,pbutil.obj,$(GL_LIBS)
pbdemo.exe : pbdemo.obj pbutil.obj $(LIB_DEP)
cxxlink pbdemo.obj,pbutil.obj,$(GL_LIBS)
wincopy.exe : wincopy.obj $(LIB_DEP)
xdemo.exe : xdemo.obj $(LIB_DEP)
xfont.exe :xfont.obj $(LIB_DEP)
glthreads.obj : glthreads.c
glxdemo.obj : glxdemo.c
glxgears.obj : glxgears.c
glxheads.obj : glxheads.c
glxinfo.obj : glxinfo.c
glxpixmap.obj : glxpixmap.c
manywin.obj : manywin.c
offset.obj : offset.c
pbinfo.obj : pbinfo.c
pbutil.obj : pbutil.c
pbdemo.obj : pbdemo.c
wincopy.obj : wincopy.c
xdemo.obj : xdemo.c
xfont.obj :xfont.c

View file

@ -1,7 +1,8 @@
Import('*')
SConscript([
'gallium/SConscript',
'mesa/SConscript',
'gallium/winsys/SConscript',
])
SConscript('gallium/SConscript')
if 'mesa' in env['statetrackers']:
SConscript('mesa/SConscript')
SConscript('gallium/winsys/SConscript')

View file

@ -1,43 +0,0 @@
# Makefile for Mesa for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
.include [-]mms.config
all :
set default [.mesa]
$(MMS)$(MMSQUALIFIERS)
set default [-]
.ifdef SHARE
$(MMS)$(MMSQUALIFIERS) [-.lib]$(GL_SHAR)
.endif
set default [.glu]
$(MMS)$(MMSQUALIFIERS)
set default [-.glut.glx]
$(MMS)$(MMSQUALIFIERS)
set default [--]
[-.lib]$(GL_SHAR) : [-.lib]$(GL_LIB)
@ WRITE_ SYS$OUTPUT " generating libmesa.opt"
@ library/extract=* [-.lib]$(GL_LIB)
@ OPEN_/WRITE FILE libmesa.opt
@ WRITE_ FILE "!"
@ WRITE_ FILE "! libmesa.opt generated by DESCRIP.$(MMS_EXT)"
@ WRITE_ FILE "!"
@ WRITE_ FILE "IDENTIFICATION=""mesa5.1"""
@ WRITE_ FILE "GSMATCH=LEQUAL,5,1
@ WRITE_ FILE "libmesagl.obj"
@ write_ file "sys$share:decw$xextlibshr/share"
@ write_ file "sys$share:decw$xlibshr/share"
@ write_ file "sys$share:pthread$rtl/share"
@ CLOSE_ FILE
@ $(MMS)$(MMSQUALIFIERS)/ignore=warning mesa_vms
@ WRITE_ SYS$OUTPUT " linking ..."
@ LINK_/NODEB/SHARE=[-.lib]$(GL_SHAR)/MAP=libmesa.map/FULL libmesa.opt/opt,\
mesa_vms.opt/opt
@ delete libmesagl.obj;*
mesa_vms :
@ WRITE_ SYS$OUTPUT " generating libmesa.map ..."
@ LINK_/NODEB/NOSHARE/NOEXE/MAP=libmesa.map/FULL libmesa.opt/OPT
@ WRITE_ SYS$OUTPUT " analyzing libmesa.map ..."
@ @[-.vms]analyze_map.com libmesa.map mesa_vms.opt

View file

@ -1,3 +1,5 @@
import os
Import('*')
env = env.Clone()
@ -20,10 +22,5 @@ SConscript([
if llvm:
SConscript(['auxiliary/gallivm/SConscript'])
SConscript([
'drivers/softpipe/SConscript',
'drivers/i915simple/SConscript',
'drivers/i965simple/SConscript',
'drivers/failover/SConscript',
#'drivers/cell/SConscript',
])
for driver in env['drivers']:
SConscript(os.path.join('drivers', driver, 'SConscript'))

View file

@ -28,9 +28,22 @@
/* Authors: Zack Rusin <zack@tungstengraphics.com>
*/
#include "pipe/p_util.h"
#include "cso_cache.h"
#include "cso_hash.h"
struct cso_cache {
struct cso_hash *blend_hash;
struct cso_hash *depth_stencil_hash;
struct cso_hash *fs_hash;
struct cso_hash *vs_hash;
struct cso_hash *rasterizer_hash;
struct cso_hash *sampler_hash;
int max_size;
};
#if 1
static unsigned hash_key(const void *key, unsigned key_size)
{
@ -114,12 +127,106 @@ static int _cso_size_for_type(enum cso_cache_type type)
return 0;
}
static void delete_blend_state(void *state, void *data)
{
struct cso_blend *cso = (struct cso_blend *)state;
if (cso->delete_state && cso->data != &cso->state)
cso->delete_state(cso->context, cso->data);
}
static void delete_depth_stencil_state(void *state, void *data)
{
struct cso_depth_stencil_alpha *cso = (struct cso_depth_stencil_alpha *)state;
if (cso->delete_state && cso->data != &cso->state)
cso->delete_state(cso->context, cso->data);
}
static void delete_sampler_state(void *state, void *data)
{
struct cso_sampler *cso = (struct cso_sampler *)state;
if (cso->delete_state && cso->data != &cso->state)
cso->delete_state(cso->context, cso->data);
}
static void delete_rasterizer_state(void *state, void *data)
{
struct cso_rasterizer *cso = (struct cso_rasterizer *)state;
if (cso->delete_state && cso->data != &cso->state)
cso->delete_state(cso->context, cso->data);
}
static void delete_fs_state(void *state, void *data)
{
struct cso_fragment_shader *cso = (struct cso_fragment_shader *)state;
if (cso->delete_state && cso->data != &cso->state)
cso->delete_state(cso->context, cso->data);
}
static void delete_vs_state(void *state, void *data)
{
struct cso_vertex_shader *cso = (struct cso_vertex_shader *)state;
if (cso->delete_state && cso->data != &cso->state)
cso->delete_state(cso->context, cso->data);
}
static INLINE void delete_cso(void *state, enum cso_cache_type type)
{
switch (type) {
case CSO_BLEND: {
delete_blend_state(state, 0);
}
break;
case CSO_SAMPLER: {
delete_sampler_state(state, 0);
}
break;
case CSO_DEPTH_STENCIL_ALPHA: {
delete_depth_stencil_state(state, 0);
}
break;
case CSO_RASTERIZER: {
delete_rasterizer_state(state, 0);
}
break;
case CSO_FRAGMENT_SHADER: {
delete_fs_state(state, 0);
}
break;
case CSO_VERTEX_SHADER: {
delete_vs_state(state, 0);
}
break;
}
FREE(state);
}
static INLINE void sanitize_hash(struct cso_hash *hash, enum cso_cache_type type,
int max_size)
{
/* if we're approach the maximum size, remove fourth of the entries
* otherwise every subsequent call will go through the same */
int max_entries = (max_size > cso_hash_size(hash)) ? max_size : cso_hash_size(hash);
int to_remove = (max_size < max_entries) * max_entries/4;
while (to_remove) {
/*remove elements until we're good */
/*fixme: currently we pick the nodes to remove at random*/
struct cso_hash_iter iter = cso_hash_first_node(hash);
void *cso = cso_hash_take(hash, cso_hash_iter_key(iter));
delete_cso(cso, type);
--to_remove;
}
}
struct cso_hash_iter
cso_insert_state(struct cso_cache *sc,
unsigned hash_key, enum cso_cache_type type,
void *state)
{
struct cso_hash *hash = _cso_hash_for_type(sc, type);
sanitize_hash(hash, type, sc->max_size);
return cso_hash_insert(hash, hash_key, state);
}
@ -132,6 +239,26 @@ cso_find_state(struct cso_cache *sc,
return cso_hash_find(hash, hash_key);
}
void *cso_hash_find_data_from_template( struct cso_hash *hash,
unsigned hash_key,
void *templ,
int size )
{
struct cso_hash_iter iter = cso_hash_find(hash, hash_key);
while (!cso_hash_iter_is_null(iter)) {
void *iter_data = cso_hash_iter_data(iter);
if (!memcmp(iter_data, templ, size)) {
/* Return the payload:
*/
return (unsigned char *)iter_data + size;
}
iter = cso_hash_iter_next(iter);
}
return NULL;
}
struct cso_hash_iter cso_find_state_template(struct cso_cache *sc,
unsigned hash_key, enum cso_cache_type type,
void *templ)
@ -156,8 +283,9 @@ void * cso_take_state(struct cso_cache *sc,
struct cso_cache *cso_cache_create(void)
{
struct cso_cache *sc = malloc(sizeof(struct cso_cache));
struct cso_cache *sc = MALLOC_STRUCT(cso_cache);
sc->max_size = 4096;
sc->blend_hash = cso_hash_create();
sc->sampler_hash = cso_hash_create();
sc->depth_stencil_hash = cso_hash_create();
@ -168,14 +296,78 @@ struct cso_cache *cso_cache_create(void)
return sc;
}
void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type,
cso_state_callback func, void *user_data)
{
struct cso_hash *hash = 0;
struct cso_hash_iter iter;
switch (type) {
case CSO_BLEND:
hash = sc->blend_hash;
break;
case CSO_SAMPLER:
hash = sc->sampler_hash;
break;
case CSO_DEPTH_STENCIL_ALPHA:
hash = sc->depth_stencil_hash;
break;
case CSO_RASTERIZER:
hash = sc->rasterizer_hash;
break;
case CSO_FRAGMENT_SHADER:
hash = sc->fs_hash;
break;
case CSO_VERTEX_SHADER:
hash = sc->vs_hash;
break;
}
iter = cso_hash_first_node(hash);
while (!cso_hash_iter_is_null(iter)) {
void *state = cso_hash_iter_data(iter);
if (state) {
func(state, user_data);
}
iter = cso_hash_iter_next(iter);
}
}
void cso_cache_delete(struct cso_cache *sc)
{
assert(sc);
/* delete driver data */
cso_for_each_state(sc, CSO_BLEND, delete_blend_state, 0);
cso_for_each_state(sc, CSO_DEPTH_STENCIL_ALPHA, delete_depth_stencil_state, 0);
cso_for_each_state(sc, CSO_FRAGMENT_SHADER, delete_fs_state, 0);
cso_for_each_state(sc, CSO_VERTEX_SHADER, delete_vs_state, 0);
cso_for_each_state(sc, CSO_RASTERIZER, delete_rasterizer_state, 0);
cso_for_each_state(sc, CSO_SAMPLER, delete_sampler_state, 0);
cso_hash_delete(sc->blend_hash);
cso_hash_delete(sc->sampler_hash);
cso_hash_delete(sc->depth_stencil_hash);
cso_hash_delete(sc->rasterizer_hash);
cso_hash_delete(sc->fs_hash);
cso_hash_delete(sc->vs_hash);
free(sc);
FREE(sc);
}
void cso_set_maximum_cache_size(struct cso_cache *sc, int number)
{
sc->max_size = number;
sanitize_hash(sc->blend_hash, CSO_BLEND, sc->max_size);
sanitize_hash(sc->depth_stencil_hash, CSO_DEPTH_STENCIL_ALPHA,
sc->max_size);
sanitize_hash(sc->fs_hash, CSO_FRAGMENT_SHADER, sc->max_size);
sanitize_hash(sc->vs_hash, CSO_VERTEX_SHADER, sc->max_size);
sanitize_hash(sc->rasterizer_hash, CSO_RASTERIZER, sc->max_size);
sanitize_hash(sc->sampler_hash, CSO_SAMPLER, sc->max_size);
}
int cso_maximum_cache_size(const struct cso_cache *sc)
{
return sc->max_size;
}

View file

@ -1,6 +1,6 @@
/**************************************************************************
*
* Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@ -25,9 +25,48 @@
*
**************************************************************************/
/*
* Authors:
* Zack Rusin <zack@tungstengraphics.com>
/**
* @file
* Constant State Object (CSO) cache.
*
* The basic idea is that the states are created via the
* create_state/bind_state/delete_state semantics. The driver is expected to
* perform as much of the Gallium state translation to whatever its internal
* representation is during the create call. Gallium then has a caching
* mechanism where it stores the created states. When the pipeline needs an
* actual state change, a bind call is issued. In the bind call the driver
* gets its already translated representation.
*
* Those semantics mean that the driver doesn't do the repeated translations
* of states on every frame, but only once, when a new state is actually
* created.
*
* Even on hardware that doesn't do any kind of state cache, it makes the
* driver look a lot neater, plus it avoids all the redundant state
* translations on every frame.
*
* Currently our constant state objects are:
* - alpha test
* - blend
* - depth stencil
* - fragment shader
* - rasterizer (old setup)
* - sampler
* - vertex shader
*
* Things that are not constant state objects include:
* - blend_color
* - clip_state
* - clear_color_state
* - constant_buffer
* - feedback_state
* - framebuffer_state
* - polygon_stipple
* - scissor_state
* - texture_state
* - viewport_state
*
* @author Zack Rusin <zack@tungstengraphics.com>
*/
#ifndef CSO_CACHE_H
@ -36,46 +75,57 @@
#include "pipe/p_context.h"
#include "pipe/p_state.h"
/* cso_hash.h is necessary for cso_hash_iter, as MSVC requires structures
* returned by value to be fully defined */
#include "cso_hash.h"
struct cso_hash;
struct cso_cache {
struct cso_hash *blend_hash;
struct cso_hash *depth_stencil_hash;
struct cso_hash *fs_hash;
struct cso_hash *vs_hash;
struct cso_hash *rasterizer_hash;
struct cso_hash *sampler_hash;
};
#ifdef __cplusplus
extern "C" {
#endif
struct cso_cache;
struct cso_blend {
struct pipe_blend_state state;
void *data;
void (*delete_state)(void *, void *);
void *context;
};
struct cso_depth_stencil_alpha {
struct pipe_depth_stencil_alpha_state state;
void *data;
void (*delete_state)(void *, void *);
void *context;
};
struct cso_rasterizer {
struct pipe_rasterizer_state state;
void *data;
void (*delete_state)(void *, void *);
void *context;
};
struct cso_fragment_shader {
struct pipe_shader_state state;
void *data;
void (*delete_state)(void *, void *);
void *context;
};
struct cso_vertex_shader {
struct pipe_shader_state state;
void *data;
void (*delete_state)(void *, void *);
void *context;
};
struct cso_sampler {
struct pipe_sampler_state state;
void *data;
void (*delete_state)(void *, void *);
void *context;
};
@ -88,6 +138,8 @@ enum cso_cache_type {
CSO_VERTEX_SHADER
};
typedef void (*cso_state_callback)(void *, void *);
unsigned cso_construct_key(void *item, int item_size);
struct cso_cache *cso_cache_create(void);
@ -101,7 +153,16 @@ struct cso_hash_iter cso_find_state(struct cso_cache *sc,
struct cso_hash_iter cso_find_state_template(struct cso_cache *sc,
unsigned hash_key, enum cso_cache_type type,
void *templ);
void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type,
cso_state_callback func, void *user_data);
void * cso_take_state(struct cso_cache *sc, unsigned hash_key,
enum cso_cache_type type);
void cso_set_maximum_cache_size(struct cso_cache *sc, int number);
int cso_maximum_cache_size(const struct cso_cache *sc);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -30,12 +30,10 @@
* Zack Rusin <zack@tungstengraphics.com>
*/
#include "cso_hash.h"
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "cso_hash.h"
#define MAX(a, b) ((a > b) ? (a) : (b))
@ -98,7 +96,7 @@ struct cso_hash {
static void *cso_data_allocate_node(struct cso_hash_data *hash)
{
return malloc(hash->nodeSize);
return MALLOC(hash->nodeSize);
}
static void cso_data_free_node(struct cso_node *node)
@ -107,10 +105,10 @@ static void cso_data_free_node(struct cso_node *node)
* Need to cast value ptr to original cso type, then free the
* driver-specific data hanging off of it. For example:
struct cso_sampler *csamp = (struct cso_sampler *) node->value;
free(csamp->data);
FREE(csamp->data);
*/
free(node->value);
free(node);
FREE(node->value);
FREE(node);
}
static struct cso_node *
@ -134,7 +132,7 @@ static void cso_data_rehash(struct cso_hash_data *hash, int hint)
hint = countBits(-hint);
if (hint < MinNumBits)
hint = MinNumBits;
hash->userNumBits = hint;
hash->userNumBits = (short)hint;
while (primeForNumBits(hint) < (hash->size >> 1))
++hint;
} else if (hint < MinNumBits) {
@ -147,9 +145,9 @@ static void cso_data_rehash(struct cso_hash_data *hash, int hint)
int oldNumBuckets = hash->numBuckets;
int i = 0;
hash->numBits = hint;
hash->numBits = (short)hint;
hash->numBuckets = primeForNumBits(hint);
hash->buckets = malloc(sizeof(struct cso_node*) * hash->numBuckets);
hash->buckets = MALLOC(sizeof(struct cso_node*) * hash->numBuckets);
for (i = 0; i < hash->numBuckets; ++i)
hash->buckets[i] = e;
@ -173,7 +171,7 @@ static void cso_data_rehash(struct cso_hash_data *hash, int hint)
firstNode = afterLastNode;
}
}
free(oldBuckets);
FREE(oldBuckets);
}
}
@ -235,13 +233,13 @@ struct cso_hash_iter cso_hash_insert(struct cso_hash *hash,
struct cso_hash * cso_hash_create(void)
{
struct cso_hash *hash = malloc(sizeof(struct cso_hash));
hash->data.d = malloc(sizeof(struct cso_hash_data));
struct cso_hash *hash = MALLOC_STRUCT(cso_hash);
hash->data.d = MALLOC_STRUCT(cso_hash_data);
hash->data.d->fakeNext = 0;
hash->data.d->buckets = 0;
hash->data.d->size = 0;
hash->data.d->nodeSize = sizeof(struct cso_node);
hash->data.d->userNumBits = MinNumBits;
hash->data.d->userNumBits = (short)MinNumBits;
hash->data.d->numBits = 0;
hash->data.d->numBuckets = 0;
@ -261,9 +259,9 @@ void cso_hash_delete(struct cso_hash *hash)
cur = next;
}
}
free(hash->data.d->buckets);
free(hash->data.d);
free(hash);
FREE(hash->data.d->buckets);
FREE(hash->data.d);
FREE(hash);
}
struct cso_hash_iter cso_hash_find(struct cso_hash *hash,
@ -301,7 +299,7 @@ static struct cso_node *cso_hash_data_next(struct cso_node *node)
a.next = node->next;
if (!a.next) {
fprintf(stderr, "iterating beyond the last element\n");
debug_printf("iterating beyond the last element\n");
return 0;
}
if (a.next->next)
@ -352,7 +350,7 @@ static struct cso_node *cso_hash_data_prev(struct cso_node *node)
--bucket;
--start;
}
fprintf(stderr, "iterating backward beyond first element\n");
debug_printf("iterating backward beyond first element\n");
return a.e;
}
@ -397,3 +395,8 @@ struct cso_hash_iter cso_hash_first_node(struct cso_hash *hash)
struct cso_hash_iter iter = {hash, cso_data_first_node(hash->data.d)};
return iter;
}
int cso_hash_size(struct cso_hash *hash)
{
return hash->data.d->size;
}

View file

@ -33,6 +33,11 @@
#ifndef CSO_HASH_H
#define CSO_HASH_H
#ifdef __cplusplus
extern "C" {
#endif
struct cso_hash;
struct cso_node;
@ -42,7 +47,9 @@ struct cso_hash_iter {
};
struct cso_hash *cso_hash_create(void);
void cso_hash_delete(struct cso_hash *hash);
void cso_hash_delete(struct cso_hash *hash);
int cso_hash_size(struct cso_hash *hash);
struct cso_hash_iter cso_hash_insert(struct cso_hash *hash, unsigned key,
void *data);
@ -59,4 +66,17 @@ void *cso_hash_iter_data(struct cso_hash_iter iter);
struct cso_hash_iter cso_hash_iter_next(struct cso_hash_iter iter);
struct cso_hash_iter cso_hash_iter_prev(struct cso_hash_iter iter);
/* KW: a convenience routine:
*/
void *cso_hash_find_data_from_template( struct cso_hash *hash,
unsigned hash_key,
void *templ,
int size );
#ifdef __cplusplus
}
#endif
#endif

View file

@ -3,6 +3,8 @@ Import('*')
draw = env.ConvenienceLibrary(
target = 'draw',
source = [
'draw_aaline.c',
'draw_aapoint.c',
'draw_clip.c',
'draw_vs_exec.c',
'draw_vs_sse.c',
@ -13,6 +15,7 @@ draw = env.ConvenienceLibrary(
'draw_flatshade.c',
'draw_offset.c',
'draw_prim.c',
'draw_pstipple.c',
'draw_stipple.c',
'draw_twoside.c',
'draw_unfilled.c',

View file

@ -222,7 +222,7 @@ aa_transform_inst(struct tgsi_transform_context *ctx,
*
* Temp reg0 usage:
* t0.x = distance of fragment from center point
* t0.y = boolean, is t0.x > 1 ?
* t0.y = boolean, is t0.x > 1.0, also misc temp usage
* t0.z = temporary for computing 1/(1-k) value
* t0.w = final coverage value
*/
@ -313,9 +313,73 @@ aa_transform_inst(struct tgsi_transform_context *ctx,
newInst.FullSrcRegisters[0].SrcRegister.Negate = 1;
ctx->emit_instruction(ctx, &newInst);
/* SGT t0.y, t0.x, tex.z; # bool b = distance > k */
/* compute coverage factor = (1-d)/(1-k) */
/* SUB t0.z, tex.w, tex.z; # m = 1 - k */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_SGT;
newInst.Instruction.Opcode = TGSI_OPCODE_SUB;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
newInst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_Z;
newInst.Instruction.NumSrcRegs = 2;
newInst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_INPUT;
newInst.FullSrcRegisters[0].SrcRegister.Index = texInput;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleZ = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_INPUT;
newInst.FullSrcRegisters[1].SrcRegister.Index = texInput;
newInst.FullSrcRegisters[1].SrcRegister.SwizzleZ = TGSI_SWIZZLE_Z;
ctx->emit_instruction(ctx, &newInst);
/* RCP t0.z, t0.z; # t0.z = 1 / m */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_RCP;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
newInst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_Z;
newInst.Instruction.NumSrcRegs = 1;
newInst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullSrcRegisters[0].SrcRegister.Index = tmp0;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleX = TGSI_SWIZZLE_Z;
ctx->emit_instruction(ctx, &newInst);
/* SUB t0.y, 1, t0.x; # d = 1 - d */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_SUB;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
newInst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_Y;
newInst.Instruction.NumSrcRegs = 2;
newInst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_INPUT;
newInst.FullSrcRegisters[0].SrcRegister.Index = texInput;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleY = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullSrcRegisters[1].SrcRegister.Index = tmp0;
newInst.FullSrcRegisters[1].SrcRegister.SwizzleY = TGSI_SWIZZLE_X;
ctx->emit_instruction(ctx, &newInst);
/* MUL t0.w, t0.y, t0.z; # coverage = d * m */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_MUL;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
newInst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_W;
newInst.Instruction.NumSrcRegs = 2;
newInst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullSrcRegisters[0].SrcRegister.Index = tmp0;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleW = TGSI_SWIZZLE_Y;
newInst.FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullSrcRegisters[1].SrcRegister.Index = tmp0;
newInst.FullSrcRegisters[1].SrcRegister.SwizzleW = TGSI_SWIZZLE_Z;
ctx->emit_instruction(ctx, &newInst);
/* SLE t0.y, t0.x, tex.z; # bool b = distance <= k */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_SLE;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
@ -329,111 +393,40 @@ aa_transform_inst(struct tgsi_transform_context *ctx,
newInst.FullSrcRegisters[1].SrcRegister.SwizzleY = TGSI_SWIZZLE_Z;
ctx->emit_instruction(ctx, &newInst);
/* IF t0.y # if b then */
/* CMP t0.w, -t0.y, tex.w, t0.w;
* # if -t0.y < 0 then
* t0.w = 1
* else
* t0.w = t0.w
*/
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_IF;
newInst.Instruction.NumDstRegs = 0;
newInst.Instruction.NumSrcRegs = 1;
newInst.Instruction.Opcode = TGSI_OPCODE_CMP;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
newInst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_W;
newInst.Instruction.NumSrcRegs = 3;
newInst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullSrcRegisters[0].SrcRegister.Index = tmp0;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleX = TGSI_SWIZZLE_Y;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleY = TGSI_SWIZZLE_Y;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleZ = TGSI_SWIZZLE_Y;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleW = TGSI_SWIZZLE_Y;
newInst.FullSrcRegisters[0].SrcRegister.Negate = 1;
newInst.FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_INPUT;
newInst.FullSrcRegisters[1].SrcRegister.Index = texInput;
newInst.FullSrcRegisters[1].SrcRegister.SwizzleX = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[1].SrcRegister.SwizzleY = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[1].SrcRegister.SwizzleZ = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[1].SrcRegister.SwizzleW = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[2].SrcRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullSrcRegisters[2].SrcRegister.Index = tmp0;
newInst.FullSrcRegisters[2].SrcRegister.SwizzleX = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[2].SrcRegister.SwizzleY = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[2].SrcRegister.SwizzleZ = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[2].SrcRegister.SwizzleW = TGSI_SWIZZLE_W;
ctx->emit_instruction(ctx, &newInst);
{
/* compute coverage factor = (1-d)/(1-k) */
/* SUB t0.z, tex.w, tex.z; # m = 1 - k */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_SUB;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
newInst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_Z;
newInst.Instruction.NumSrcRegs = 2;
newInst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_INPUT;
newInst.FullSrcRegisters[0].SrcRegister.Index = texInput;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleZ = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_INPUT;
newInst.FullSrcRegisters[1].SrcRegister.Index = texInput;
newInst.FullSrcRegisters[1].SrcRegister.SwizzleZ = TGSI_SWIZZLE_Z;
ctx->emit_instruction(ctx, &newInst);
/* RCP t0.z, t0.z; # t0.z = 1 / m */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_RCP;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
newInst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_Z;
newInst.Instruction.NumSrcRegs = 1;
newInst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullSrcRegisters[0].SrcRegister.Index = tmp0;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleX = TGSI_SWIZZLE_Z;
ctx->emit_instruction(ctx, &newInst);
/* SUB t0.x, 1, t0.x; # d = 1 - d */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_SUB;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
newInst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_X;
newInst.Instruction.NumSrcRegs = 2;
newInst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_INPUT;
newInst.FullSrcRegisters[0].SrcRegister.Index = texInput;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleX = TGSI_SWIZZLE_W;
newInst.FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullSrcRegisters[1].SrcRegister.Index = tmp0;
newInst.FullSrcRegisters[1].SrcRegister.SwizzleX = TGSI_SWIZZLE_X;
ctx->emit_instruction(ctx, &newInst);
/* MUL t0.w, t0.x, t0.z; # coverage = d * m */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_MUL;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
newInst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_W;
newInst.Instruction.NumSrcRegs = 2;
newInst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullSrcRegisters[0].SrcRegister.Index = tmp0;
newInst.FullSrcRegisters[0].SrcRegister.SwizzleW = TGSI_SWIZZLE_X;
newInst.FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullSrcRegisters[1].SrcRegister.Index = tmp0;
newInst.FullSrcRegisters[1].SrcRegister.SwizzleW = TGSI_SWIZZLE_Z;
ctx->emit_instruction(ctx, &newInst);
}
/* ELSE */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_ELSE;
newInst.Instruction.NumDstRegs = 0;
newInst.Instruction.NumSrcRegs = 0;
ctx->emit_instruction(ctx, &newInst);
{
/* MOV t0.w, tex.w; # coverage = 1.0 */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_MOV;
newInst.Instruction.NumDstRegs = 1;
newInst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_TEMPORARY;
newInst.FullDstRegisters[0].DstRegister.Index = tmp0;
newInst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_W;
newInst.Instruction.NumSrcRegs = 1;
newInst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_INPUT;
newInst.FullSrcRegisters[0].SrcRegister.Index = texInput;
ctx->emit_instruction(ctx, &newInst);
}
/* ENDIF */
newInst = tgsi_default_full_instruction();
newInst.Instruction.Opcode = TGSI_OPCODE_ENDIF;
newInst.Instruction.NumDstRegs = 0;
newInst.Instruction.NumSrcRegs = 0;
ctx->emit_instruction(ctx, &newInst);
}
if (inst->Instruction.Opcode == TGSI_OPCODE_END) {
@ -516,7 +509,7 @@ generate_aapoint_fs(struct aapoint_stage *aapoint)
(struct tgsi_token *) aapoint_fs.tokens,
MAX, &transform.base);
#if 0 /* DEBUG */
#if 1 /* DEBUG */
tgsi_dump(orig_fs->tokens, 0);
tgsi_dump(aapoint_fs.tokens, 0);
#endif
@ -613,13 +606,16 @@ aapoint_point(struct draw_stage *stage, struct prim_header *header)
* ELSE
* coverage = 1.0; // full coverage
* ENDIF
*
* Note: the ELSEIF and ELSE clauses are actually implemented with CMP to
* avoid using IF/ELSE/ENDIF TGSI opcodes.
*/
#if !NORMALIZE
k = 1.0 / radius;
k = 1.0 - 2.0 * k + k * k;
k = 1.0f / radius;
k = 1.0f - 2.0f * k + k * k;
#else
k = 1.0 - 1.0 / radius;
k = 1.0f - 1.0f / radius;
#endif
/* allocate/dup new verts */

View file

@ -244,14 +244,32 @@ draw_convert_wide_lines(struct draw_context *draw, boolean enable)
/**
* The draw module may sometimes generate vertices with extra attributes
* (such as texcoords for AA lines). The driver can call this function
* to find those attributes.
* Ask the draw module for the location/slot of the given vertex attribute in
* a post-transformed vertex.
*
* With this function, drivers that use the draw module should have no reason
* to track the current vertex shader.
*
* Note that the draw module may sometimes generate vertices with extra
* attributes (such as texcoords for AA lines). The driver can call this
* function to find those attributes.
*
* Zero is returned if the attribute is not found since this is
* a don't care / undefined situtation. Returning -1 would be a bit more
* work for the drivers.
*/
int
draw_find_vs_output(struct draw_context *draw,
uint semantic_name, uint semantic_index)
{
const struct pipe_shader_state *vs = draw->vertex_shader->state;
uint i;
for (i = 0; i < vs->num_outputs; i++) {
if (vs->output_semantic_name[i] == semantic_name &&
vs->output_semantic_index[i] == semantic_index)
return i;
}
/* XXX there may be more than one extra vertex attrib.
* For example, simulated gl_FragCoord and gl_PointCoord.
*/

View file

@ -133,7 +133,7 @@ pstip_transform_decl(struct tgsi_transform_context *ctx,
pctx->maxSampler = (int) decl->u.DeclarationRange.Last;
}
else if (decl->Declaration.File == TGSI_FILE_INPUT) {
pctx->maxInput = MAX2(pctx->maxInput, decl->u.DeclarationRange.Last);
pctx->maxInput = MAX2(pctx->maxInput, (int) decl->u.DeclarationRange.Last);
if (decl->Semantic.SemanticName == TGSI_SEMANTIC_POSITION)
pctx->wincoordInput = (int) decl->u.DeclarationRange.First;
}
@ -332,7 +332,7 @@ generate_pstip_fs(struct pstip_stage *pstip)
if (transform.wincoordInput < 0) {
pstip_fs.input_semantic_name[pstip_fs.num_inputs] = TGSI_SEMANTIC_POSITION;
pstip_fs.input_semantic_index[pstip_fs.num_inputs] = transform.maxInput;
pstip_fs.input_semantic_index[pstip_fs.num_inputs] = (ubyte)transform.maxInput;
pstip_fs.num_inputs++;
}

View file

@ -45,6 +45,7 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
struct draw_stage *next = draw->pipeline.rasterize;
int need_det = 0;
int precalc_flat = 0;
boolean wide_lines, wide_points;
/* Set the validate's next stage to the rasterize stage, so that it
* can be found later if needed for flushing.
@ -68,9 +69,18 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
next = draw->pipeline.aapoint;
}
if ((draw->rasterizer->line_width != 1.0 && draw->convert_wide_lines
&& !draw->rasterizer->line_smooth) ||
(draw->rasterizer->point_size != 1.0 && draw->convert_wide_points) ||
/* drawing wide lines? */
wide_lines = (draw->rasterizer->line_width != 1.0
&& draw->convert_wide_lines
&& !draw->rasterizer->line_smooth);
/* drawing large points? */
wide_points = (draw->rasterizer->point_size != 1.0
&& draw->convert_wide_points
&& !draw->pipeline.aapoint);
if (wide_lines ||
wide_points ||
draw->rasterizer->point_sprite) {
draw->pipeline.wide->next = next;
next = draw->pipeline.wide;

View file

@ -166,6 +166,7 @@ static INLINE void
pb_destroy(struct pb_buffer *buf)
{
assert(buf);
assert(buf->vtbl);
buf->vtbl->destroy(buf);
}

View file

@ -285,7 +285,9 @@ fenced_buffer_list_destroy(struct fenced_buffer_list *fenced_list)
/* Wait on outstanding fences */
while (fenced_list->numDelayed) {
_glthread_UNLOCK_MUTEX(fenced_list->mutex);
#ifndef __MSC__
sched_yield();
#endif
_fenced_buffer_list_check_free(fenced_list, 1);
_glthread_LOCK_MUTEX(fenced_list->mutex);
}

View file

@ -192,8 +192,8 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr,
}
/* Some sanity checks */
assert(0 <= mm_buf->block->ofs && mm_buf->block->ofs < mm->size);
assert(size <= mm_buf->block->size && mm_buf->block->ofs + mm_buf->block->size <= mm->size);
assert(0 <= (unsigned)mm_buf->block->ofs && (unsigned)mm_buf->block->ofs < mm->size);
assert(size <= (unsigned)mm_buf->block->size && (unsigned)mm_buf->block->ofs + (unsigned)mm_buf->block->size <= mm->size);
_glthread_UNLOCK_MUTEX(mm->mutex);
return SUPER(mm_buf);

View file

@ -25,6 +25,7 @@
#include "pipe/p_compiler.h"
#include "pipe/p_debug.h"
#include "pipe/p_pointer.h"
#include "rtasm_execmem.h"
#include "rtasm_x86sse.h"
@ -34,7 +35,7 @@
static unsigned char *cptr( void (*label)() )
{
return (unsigned char *)(unsigned long)label;
return (unsigned char *) label;
}
@ -46,7 +47,7 @@ static void do_realloc( struct x86_function *p )
p->csr = p->store;
}
else {
unsigned used = p->csr - p->store;
uintptr_t used = pointer_to_uintptr( p->csr ) - pointer_to_uintptr( p->store );
unsigned char *tmp = p->store;
p->size *= 2;
p->store = rtasm_exec_malloc(p->size);
@ -60,7 +61,7 @@ static void do_realloc( struct x86_function *p )
*/
static unsigned char *reserve( struct x86_function *p, int bytes )
{
if (p->csr + bytes - p->store > p->size)
if (p->csr + bytes - p->store > (int) p->size)
do_realloc(p);
{
@ -135,7 +136,7 @@ static void emit_modrm( struct x86_function *p,
case mod_INDIRECT:
break;
case mod_DISP8:
emit_1b(p, regmem.disp);
emit_1b(p, (char) regmem.disp);
break;
case mod_DISP32:
emit_1i(p, regmem.disp);
@ -251,14 +252,14 @@ void x86_jcc( struct x86_function *p,
enum x86_cc cc,
unsigned char *label )
{
int offset = label - (x86_get_label(p) + 2);
intptr_t offset = pointer_to_intptr( label ) - (pointer_to_intptr( x86_get_label(p) ) + 2);
if (offset <= 127 && offset >= -128) {
emit_1ub(p, 0x70 + cc);
emit_1b(p, (char) offset);
}
else {
offset = label - (x86_get_label(p) + 6);
offset = pointer_to_intptr( label ) - (pointer_to_intptr( x86_get_label(p) ) + 6);
emit_2ub(p, 0x0f, 0x80 + cc);
emit_1i(p, offset);
}
@ -293,13 +294,13 @@ unsigned char *x86_call_forward( struct x86_function *p)
void x86_fixup_fwd_jump( struct x86_function *p,
unsigned char *fixup )
{
*(int *)(fixup - 4) = x86_get_label(p) - fixup;
*(int *)(fixup - 4) = pointer_to_intptr( x86_get_label(p) ) - pointer_to_intptr( fixup );
}
void x86_jmp( struct x86_function *p, unsigned char *label)
{
emit_1ub(p, 0xe9);
emit_1i(p, label - x86_get_label(p) - 4);
emit_1i(p, pointer_to_intptr( label ) - pointer_to_intptr( x86_get_label(p) ) - 4);
}
#if 0
@ -1207,7 +1208,7 @@ void (*x86_get_func( struct x86_function *p ))(void)
{
if (DISASSEM && p->store)
debug_printf("disassemble %p %p\n", p->store, p->csr);
return (void (*)(void)) (unsigned long) p->store;
return (void (*)(void)) p->store;
}
#else

View file

@ -9,6 +9,7 @@ C_SOURCES = \
util/tgsi_build.c \
util/tgsi_dump.c \
util/tgsi_parse.c \
util/tgsi_scan.c \
util/tgsi_transform.c \
util/tgsi_util.c

View file

@ -8,6 +8,8 @@ tgsi = env.ConvenienceLibrary(
'util/tgsi_build.c',
'util/tgsi_dump.c',
'util/tgsi_parse.c',
'util/tgsi_scan.c',
'util/tgsi_transform.c',
'util/tgsi_util.c',
])

View file

@ -2455,7 +2455,7 @@ tgsi_exec_machine_run( struct tgsi_exec_machine *mach )
/* execute instructions, until pc is set to -1 */
while (pc != -1) {
assert(pc < mach->NumInstructions);
assert(pc < (int) mach->NumInstructions);
exec_instruction( mach, mach->Instructions + pc, &pc );
}

View file

@ -299,7 +299,8 @@ static const char *TGSI_SEMANTICS[] =
"SEMANTIC_BCOLOR",
"SEMANTIC_FOG",
"SEMANTIC_PSIZE",
"SEMANTIC_GENERIC,"
"SEMANTIC_GENERIC",
"SEMANTIC_NORMAL"
};
static const char *TGSI_SEMANTICS_SHORT[] =
@ -310,6 +311,7 @@ static const char *TGSI_SEMANTICS_SHORT[] =
"FOG",
"PSIZE",
"GENERIC",
"NORMAL"
};
static const char *TGSI_IMMS[] =

View file

@ -0,0 +1,117 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* TGSI program scan utility.
* Used to determine which registers and instructions are used by a shader.
*
* Authors: Brian Paul
*/
#include "tgsi_scan.h"
#include "tgsi/util/tgsi_parse.h"
#include "tgsi/util/tgsi_build.h"
/**
*/
void
tgsi_scan_shader(const struct tgsi_token *tokens,
struct tgsi_shader_info *info)
{
uint procType;
struct tgsi_parse_context parse;
memset(info, 0, sizeof(*info));
/**
** Setup to begin parsing input shader
**/
if (tgsi_parse_init( &parse, tokens ) != TGSI_PARSE_OK) {
debug_printf("tgsi_parse_init() failed in tgsi_scan_shader()!\n");
return;
}
procType = parse.FullHeader.Processor.Processor;
assert(procType == TGSI_PROCESSOR_FRAGMENT ||
procType == TGSI_PROCESSOR_VERTEX ||
procType == TGSI_PROCESSOR_GEOMETRY);
/**
** Loop over incoming program tokens/instructions
*/
while( !tgsi_parse_end_of_tokens( &parse ) ) {
tgsi_parse_token( &parse );
switch( parse.FullToken.Token.Type ) {
case TGSI_TOKEN_TYPE_INSTRUCTION:
{
struct tgsi_full_instruction *fullinst
= &parse.FullToken.FullInstruction;
assert(fullinst->Instruction.Opcode < TGSI_OPCODE_LAST);
info->opcode_count[fullinst->Instruction.Opcode]++;
}
break;
case TGSI_TOKEN_TYPE_DECLARATION:
{
struct tgsi_full_declaration *fulldecl
= &parse.FullToken.FullDeclaration;
uint file = fulldecl->Declaration.File;
uint i;
for (i = fulldecl->u.DeclarationRange.First;
i <= fulldecl->u.DeclarationRange.Last;
i++) {
info->file_mask[file] |= (1 << i);
info->file_count[file]++;
/* special case */
if (procType == TGSI_PROCESSOR_FRAGMENT &&
file == TGSI_FILE_OUTPUT &&
fulldecl->Semantic.SemanticName == TGSI_SEMANTIC_POSITION) {
info->writes_z = TRUE;
}
}
}
break;
case TGSI_TOKEN_TYPE_IMMEDIATE:
info->immediate_count++;
break;
default:
assert( 0 );
}
}
tgsi_parse_free (&parse);
}

View file

@ -0,0 +1,57 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef TGSI_SCAN_H
#define TGSI_SCAN_H
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
/**
* Shader summary info
*/
struct tgsi_shader_info
{
uint file_mask[TGSI_FILE_COUNT]; /**< bitmask of declared registers */
uint file_count[TGSI_FILE_COUNT]; /**< number of declared registers */
uint immediate_count; /**< number of immediates declared */
uint opcode_count[TGSI_OPCODE_LAST]; /**< opcode histogram */
boolean writes_z; /**< does fragment shader write Z value? */
};
extern void
tgsi_scan_shader(const struct tgsi_token *tokens,
struct tgsi_shader_info *info);
#endif /* TGSI_SCAN_H */

View file

@ -134,6 +134,8 @@ extern void
cell_vertex_shader_queue_flush(struct draw_context *draw);
/* XXX find a better home for this */
extern void cell_update_vertex_fetch(struct draw_context *draw);
#endif /* CELL_CONTEXT_H */

View file

@ -38,6 +38,7 @@
#include "cell_context.h"
#include "cell_draw_arrays.h"
#include "cell_state.h"
#include "cell_flush.h"
#include "draw/draw_context.h"

View file

@ -35,4 +35,8 @@ cell_flush(struct pipe_context *pipe, unsigned flags);
extern void
cell_flush_int(struct pipe_context *pipe, unsigned flags);
extern void
cell_flush_buffer_range(struct cell_context *cell, void *ptr,
unsigned size);
#endif

View file

@ -55,7 +55,6 @@ cell_vertex_shader_queue_flush(struct draw_context *draw)
struct cell_command_vs *const vs = &cell_global.command[0].vs;
uint64_t *batch;
struct cell_array_info *array_info;
struct cell_shader_info *shader_info;
unsigned i, j;
struct cell_attribute_fetch_code *cf;
@ -123,12 +122,12 @@ cell_vertex_shader_queue_flush(struct draw_context *draw)
for (j = 0; j < n; j++) {
vs->elts[j] = draw->vs.queue[i + j].elt;
vs->vOut[j] = (uintptr_t) draw->vs.queue[i + j].dest;
vs->vOut[j] = (uintptr_t) draw->vs.queue[i + j].vertex;
}
for (/* empty */; j < SPU_VERTS_PER_BATCH; j++) {
vs->elts[j] = vs->elts[0];
vs->vOut[j] = vs->vOut[0];
vs->vOut[j] = (uintptr_t) draw->vs.queue[i + j].vertex;
}
vs->num_elts = n;
@ -137,5 +136,6 @@ cell_vertex_shader_queue_flush(struct draw_context *draw)
cell_flush_int(& cell->pipe, PIPE_FLUSH_WAIT);
}
draw->vs.post_nr = draw->vs.queue_nr;
draw->vs.queue_nr = 0;
}

View file

@ -33,7 +33,7 @@
#define CACHE_NAME data
#define CACHED_TYPE qword
#define CACHE_TYPE CACHE_TYPE_RO
#define CACHE_SET_TAGID(set) TAG_VERTEX_BUFFER
#define CACHE_SET_TAGID(set) (((set) & 0x03) + TAG_DCACHE0)
#define CACHE_LOG2NNWAY 2
#define CACHE_LOG2NSETS 6
#include <cache-api.h>
@ -49,43 +49,57 @@
/**
* Fetch between arbitrary number of bytes from an unaligned address
*
* \param dst Destination data buffer
* \param ea Main memory effective address of source data
* \param size Number of bytes to read
*
* \warning
* As is hinted by the type of the \c dst pointer, this function writes
* multiples of 16-bytes.
*/
void
spu_dcache_fetch_unaligned(qword *dst, unsigned ea, unsigned size)
{
const int shift = ea & 0x0f;
const unsigned aligned_start_ea = ea & ~0x0f;
const unsigned aligned_end_ea = ROUNDUP16(ea + size);
const unsigned num_entries = (aligned_end_ea - aligned_start_ea) / 16;
const unsigned read_size = ROUNDUP16(size + shift);
const unsigned last_read = ROUNDUP16(ea + size);
const qword *const last_write = dst + (ROUNDUP16(size) / 16);
unsigned i;
if (shift == 0) {
/* Data is already aligned. Fetch directly into the destination buffer.
*/
for (i = 0; i < num_entries; i++) {
dst[i] = cache_rd(data, ea + (i * 16));
for (i = 0; i < size; i += 16) {
*(dst++) = cache_rd(data, ea + i);
}
} else {
qword tmp[2] ALIGN16_ATTRIB;
qword hi;
tmp[0] = cache_rd(data, (ea & ~0x0f));
for (i = 0; i < (num_entries & ~1); i++) {
const unsigned curr = i & 1;
const unsigned next = curr ^ 1;
/* Please exercise extreme caution when modifying this code. This code
* must not read past the end of the page containing the source data,
* and it must not write more than ((size + 15) / 16) qwords to the
* destination buffer.
*/
ea &= ~0x0f;
hi = cache_rd(data, ea);
for (i = 16; i < read_size; i += 16) {
qword lo = cache_rd(data, ea + i);
tmp[next] = cache_rd(data, (ea & ~0x0f) + (next * 16));
dst[i] = si_or((qword) spu_slqwbyte(tmp[curr], shift),
(qword) spu_rlmaskqwbyte(tmp[next], shift - 16));
*(dst++) = si_or((qword) spu_slqwbyte(hi, shift),
(qword) spu_rlmaskqwbyte(lo, shift - 16));
hi = lo;
}
if (i < num_entries) {
dst[i] = si_or((qword) spu_slqwbyte(tmp[(i & 1)], shift),
si_il(0));
if (dst != last_write) {
*(dst++) = si_or((qword) spu_slqwbyte(hi, shift), si_il(0));
}
}
ASSERT((ea + i) == last_read);
ASSERT(dst == last_write);
}

View file

@ -50,8 +50,6 @@
* Brian Paul
*/
#include <libmisc.h>
#include <spu_mfcio.h>
#include <transpose_matrix4x4.h>
#include <simdmath/ceilf4.h>
#include <simdmath/cosf4.h>
@ -151,6 +149,7 @@ spu_exec_machine_init(struct spu_exec_machine *mach,
const qword zero = si_il(0);
const qword not_zero = si_il(~0);
(void) numSamplers;
mach->Samplers = samplers;
mach->Processor = processor;
mach->Addrs = &mach->Temps[TGSI_EXEC_NUM_TEMPS];
@ -659,9 +658,10 @@ fetch_texel( struct spu_sampler *sampler,
qword rgba[4];
qword out[4];
sampler->get_samples(sampler, s->f, t->f, p->f, lodbias, (float *) rgba);
sampler->get_samples(sampler, s->f, t->f, p->f, lodbias,
(float (*)[4]) rgba);
_transpose_matrix4x4(out, rgba);
_transpose_matrix4x4((vec_float4 *) out, (vec_float4 *) rgba);
r->q = out[0];
g->q = out[1];
b->q = out[2];

View file

@ -38,6 +38,7 @@
#include "spu_tile.h"
//#include "spu_test.h"
#include "spu_vertex_shader.h"
#include "spu_dcache.h"
#include "cell/common.h"
#include "pipe/p_defines.h"
@ -434,7 +435,7 @@ cmd_batch(uint opcode)
pos += (1 + ROUNDUP8(sizeof(struct pipe_viewport_state)) / 8);
break;
case CELL_CMD_STATE_UNIFORMS:
draw.constants = (float (*)[4]) (uintptr_t) buffer[pos + 1];
draw.constants = (const float (*)[4]) (uintptr_t) buffer[pos + 1];
pos += 2;
break;
case CELL_CMD_STATE_VS_ARRAY_INFO:
@ -583,7 +584,7 @@ main(main_param_t speid, main_param_t argp)
one_time_init();
if (Debug)
printf("SPU: main() speid=%lu\n", speid);
printf("SPU: main() speid=%lu\n", (unsigned long) speid);
mfc_get(&spu.init, /* dest */
(unsigned int) argp, /* src */

View file

@ -131,7 +131,10 @@ extern boolean Debug;
#define TAG_BATCH_BUFFER 17
#define TAG_MISC 18
#define TAG_TEXTURE_TILE 19
#define TAG_INSTRUCTION_FETCH 20
#define TAG_DCACHE0 20
#define TAG_DCACHE1 21
#define TAG_DCACHE2 22
#define TAG_DCACHE3 23

View file

@ -32,8 +32,6 @@
* Ian Romanick <idr@us.ibm.com>
*/
#include <spu_mfcio.h>
#include "pipe/p_util.h"
#include "pipe/p_state.h"
#include "pipe/p_shader_tokens.h"

View file

@ -298,10 +298,12 @@ struct pipe_context *i915_create( struct pipe_winsys *pipe_winsys,
i915_init_string_functions(i915);
i915_init_texture_functions(i915);
draw_install_aaline_stage(i915->draw, &i915->pipe);
draw_install_aapoint_stage(i915->draw, &i915->pipe);
i915->pci_id = pci_id;
i915->flags.is_i945 = is_i945;
i915->dirty = ~0;
i915->hardware_dirty = ~0;

View file

@ -79,6 +79,40 @@
#define I915_MAX_CONSTANT 32
/** See constant_flags[] below */
#define I915_CONSTFLAG_USER 0x1f
/**
* Subclass of pipe_shader_state
*/
struct i915_fragment_shader
{
struct pipe_shader_state state;
uint *program;
uint program_len;
/**
* constants introduced during translation.
* These are placed at the end of the constant buffer and grow toward
* the beginning (eg: slot 31, 30 29, ...)
* User-provided constants start at 0.
* This allows both types of constants to co-exist (until there's too many)
* and doesn't require regenerating/changing the fragment program to
* shuffle constants around.
*/
uint num_constants;
float constants[I915_MAX_CONSTANT][4];
/**
* Status of each constant
* if I915_CONSTFLAG_PARAM, the value must be taken from the corresponding
* slot of the user's constant buffer. (set by pipe->set_constant_buffer())
* Else, the bitmask indicates which components are occupied by immediates.
*/
ubyte constant_flags[I915_MAX_CONSTANT];
};
struct i915_cache_context;
@ -93,11 +127,6 @@ struct i915_state
float constants[PIPE_SHADER_TYPES][I915_MAX_CONSTANT][4];
/** number of constants passed in through a constant buffer */
uint num_user_constants[PIPE_SHADER_TYPES];
/** user constants, plus extra constants from shader translation */
uint num_constants[PIPE_SHADER_TYPES];
uint *program;
uint program_len;
/* texture sampler state */
unsigned sampler[I915_TEX_UNITS][3];
@ -187,7 +216,8 @@ struct i915_context
const struct i915_sampler_state *sampler[PIPE_MAX_SAMPLERS];
const struct i915_depth_stencil_state *depth_stencil;
const struct i915_rasterizer_state *rasterizer;
const struct pipe_shader_state *fs;
struct i915_fragment_shader *fs;
struct pipe_blend_color blend_color;
struct pipe_clip_state clip;
@ -233,6 +263,7 @@ struct i915_context
#define I915_NEW_TEXTURE 0x800
#define I915_NEW_CONSTANTS 0x1000
#define I915_NEW_VBO 0x2000
#define I915_NEW_VS 0x4000
/* Driver's internally generated state flags:

View file

@ -31,6 +31,7 @@
#include "pipe/p_defines.h"
#include "draw/draw_context.h"
#include "i915_context.h"
#include "i915_reg.h"
#include "i915_batch.h"
@ -44,6 +45,8 @@ static void i915_flush( struct pipe_context *pipe,
{
struct i915_context *i915 = i915_context(pipe);
draw_flush(i915->draw);
/* Do we need to emit an MI_FLUSH command to flush the hardware
* caches?
*/

View file

@ -44,9 +44,16 @@
* Program translation state
*/
struct i915_fp_compile {
const struct pipe_shader_state *shader;
struct i915_fragment_shader *shader; /* the shader we're compiling */
struct vertex_info *vertex_info;
boolean used_constants[I915_MAX_CONSTANT];
/** maps TGSI immediate index to constant slot */
uint num_immediates;
uint immediates_map[I915_MAX_CONSTANT];
float immediates[I915_MAX_CONSTANT][4];
boolean first_instruction;
uint declarations[I915_PROGRAM_SIZE];
uint program[I915_PROGRAM_SIZE];
@ -57,11 +64,6 @@ struct i915_fp_compile {
uint output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
uint output_semantic_index[PIPE_MAX_SHADER_OUTPUTS];
/** points into the i915->current.constants array: */
float (*constants)[4];
uint num_constants;
uint constant_flags[I915_MAX_CONSTANT]; /**< status of each constant */
uint *csr; /**< Cursor, points into program. */
uint *decl; /**< Cursor, points into declarations. */
@ -155,7 +157,9 @@ swizzle(int reg, uint x, uint y, uint z, uint w)
/***********************************************************************
* Public interface for the compiler
*/
extern void i915_translate_fragment_program( struct i915_context *i915 );
extern void
i915_translate_fragment_program( struct i915_context *i915,
struct i915_fragment_shader *fs);
@ -206,8 +210,5 @@ extern void i915_disassemble_program(const uint * program, uint sz);
extern void
i915_program_error(struct i915_fp_compile *p, const char *msg, ...);
extern void
i915_translate_fragment_program(struct i915_context *i915);
#endif

View file

@ -61,8 +61,6 @@
(REG_NR_MASK << UREG_NR_SHIFT))
#define I915_CONSTFLAG_PARAM 0x1f
uint
i915_get_temp(struct i915_fp_compile *p)
{
@ -73,10 +71,21 @@ i915_get_temp(struct i915_fp_compile *p)
}
p->temp_flag |= 1 << (bit - 1);
return UREG(REG_TYPE_R, (bit - 1));
return bit - 1;
}
static void
i915_release_temp(struct i915_fp_compile *p, int reg)
{
p->temp_flag &= ~(1 << reg);
}
/**
* Get unpreserved temporary, a temp whose value is not preserved between
* PS program phases.
*/
uint
i915_get_utemp(struct i915_fp_compile * p)
{
@ -185,41 +194,62 @@ i915_emit_arith(struct i915_fp_compile * p,
return dest;
}
/**
* Emit a texture load or texkill instruction.
* \param dest the dest i915 register
* \param destmask the dest register writemask
* \param sampler the i915 sampler register
* \param coord the i915 source texcoord operand
* \param opcode the instruction opcode
*/
uint i915_emit_texld( struct i915_fp_compile *p,
uint dest,
uint destmask,
uint sampler,
uint coord,
uint op )
uint opcode )
{
uint k = UREG(GET_UREG_TYPE(coord), GET_UREG_NR(coord));
const uint k = UREG(GET_UREG_TYPE(coord), GET_UREG_NR(coord));
int temp = -1;
if (coord != k) {
/* No real way to work around this in the general case - need to
* allocate and declare a new temporary register (a utemp won't
* do). Will fallback for now.
/* texcoord is swizzled or negated. Need to allocate a new temporary
* register (a utemp / unpreserved temp) won't do.
*/
i915_program_error(p, "Can't (yet) swizzle TEX arguments");
assert(0);
return 0;
uint tempReg;
temp = i915_get_temp(p); /* get temp reg index */
tempReg = UREG(REG_TYPE_R, temp); /* make i915 register */
i915_emit_arith( p, A0_MOV,
tempReg, A0_DEST_CHANNEL_ALL, /* dest reg, writemask */
0, /* saturate */
coord, 0, 0 ); /* src0, src1, src2 */
/* new src texcoord is tempReg */
coord = tempReg;
}
/* Don't worry about saturate as we only support
*/
if (destmask != A0_DEST_CHANNEL_ALL) {
/* if not writing to XYZW... */
uint tmp = i915_get_utemp(p);
i915_emit_texld( p, tmp, A0_DEST_CHANNEL_ALL, sampler, coord, op );
i915_emit_texld( p, tmp, A0_DEST_CHANNEL_ALL, sampler, coord, opcode );
i915_emit_arith( p, A0_MOV, dest, destmask, 0, tmp, 0, 0 );
return dest;
/* XXX release utemp here? */
}
else {
assert(GET_UREG_TYPE(dest) != REG_TYPE_CONST);
assert(dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest)));
/* is the sampler coord a texcoord input reg? */
if (GET_UREG_TYPE(coord) != REG_TYPE_T) {
p->nr_tex_indirect++;
}
*(p->csr++) = (op |
*(p->csr++) = (opcode |
T0_DEST( dest ) |
T0_SAMPLER( sampler ));
@ -227,14 +257,19 @@ uint i915_emit_texld( struct i915_fp_compile *p,
*(p->csr++) = T2_MBZ;
p->nr_tex_insn++;
return dest;
}
if (temp >= 0)
i915_release_temp(p, temp);
return dest;
}
uint
i915_emit_const1f(struct i915_fp_compile * p, float c0)
{
struct i915_fragment_shader *ifs = p->shader;
unsigned reg, idx;
if (c0 == 0.0)
@ -243,15 +278,15 @@ i915_emit_const1f(struct i915_fp_compile * p, float c0)
return swizzle(UREG(REG_TYPE_R, 0), ONE, ONE, ONE, ONE);
for (reg = 0; reg < I915_MAX_CONSTANT; reg++) {
if (p->constant_flags[reg] == I915_CONSTFLAG_PARAM)
if (ifs->constant_flags[reg] == I915_CONSTFLAG_USER)
continue;
for (idx = 0; idx < 4; idx++) {
if (!(p->constant_flags[reg] & (1 << idx)) ||
p->constants[reg][idx] == c0) {
p->constants[reg][idx] = c0;
p->constant_flags[reg] |= 1 << idx;
if (reg + 1 > p->num_constants)
p->num_constants = reg + 1;
if (!(ifs->constant_flags[reg] & (1 << idx)) ||
ifs->constants[reg][idx] == c0) {
ifs->constants[reg][idx] = c0;
ifs->constant_flags[reg] |= 1 << idx;
if (reg + 1 > ifs->num_constants)
ifs->num_constants = reg + 1;
return swizzle(UREG(REG_TYPE_CONST, reg), idx, ZERO, ZERO, ONE);
}
}
@ -264,6 +299,7 @@ i915_emit_const1f(struct i915_fp_compile * p, float c0)
uint
i915_emit_const2f(struct i915_fp_compile * p, float c0, float c1)
{
struct i915_fragment_shader *ifs = p->shader;
unsigned reg, idx;
if (c0 == 0.0)
@ -277,16 +313,16 @@ i915_emit_const2f(struct i915_fp_compile * p, float c0, float c1)
return swizzle(i915_emit_const1f(p, c0), X, ONE, Z, W);
for (reg = 0; reg < I915_MAX_CONSTANT; reg++) {
if (p->constant_flags[reg] == 0xf ||
p->constant_flags[reg] == I915_CONSTFLAG_PARAM)
if (ifs->constant_flags[reg] == 0xf ||
ifs->constant_flags[reg] == I915_CONSTFLAG_USER)
continue;
for (idx = 0; idx < 3; idx++) {
if (!(p->constant_flags[reg] & (3 << idx))) {
p->constants[reg][idx + 0] = c0;
p->constants[reg][idx + 1] = c1;
p->constant_flags[reg] |= 3 << idx;
if (reg + 1 > p->num_constants)
p->num_constants = reg + 1;
if (!(ifs->constant_flags[reg] & (3 << idx))) {
ifs->constants[reg][idx + 0] = c0;
ifs->constants[reg][idx + 1] = c1;
ifs->constant_flags[reg] |= 3 << idx;
if (reg + 1 > ifs->num_constants)
ifs->num_constants = reg + 1;
return swizzle(UREG(REG_TYPE_CONST, reg), idx, idx + 1, ZERO, ONE);
}
}
@ -302,25 +338,26 @@ uint
i915_emit_const4f(struct i915_fp_compile * p,
float c0, float c1, float c2, float c3)
{
struct i915_fragment_shader *ifs = p->shader;
unsigned reg;
for (reg = 0; reg < I915_MAX_CONSTANT; reg++) {
if (p->constant_flags[reg] == 0xf &&
p->constants[reg][0] == c0 &&
p->constants[reg][1] == c1 &&
p->constants[reg][2] == c2 &&
p->constants[reg][3] == c3) {
if (ifs->constant_flags[reg] == 0xf &&
ifs->constants[reg][0] == c0 &&
ifs->constants[reg][1] == c1 &&
ifs->constants[reg][2] == c2 &&
ifs->constants[reg][3] == c3) {
return UREG(REG_TYPE_CONST, reg);
}
else if (p->constant_flags[reg] == 0) {
else if (ifs->constant_flags[reg] == 0) {
p->constants[reg][0] = c0;
p->constants[reg][1] = c1;
p->constants[reg][2] = c2;
p->constants[reg][3] = c3;
p->constant_flags[reg] = 0xf;
if (reg + 1 > p->num_constants)
p->num_constants = reg + 1;
ifs->constants[reg][0] = c0;
ifs->constants[reg][1] = c1;
ifs->constants[reg][2] = c2;
ifs->constants[reg][3] = c3;
ifs->constant_flags[reg] = 0xf;
if (reg + 1 > ifs->num_constants)
ifs->num_constants = reg + 1;
return UREG(REG_TYPE_CONST, reg);
}
}
@ -335,41 +372,3 @@ i915_emit_const4fv(struct i915_fp_compile * p, const float * c)
{
return i915_emit_const4f(p, c[0], c[1], c[2], c[3]);
}
#if 00000/*UNUSED*/
/* Reserve a slot in the constant file for a Mesa state parameter.
* These will later need to be tracked on statechanges, but that is
* done elsewhere.
*/
uint
i915_emit_param4fv(struct i915_fp_compile * p, const float * values)
{
struct i915_fragment_program *fp = p->fp;
int i;
for (i = 0; i < fp->nr_params; i++) {
if (fp->param[i].values == values)
return UREG(REG_TYPE_CONST, fp->param[i].reg);
}
if (p->constants->nr_constants == I915_MAX_CONSTANT ||
fp->nr_params == I915_MAX_CONSTANT) {
i915_program_error(p, "i915_emit_param4fv: out of constants\n");
return 0;
}
{
int reg = p->constants->nr_constants++;
int i = fp->nr_params++;
assert (p->constant_flags[reg] == 0);
p->constant_flags[reg] = I915_CONSTFLAG_PARAM;
fp->param[i].values = values;
fp->param[i].reg = reg;
return UREG(REG_TYPE_CONST, reg);
}
}
#endif

View file

@ -34,6 +34,7 @@
#include "pipe/p_shader_tokens.h"
#include "tgsi/util/tgsi_parse.h"
#include "tgsi/util/tgsi_dump.h"
#include "draw/draw_vertex.h"
@ -97,19 +98,19 @@ negate(int reg, int x, int y, int z, int w)
}
/**
* In the event of a translation failure, we'll generate a simple color
* pass-through program.
*/
static void
i915_use_passthrough_shader(struct i915_context *i915)
i915_use_passthrough_shader(struct i915_fragment_shader *fs)
{
debug_printf("**** Using i915 pass-through fragment shader\n");
i915->current.program = (uint *) MALLOC(sizeof(passthrough));
if (i915->current.program) {
memcpy(i915->current.program, passthrough, sizeof(passthrough));
i915->current.program_len = Elements(passthrough);
fs->program = (uint *) MALLOC(sizeof(passthrough));
if (fs->program) {
memcpy(fs->program, passthrough, sizeof(passthrough));
fs->program_len = Elements(passthrough);
}
i915->current.num_constants[PIPE_SHADER_FRAGMENT] = 0;
i915->current.num_user_constants[PIPE_SHADER_FRAGMENT] = 0;
fs->num_constants = 0;
}
@ -161,9 +162,6 @@ src_vector(struct i915_fp_compile *p,
* We also use a texture coordinate to pass wpos when possible.
*/
/* use vertex format info to map a slot number to a VF attrib */
assert(index < p->vertex_info->num_attribs);
sem_name = p->input_semantic_name[index];
sem_ind = p->input_semantic_index[index];
@ -201,7 +199,8 @@ src_vector(struct i915_fp_compile *p,
break;
case TGSI_FILE_IMMEDIATE:
/* XXX unfinished - need to append immediates onto const buffer */
assert(index < p->num_immediates);
index = p->immediates_map[index];
/* fall-through */
case TGSI_FILE_CONSTANT:
src = UREG(REG_TYPE_CONST, index);
@ -386,6 +385,26 @@ emit_simple_arith(struct i915_fp_compile *p,
arg3 );
}
/** As above, but swap the first two src regs */
static void
emit_simple_arith_swap2(struct i915_fp_compile *p,
const struct tgsi_full_instruction *inst,
uint opcode, uint numArgs)
{
struct tgsi_full_instruction inst2;
assert(numArgs == 2);
/* transpose first two registers */
inst2 = *inst;
inst2.FullSrcRegisters[0] = inst->FullSrcRegisters[1];
inst2.FullSrcRegisters[1] = inst->FullSrcRegisters[0];
emit_simple_arith(p, &inst2, opcode, numArgs);
}
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
@ -556,8 +575,12 @@ i915_translate_instruction(struct i915_fp_compile *p,
src0 = src_vector(p, &inst->FullSrcRegisters[0]);
tmp = i915_get_utemp(p);
i915_emit_texld(p, tmp, A0_DEST_CHANNEL_ALL, /* use a dummy dest reg */
0, src0, T0_TEXKILL);
i915_emit_texld(p,
tmp, /* dest reg: a dummy reg */
A0_DEST_CHANNEL_ALL, /* dest writemask */
0, /* sampler */
src0, /* coord*/
T0_TEXKILL); /* opcode */
break;
case TGSI_OPCODE_LG2:
@ -773,6 +796,11 @@ i915_translate_instruction(struct i915_fp_compile *p,
emit_simple_arith(p, inst, A0_SGE, 2);
break;
case TGSI_OPCODE_SLE:
/* like SGE, but swap reg0, reg1 */
emit_simple_arith_swap2(p, inst, A0_SGE, 2);
break;
case TGSI_OPCODE_SIN:
src0 = src_vector(p, &inst->FullSrcRegisters[0]);
tmp = i915_get_utemp(p);
@ -827,6 +855,11 @@ i915_translate_instruction(struct i915_fp_compile *p,
emit_simple_arith(p, inst, A0_SLT, 2);
break;
case TGSI_OPCODE_SGT:
/* like SLT, but swap reg0, reg1 */
emit_simple_arith_swap2(p, inst, A0_SLT, 2);
break;
case TGSI_OPCODE_SUB:
src0 = src_vector(p, &inst->FullSrcRegisters[0]);
src1 = src_vector(p, &inst->FullSrcRegisters[1]);
@ -880,6 +913,7 @@ i915_translate_instruction(struct i915_fp_compile *p,
default:
i915_program_error(p, "bad opcode %d", inst->Instruction.Opcode);
p->error = 1;
return;
}
@ -896,6 +930,7 @@ static void
i915_translate_instructions(struct i915_fp_compile *p,
const struct tgsi_token *tokens)
{
struct i915_fragment_shader *ifs = p->shader;
struct tgsi_parse_context parse;
tgsi_parse_init( &parse, tokens );
@ -928,13 +963,64 @@ i915_translate_instructions(struct i915_fp_compile *p,
p->output_semantic_name[ind] = sem;
p->output_semantic_index[ind] = semi;
}
else if (parse.FullToken.FullDeclaration.Declaration.File
== TGSI_FILE_CONSTANT) {
uint i;
for (i = parse.FullToken.FullDeclaration.u.DeclarationRange.First;
i <= parse.FullToken.FullDeclaration.u.DeclarationRange.Last;
i++) {
assert(ifs->constant_flags[i] == 0x0);
ifs->constant_flags[i] = I915_CONSTFLAG_USER;
ifs->num_constants = MAX2(ifs->num_constants, i + 1);
}
}
else if (parse.FullToken.FullDeclaration.Declaration.File
== TGSI_FILE_TEMPORARY) {
uint i;
for (i = parse.FullToken.FullDeclaration.u.DeclarationRange.First;
i <= parse.FullToken.FullDeclaration.u.DeclarationRange.Last;
i++) {
assert(i < I915_MAX_TEMPORARY);
p->temp_flag |= (1 << i); /* mark temp as used */
}
}
break;
case TGSI_TOKEN_TYPE_IMMEDIATE:
/* XXX append the immediate to the const buffer... */
{
const struct tgsi_full_immediate *imm
= &parse.FullToken.FullImmediate;
const uint pos = p->num_immediates++;
uint j;
for (j = 0; j < imm->Immediate.Size; j++) {
p->immediates[pos][j] = imm->u.ImmediateFloat32[j].Float;
}
}
break;
case TGSI_TOKEN_TYPE_INSTRUCTION:
if (p->first_instruction) {
/* resolve location of immediates */
uint i, j;
for (i = 0; i < p->num_immediates; i++) {
/* find constant slot for this immediate */
for (j = 0; j < I915_MAX_CONSTANT; j++) {
if (ifs->constant_flags[j] == 0x0) {
memcpy(ifs->constants[j],
p->immediates[i],
4 * sizeof(float));
/*printf("immediate %d maps to const %d\n", i, j);*/
ifs->constant_flags[j] = 0xf; /* all four comps used */
p->immediates_map[i] = j;
ifs->num_constants = MAX2(ifs->num_constants, j + 1);
break;
}
}
}
p->first_instruction = FALSE;
}
i915_translate_instruction(p, &parse.FullToken.FullInstruction);
break;
@ -950,32 +1036,33 @@ i915_translate_instructions(struct i915_fp_compile *p,
static struct i915_fp_compile *
i915_init_compile(struct i915_context *i915,
const struct pipe_shader_state *fs)
struct i915_fragment_shader *ifs)
{
struct i915_fp_compile *p = CALLOC_STRUCT(i915_fp_compile);
p->shader = i915->fs;
p->shader = ifs;
p->vertex_info = &i915->current.vertex_info;
/* new constants found during translation get appended after the
* user-provided constants.
/* Put new constants at end of const buffer, growing downward.
* The problem is we don't know how many user-defined constants might
* be specified with pipe->set_constant_buffer().
* Should pre-scan the user's program to determine the highest-numbered
* constant referenced.
*/
p->constants = i915->current.constants[PIPE_SHADER_FRAGMENT];
p->num_constants = i915->current.num_user_constants[PIPE_SHADER_FRAGMENT];
ifs->num_constants = 0;
memset(ifs->constant_flags, 0, sizeof(ifs->constant_flags));
p->first_instruction = TRUE;
p->nr_tex_indirect = 1; /* correct? */
p->nr_tex_insn = 0;
p->nr_alu_insn = 0;
p->nr_decl_insn = 0;
memset(p->constant_flags, 0, sizeof(p->constant_flags));
p->csr = p->program;
p->decl = p->declarations;
p->decl_s = 0;
p->decl_t = 0;
p->temp_flag = 0xffff000;
p->temp_flag = ~0x0 << I915_MAX_TEMPORARY;
p->utemp_flag = ~0x7;
p->wpos_tex = -1;
@ -993,6 +1080,7 @@ i915_init_compile(struct i915_context *i915,
static void
i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p)
{
struct i915_fragment_shader *ifs = p->shader;
unsigned long program_size = (unsigned long) (p->csr - p->program);
unsigned long decl_size = (unsigned long) (p->decl - p->declarations);
@ -1008,19 +1096,13 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p)
if (p->nr_decl_insn > I915_MAX_DECL_INSN)
i915_program_error(p, "Exceeded max DECL instructions");
/* free old program, if present */
if (i915->current.program) {
FREE(i915->current.program);
i915->current.program_len = 0;
}
if (p->error) {
p->NumNativeInstructions = 0;
p->NumNativeAluInstructions = 0;
p->NumNativeTexInstructions = 0;
p->NumNativeTexIndirections = 0;
i915_use_passthrough_shader(i915);
i915_use_passthrough_shader(ifs);
}
else {
p->NumNativeInstructions
@ -1034,24 +1116,20 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p)
/* Copy compilation results to fragment program struct:
*/
i915->current.program
assert(!ifs->program);
ifs->program
= (uint *) MALLOC((program_size + decl_size) * sizeof(uint));
if (i915->current.program) {
i915->current.program_len = program_size + decl_size;
if (ifs->program) {
ifs->program_len = program_size + decl_size;
memcpy(i915->current.program,
memcpy(ifs->program,
p->declarations,
decl_size * sizeof(uint));
memcpy(i915->current.program + decl_size,
memcpy(ifs->program + decl_size,
p->program,
program_size * sizeof(uint));
}
/* update number of constants */
i915->current.num_constants[PIPE_SHADER_FRAGMENT] = p->num_constants;
assert(i915->current.num_constants[PIPE_SHADER_FRAGMENT]
>= i915->current.num_user_constants[PIPE_SHADER_FRAGMENT]);
}
/* Release the compilation struct:
@ -1085,7 +1163,7 @@ i915_find_wpos_space(struct i915_fp_compile *p)
i915_program_error(p, "No free texcoord for wpos value");
}
#else
if (p->shader->input_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
if (p->shader->state.input_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
/* frag shader using the fragment position input */
#if 0
assert(0);
@ -1106,7 +1184,7 @@ static void
i915_fixup_depth_write(struct i915_fp_compile *p)
{
/* XXX assuming pos/depth is always in output[0] */
if (p->shader->output_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
if (p->shader->state.output_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
const uint depth = UREG(REG_TYPE_OD, 0);
i915_emit_arith(p,
@ -1121,13 +1199,18 @@ i915_fixup_depth_write(struct i915_fp_compile *p)
void
i915_translate_fragment_program( struct i915_context *i915 )
i915_translate_fragment_program( struct i915_context *i915,
struct i915_fragment_shader *fs)
{
struct i915_fp_compile *p = i915_init_compile(i915, i915->fs);
const struct tgsi_token *tokens = i915->fs->tokens;
struct i915_fp_compile *p = i915_init_compile(i915, fs);
const struct tgsi_token *tokens = fs->state.tokens;
i915_find_wpos_space(p);
#if 0
tgsi_dump(tokens, 0);
#endif
i915_translate_instructions(p, tokens);
i915_fixup_depth_write(p);

View file

@ -72,38 +72,42 @@ emit_hw_vertex( struct i915_context *i915,
uint i;
uint count = 0; /* for debug/sanity */
assert(!i915->dirty);
for (i = 0; i < vinfo->num_attribs; i++) {
const uint j = vinfo->src_index[i];
const float *attrib = vertex->data[j];
switch (vinfo->emit[i]) {
case EMIT_OMIT:
/* no-op */
break;
case EMIT_1F:
OUT_BATCH( fui(vertex->data[i][0]) );
OUT_BATCH( fui(attrib[0]) );
count++;
break;
case EMIT_2F:
OUT_BATCH( fui(vertex->data[i][0]) );
OUT_BATCH( fui(vertex->data[i][1]) );
OUT_BATCH( fui(attrib[0]) );
OUT_BATCH( fui(attrib[1]) );
count += 2;
break;
case EMIT_3F:
OUT_BATCH( fui(vertex->data[i][0]) );
OUT_BATCH( fui(vertex->data[i][1]) );
OUT_BATCH( fui(vertex->data[i][2]) );
OUT_BATCH( fui(attrib[0]) );
OUT_BATCH( fui(attrib[1]) );
OUT_BATCH( fui(attrib[2]) );
count += 3;
break;
case EMIT_4F:
OUT_BATCH( fui(vertex->data[i][0]) );
OUT_BATCH( fui(vertex->data[i][1]) );
OUT_BATCH( fui(vertex->data[i][2]) );
OUT_BATCH( fui(vertex->data[i][3]) );
OUT_BATCH( fui(attrib[0]) );
OUT_BATCH( fui(attrib[1]) );
OUT_BATCH( fui(attrib[2]) );
OUT_BATCH( fui(attrib[3]) );
count += 4;
break;
case EMIT_4UB:
OUT_BATCH( pack_ub4(float_to_ubyte( vertex->data[i][2] ),
float_to_ubyte( vertex->data[i][1] ),
float_to_ubyte( vertex->data[i][0] ),
float_to_ubyte( vertex->data[i][3] )) );
OUT_BATCH( pack_ub4(float_to_ubyte( attrib[2] ),
float_to_ubyte( attrib[1] ),
float_to_ubyte( attrib[0] ),
float_to_ubyte( attrib[3] )) );
count += 1;
break;
default:
@ -122,17 +126,19 @@ emit_prim( struct draw_stage *stage,
unsigned nr )
{
struct i915_context *i915 = setup_stage(stage)->i915;
unsigned vertex_size = i915->current.vertex_info.size * 4; /* in bytes */
unsigned vertex_size;
unsigned i;
assert(vertex_size >= 12); /* never smaller than 12 bytes */
if (i915->dirty)
i915_update_derived( i915 );
if (i915->hardware_dirty)
i915_emit_hardware_state( i915 );
/* need to do this after validation! */
vertex_size = i915->current.vertex_info.size * 4; /* in bytes */
assert(vertex_size >= 12); /* never smaller than 12 bytes */
if (!BEGIN_BATCH( 1 + nr * vertex_size / 4, 0 )) {
FLUSH_BATCH();

View file

@ -83,6 +83,12 @@ i915_vbuf_render_get_vertex_info( struct vbuf_render *render )
{
struct i915_vbuf_render *i915_render = i915_vbuf_render(render);
struct i915_context *i915 = i915_render->i915;
if (i915->dirty) {
/* make sure we have up to date vertex layout */
i915_update_derived( i915 );
}
return &i915->current.vertex_info;
}
@ -143,7 +149,8 @@ i915_vbuf_render_draw( struct vbuf_render *render,
assert(nr_indices);
assert((i915->dirty & ~I915_NEW_VBO) == 0);
/* this seems to be bogus, since we validate state right after this */
/*assert((i915->dirty & ~I915_NEW_VBO) == 0);*/
if (i915->dirty)
i915_update_derived( i915 );

View file

@ -38,6 +38,7 @@
#include "i915_reg.h"
#include "i915_state.h"
#include "i915_state_inlines.h"
#include "i915_fpc.h"
/* The i915 (and related graphics cores) do not support GL_CLAMP. The
@ -416,26 +417,47 @@ static void i915_set_polygon_stipple( struct pipe_context *pipe,
}
static void * i915_create_fs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
static void *
i915_create_fs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
{
return 0;
struct i915_context *i915 = i915_context(pipe);
struct i915_fragment_shader *ifs = CALLOC_STRUCT(i915_fragment_shader);
if (!ifs)
return NULL;
ifs->state = *templ;
/* The shader's compiled to i915 instructions here */
i915_translate_fragment_program(i915, ifs);
return ifs;
}
static void i915_bind_fs_state(struct pipe_context *pipe, void *fs)
static void
i915_bind_fs_state(struct pipe_context *pipe, void *shader)
{
struct i915_context *i915 = i915_context(pipe);
i915->fs = (struct pipe_shader_state *)fs;
i915->fs = (struct i915_fragment_shader*) shader;
i915->dirty |= I915_NEW_FS;
}
static void i915_delete_fs_state(struct pipe_context *pipe, void *shader)
static
void i915_delete_fs_state(struct pipe_context *pipe, void *shader)
{
/*do nothing*/
struct i915_fragment_shader *ifs = (struct i915_fragment_shader *) shader;
if (ifs->program)
FREE(ifs->program);
ifs->program_len = 0;
FREE(ifs);
}
static void *
i915_create_vs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
@ -452,6 +474,8 @@ static void i915_bind_vs_state(struct pipe_context *pipe, void *shader)
/* just pass-through to draw module */
draw_bind_vertex_shader(i915->draw, (struct draw_vertex_shader *) shader);
i915->dirty |= I915_NEW_VS;
}
static void i915_delete_vs_state(struct pipe_context *pipe, void *shader)

View file

@ -27,104 +27,111 @@
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#include "draw/draw_context.h"
#include "draw/draw_vertex.h"
#include "i915_context.h"
#include "i915_state.h"
#include "i915_reg.h"
#include "i915_fpc.h"
#include "pipe/p_shader_tokens.h"
/**
* Determine which post-transform / pre-rasterization vertex attributes
* we need.
* Derived from: fs, setup states.
* Determine the hardware vertex layout.
* Depends on vertex/fragment shader state.
*/
static void calculate_vertex_layout( struct i915_context *i915 )
{
const struct pipe_shader_state *fs = i915->fs;
const struct pipe_shader_state *fs = &i915->fs->state;
const enum interp_mode colorInterp = i915->rasterizer->color_interp;
struct vertex_info vinfo;
uint front0 = 0, back0 = 0, front1 = 0, back1 = 0;
boolean needW = 0;
boolean texCoords[8], colors[2], fog, needW;
uint i;
boolean texCoords[8];
uint src = 0;
int src;
memset(texCoords, 0, sizeof(texCoords));
colors[0] = colors[1] = fog = needW = FALSE;
memset(&vinfo, 0, sizeof(vinfo));
/* pos */
draw_emit_vertex_attr(&vinfo, EMIT_3F, INTERP_LINEAR, src++);
/* Note: we'll set the S4_VFMT_XYZ[W] bits below */
/* Determine which fragment program inputs are needed. Setup HW vertex
* layout below, in the HW-specific attribute order.
*/
for (i = 0; i < fs->num_inputs; i++) {
switch (fs->input_semantic_name[i]) {
case TGSI_SEMANTIC_POSITION:
break;
case TGSI_SEMANTIC_COLOR:
if (fs->input_semantic_index[i] == 0) {
front0 = draw_emit_vertex_attr(&vinfo, EMIT_4UB, colorInterp, src++);
vinfo.hwfmt[0] |= S4_VFMT_COLOR;
}
else {
assert(fs->input_semantic_index[i] == 1);
front1 = draw_emit_vertex_attr(&vinfo, EMIT_4UB, colorInterp, src++);
vinfo.hwfmt[0] |= S4_VFMT_SPEC_FOG;
}
assert(fs->input_semantic_index[i] < 2);
colors[fs->input_semantic_index[i]] = TRUE;
break;
case TGSI_SEMANTIC_GENERIC:
/* usually a texcoord */
{
const uint unit = fs->input_semantic_index[i];
uint hwtc;
assert(unit < 8);
texCoords[unit] = TRUE;
draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_PERSPECTIVE, src++);
hwtc = TEXCOORDFMT_4D;
needW = TRUE;
vinfo.hwfmt[1] |= hwtc << (unit * 4);
}
break;
case TGSI_SEMANTIC_FOG:
debug_printf("i915 fogcoord not implemented yet\n");
draw_emit_vertex_attr(&vinfo, EMIT_1F, INTERP_PERSPECTIVE, src++);
fog = TRUE;
break;
default:
assert(0);
}
}
/* finish up texcoord fields */
for (i = 0; i < 8; i++) {
if (!texCoords[i]) {
const uint hwtc = TEXCOORDFMT_NOT_PRESENT;
vinfo.hwfmt[1] |= hwtc << (i* 4);
}
}
/* go back and fill in the vertex position info now that we have needW */
/* pos */
src = draw_find_vs_output(i915->draw, TGSI_SEMANTIC_POSITION, 0);
if (needW) {
draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_LINEAR, src);
vinfo.hwfmt[0] |= S4_VFMT_XYZW;
vinfo.emit[0] = EMIT_4F;
}
else {
draw_emit_vertex_attr(&vinfo, EMIT_3F, INTERP_LINEAR, src);
vinfo.hwfmt[0] |= S4_VFMT_XYZ;
vinfo.emit[0] = EMIT_3F;
}
/* Additional attributes required for setup: Just twosided
* lighting. Edgeflag is dealt with specially by setting bits in
* the vertex header.
*/
if (i915->rasterizer->light_twoside) {
if (front0) {
back0 = draw_emit_vertex_attr(&vinfo, EMIT_OMIT, colorInterp, src++);
/* hardware point size */
/* XXX todo */
/* primary color */
if (colors[0]) {
src = draw_find_vs_output(i915->draw, TGSI_SEMANTIC_COLOR, 0);
draw_emit_vertex_attr(&vinfo, EMIT_4UB, colorInterp, src);
vinfo.hwfmt[0] |= S4_VFMT_COLOR;
}
/* secondary color */
if (colors[1]) {
src = draw_find_vs_output(i915->draw, TGSI_SEMANTIC_COLOR, 1);
draw_emit_vertex_attr(&vinfo, EMIT_4UB, colorInterp, src);
vinfo.hwfmt[0] |= S4_VFMT_SPEC_FOG;
}
/* fog coord, not fog blend factor */
if (fog) {
src = draw_find_vs_output(i915->draw, TGSI_SEMANTIC_FOG, 0);
draw_emit_vertex_attr(&vinfo, EMIT_1F, INTERP_PERSPECTIVE, src);
vinfo.hwfmt[0] |= S4_VFMT_FOG_PARAM;
}
/* texcoords */
for (i = 0; i < 8; i++) {
uint hwtc;
if (texCoords[i]) {
hwtc = TEXCOORDFMT_4D;
src = draw_find_vs_output(i915->draw, TGSI_SEMANTIC_GENERIC, i);
draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_PERSPECTIVE, src);
}
if (back0) {
back1 = draw_emit_vertex_attr(&vinfo, EMIT_OMIT, colorInterp, src++);
else {
hwtc = TEXCOORDFMT_NOT_PRESENT;
}
vinfo.hwfmt[1] |= hwtc << (i * 4);
}
draw_compute_vertex_size(&vinfo);
@ -148,7 +155,7 @@ static void calculate_vertex_layout( struct i915_context *i915 )
*/
void i915_update_derived( struct i915_context *i915 )
{
if (i915->dirty & (I915_NEW_RASTERIZER | I915_NEW_FS))
if (i915->dirty & (I915_NEW_RASTERIZER | I915_NEW_FS | I915_NEW_VS))
calculate_vertex_layout( i915 );
if (i915->dirty & (I915_NEW_SAMPLER | I915_NEW_TEXTURE))
@ -164,7 +171,6 @@ void i915_update_derived( struct i915_context *i915 )
i915_update_dynamic( i915 );
if (i915->dirty & I915_NEW_FS) {
i915_translate_fragment_program(i915);
i915->hardware_dirty |= I915_HW_PROGRAM; /* XXX right? */
}

View file

@ -99,7 +99,11 @@ i915_emit_hardware_state(struct i915_context *i915 )
2 + I915_TEX_UNITS*3 +
2 + I915_TEX_UNITS*3 +
2 + I915_MAX_CONSTANT*4 +
#if 0
i915->current.program_len +
#else
i915->fs->program_len +
#endif
6
) * 3/2; /* plus 50% margin */
const unsigned relocs = ( I915_TEX_UNITS +
@ -325,15 +329,34 @@ i915_emit_hardware_state(struct i915_context *i915 )
/* 2 + I915_MAX_CONSTANT*4 dwords, 0 relocs */
if (i915->hardware_dirty & I915_HW_PROGRAM)
{
const uint nr = i915->current.num_constants[PIPE_SHADER_FRAGMENT];
assert(nr <= I915_MAX_CONSTANT);
if (nr > 0) {
const uint *c
= (const uint *) i915->current.constants[PIPE_SHADER_FRAGMENT];
/* Collate the user-defined constants with the fragment shader's
* immediates according to the constant_flags[] array.
*/
const uint nr = i915->fs->num_constants;
if (nr) {
uint i;
OUT_BATCH( _3DSTATE_PIXEL_SHADER_CONSTANTS | (nr * 4) );
OUT_BATCH( (1 << (nr - 1)) | ((1 << (nr - 1)) - 1) );
for (i = 0; i < nr; i++) {
const uint *c;
if (i915->fs->constant_flags[i] == I915_CONSTFLAG_USER) {
/* grab user-defined constant */
c = (uint *) i915->current.constants[PIPE_SHADER_FRAGMENT][i];
}
else {
/* emit program constant */
c = (uint *) i915->fs->constants[i];
}
#if 0 /* debug */
{
float *f = (float *) c;
printf("Const %2d: %f %f %f %f %s\n", i, f[0], f[1], f[2], f[3],
(i915->fs->constant_flags[i] == I915_CONSTFLAG_USER
? "user" : "immediate"));
}
#endif
OUT_BATCH(*c++);
OUT_BATCH(*c++);
OUT_BATCH(*c++);
@ -348,9 +371,9 @@ i915_emit_hardware_state(struct i915_context *i915 )
{
uint i;
/* we should always have, at least, a pass-through program */
assert(i915->current.program_len > 0);
for (i = 0; i < i915->current.program_len; i++) {
OUT_BATCH(i915->current.program[i]);
assert(i915->fs->program_len > 0);
for (i = 0; i < i915->fs->program_len; i++) {
OUT_BATCH(i915->fs->program[i]);
}
}

View file

@ -5,6 +5,9 @@ env = env.Clone()
softpipe = env.ConvenienceLibrary(
target = 'softpipe',
source = [
'sp_fs_exec.c',
'sp_fs_sse.c',
'sp_fs_llvm.c',
'sp_clear.c',
'sp_context.c',
'sp_draw_arrays.c',

View file

@ -81,7 +81,7 @@ sp_setup_pos_vector(const struct tgsi_interp_coef *coef,
static void
exec_prepare( struct sp_fragment_shader *base,
exec_prepare( const struct sp_fragment_shader *base,
struct tgsi_exec_machine *machine,
struct tgsi_sampler *samplers )
{
@ -98,7 +98,7 @@ exec_prepare( struct sp_fragment_shader *base,
* interface:
*/
static unsigned
exec_run( struct sp_fragment_shader *base,
exec_run( const struct sp_fragment_shader *base,
struct tgsi_exec_machine *machine,
struct quad_header *quad )
{

View file

@ -146,7 +146,7 @@ shade_quad_llvm(struct quad_stage *qs,
unsigned
run_llvm_fs( struct sp_fragment_shader *base,
run_llvm_fs( const struct sp_fragment_shader *base,
struct foo *machine )
{
}

View file

@ -1165,6 +1165,10 @@ static void setup_begin( struct draw_stage *stage )
struct softpipe_context *sp = setup->softpipe;
const struct pipe_shader_state *fs = &setup->softpipe->fs->shader;
if (sp->dirty) {
softpipe_update_derived(sp);
}
setup->quad.nr_attrs = fs->num_inputs;
sp->quad.first->begin(sp->quad.first);

View file

@ -56,11 +56,12 @@ sp_build_depth_stencil(
void
sp_build_quad_pipeline(struct softpipe_context *sp)
{
boolean early_depth_test =
boolean early_depth_test =
sp->depth_stencil->depth.enabled &&
sp->framebuffer.zsbuf &&
!sp->depth_stencil->alpha.enabled &&
sp->fs->shader.output_semantic_name[0] != TGSI_SEMANTIC_POSITION;
!sp->fs->uses_kill &&
!sp->fs->writes_z;
/* build up the pipeline in reverse order... */

View file

@ -63,14 +63,17 @@ struct tgsi_exec_machine;
struct sp_fragment_shader {
struct pipe_shader_state shader;
void (*prepare)( struct sp_fragment_shader *shader,
boolean uses_kill;
boolean writes_z;
void (*prepare)( const struct sp_fragment_shader *shader,
struct tgsi_exec_machine *machine,
struct tgsi_sampler *samplers);
/* Run the shader - this interface will get cleaned up in the
* future:
*/
unsigned (*run)( struct sp_fragment_shader *shader,
unsigned (*run)( const struct sp_fragment_shader *shader,
struct tgsi_exec_machine *machine,
struct quad_header *quad );

View file

@ -34,33 +34,6 @@
#include "sp_state.h"
/**
* Search vertex program's outputs to find a match for the given
* semantic name/index. Return the index of the output slot.
*
* Return 0 if not found. This will cause the fragment program to use
* vertex attrib 0 (position) in the cases where the fragment program
* attempts to use a missing vertex program output. This is an undefined
* condition that users shouldn't hit anyway.
*/
static int
find_vs_output(struct softpipe_context *sp,
const struct pipe_shader_state *vs,
uint semantic_name,
uint semantic_index)
{
uint i;
for (i = 0; i < vs->num_outputs; i++) {
if (vs->output_semantic_name[i] == semantic_name &&
vs->output_semantic_index[i] == semantic_index)
return i;
}
/* See if the draw module is introducing a new attribute... */
return draw_find_vs_output(sp->draw, semantic_name, semantic_index);
}
/**
* Mark the current vertex layout as "invalid".
* We'll validate the vertex layout later, when we start to actually
@ -114,24 +87,25 @@ softpipe_get_vertex_info(struct softpipe_context *softpipe)
int src;
switch (fs->input_semantic_name[i]) {
case TGSI_SEMANTIC_POSITION:
src = find_vs_output(softpipe, vs, TGSI_SEMANTIC_POSITION, 0);
src = draw_find_vs_output(softpipe->draw,
TGSI_SEMANTIC_POSITION, 0);
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_POS, src);
break;
case TGSI_SEMANTIC_COLOR:
src = find_vs_output(softpipe, vs, TGSI_SEMANTIC_COLOR,
src = draw_find_vs_output(softpipe->draw, TGSI_SEMANTIC_COLOR,
fs->input_semantic_index[i]);
draw_emit_vertex_attr(vinfo, EMIT_4F, colorInterp, src);
break;
case TGSI_SEMANTIC_FOG:
src = find_vs_output(softpipe, vs, TGSI_SEMANTIC_FOG, 0);
src = draw_find_vs_output(softpipe->draw, TGSI_SEMANTIC_FOG, 0);
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, src);
break;
case TGSI_SEMANTIC_GENERIC:
/* this includes texcoords and varying vars */
src = find_vs_output(softpipe, vs, TGSI_SEMANTIC_GENERIC,
src = draw_find_vs_output(softpipe->draw, TGSI_SEMANTIC_GENERIC,
fs->input_semantic_index[i]);
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, src);
break;
@ -141,7 +115,8 @@ softpipe_get_vertex_info(struct softpipe_context *softpipe)
}
}
softpipe->psize_slot = find_vs_output(softpipe, vs, TGSI_SEMANTIC_PSIZE, 0);
softpipe->psize_slot = draw_find_vs_output(softpipe->draw,
TGSI_SEMANTIC_PSIZE, 0);
if (softpipe->psize_slot > 0) {
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_CONSTANT,
softpipe->psize_slot);

View file

@ -36,6 +36,7 @@
#include "pipe/p_shader_tokens.h"
#include "draw/draw_context.h"
#include "tgsi/util/tgsi_dump.h"
#include "tgsi/util/tgsi_scan.h"
void *
@ -44,21 +45,24 @@ softpipe_create_fs_state(struct pipe_context *pipe,
{
struct softpipe_context *softpipe = softpipe_context(pipe);
struct sp_fragment_shader *state;
struct tgsi_shader_info info;
tgsi_scan_shader(templ->tokens, &info);
if (softpipe->dump_fs)
tgsi_dump(templ->tokens, 0);
state = softpipe_create_fs_llvm( softpipe, templ );
if (state)
return state;
state = softpipe_create_fs_sse( softpipe, templ );
if (state)
return state;
state = softpipe_create_fs_exec( softpipe, templ );
if (!state) {
state = softpipe_create_fs_sse( softpipe, templ );
if (!state) {
state = softpipe_create_fs_exec( softpipe, templ );
}
}
assert(state);
state->uses_kill = (info.opcode_count[TGSI_OPCODE_KIL] ||
info.opcode_count[TGSI_OPCODE_KILP]);
state->writes_z = info.writes_z;
return state;
}

View file

@ -343,7 +343,7 @@ nearest_texcoord_unnorm(unsigned wrapMode, float s, unsigned size)
switch (wrapMode) {
case PIPE_TEX_WRAP_CLAMP:
i = ifloor(s);
return CLAMP(i, 0, size-1);
return CLAMP(i, 0, (int) size-1);
case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
/* fall-through */
case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
@ -366,7 +366,7 @@ linear_texcoord_unnorm(unsigned wrapMode, float s, unsigned size,
switch (wrapMode) {
case PIPE_TEX_WRAP_CLAMP:
/* Not exactly what the spec says, but it matches NVIDIA output */
s = CLAMP(s - 0.5F, 0.0, (float) size - 1.0);
s = CLAMP(s - 0.5F, 0.0f, (float) size - 1.0f);
*i0 = ifloor(s);
*i1 = *i0 + 1;
break;
@ -377,7 +377,7 @@ linear_texcoord_unnorm(unsigned wrapMode, float s, unsigned size,
s -= 0.5F;
*i0 = ifloor(s);
*i1 = *i0 + 1;
if (*i1 > size - 1)
if (*i1 > (int) size - 1)
*i1 = size - 1;
break;
default:

View file

@ -1,6 +1,6 @@
/**************************************************************************
*
* Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@ -42,6 +42,14 @@
#endif
#if defined(__MSC__)
/* Avoid 'expression is always true' warning */
#pragma warning(disable: 4296)
#endif /* __MSC__ */
typedef unsigned int uint;
typedef unsigned char ubyte;
typedef unsigned char boolean;
@ -61,8 +69,10 @@ typedef long long int64_t;
typedef unsigned long long uint64_t;
#if defined(_WIN64)
typedef __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else
typedef int intptr_t;
typedef unsigned int uintptr_t;
#endif

View file

@ -31,6 +31,11 @@
#include "p_state.h"
#ifdef __cplusplus
extern "C" {
#endif
struct pipe_state_cache;
/* Opaque driver handles:
@ -226,4 +231,9 @@ struct pipe_context {
unsigned flags );
};
#ifdef __cplusplus
}
#endif
#endif /* PIPE_CONTEXT_H */

View file

@ -30,6 +30,10 @@
#include "p_format.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PIPE_BLENDFACTOR_ONE 0x1
#define PIPE_BLENDFACTOR_SRC_COLOR 0x2
#define PIPE_BLENDFACTOR_SRC_ALPHA 0x3
@ -267,4 +271,8 @@ enum pipe_texture_target {
#define PIPE_CAP_MAX_TEXTURE_LOD_BIAS 19
#define PIPE_CAP_BITMAP_TEXCOORD_BIAS 20
#ifdef __cplusplus
}
#endif
#endif

View file

@ -33,6 +33,10 @@
#include "p_compiler.h"
#include "p_debug.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* The PIPE_FORMAT is a 32-bit wide bitfield that encodes all the information
* needed to uniquely describe a pixel format.
@ -418,4 +422,8 @@ static INLINE uint pf_get_size( enum pipe_format format ) {
return pf_get_bits(format) / 8;
}
#ifdef __cplusplus
}
#endif
#endif

View file

@ -33,6 +33,11 @@
#include "p_winsys.h"
#ifdef __cplusplus
extern "C" {
#endif
static INLINE void *
pipe_surface_map(struct pipe_surface *surface)
{
@ -109,4 +114,8 @@ pipe_texture_reference(struct pipe_context *pipe, struct pipe_texture **ptr,
}
#ifdef __cplusplus
}
#endif
#endif /* P_INLINES_H */

View file

@ -0,0 +1,95 @@
/**************************************************************************
*
* Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef P_POINTER_H
#define P_POINTER_H
#include "p_compiler.h"
#ifdef __cplusplus
extern "C" {
#endif
static INLINE intptr_t
pointer_to_intptr( const void *p )
{
union {
const void *p;
intptr_t i;
} pi;
pi.p = p;
return pi.i;
}
static INLINE void *
intptr_to_pointer( intptr_t i )
{
union {
void *p;
intptr_t i;
} pi;
pi.i = i;
return pi.p;
}
static INLINE uintptr_t
pointer_to_uintptr( const void *ptr )
{
union {
const void *p;
uintptr_t u;
} pu;
pu.p = ptr;
return pu.u;
}
static INLINE void *
uintptr_to_pointer( uintptr_t u )
{
union {
void *p;
uintptr_t u;
} pu;
pu.u = u;
return pu.p;
}
/**
* Return a pointer aligned to next multiple of N bytes.
*/
static INLINE void *
align_pointer( const void *unaligned, uintptr_t alignment )
{
uintptr_t aligned = (pointer_to_uintptr( unaligned ) + alignment - 1) & ~(alignment - 1);
return uintptr_to_pointer( aligned );
}
#ifdef __cplusplus
}
#endif
#endif /* P_POINTER_H */

View file

@ -50,6 +50,8 @@ struct tgsi_token
#define TGSI_FILE_SAMPLER 5
#define TGSI_FILE_ADDRESS 6
#define TGSI_FILE_IMMEDIATE 7
#define TGSI_FILE_COUNT 8 /**< how many TGSI_FILE_ types */
#define TGSI_DECLARE_RANGE 0
#define TGSI_DECLARE_MASK 1

View file

@ -42,6 +42,12 @@
#include "p_defines.h"
#include "p_format.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Implementation limits
*/
@ -326,4 +332,8 @@ struct pipe_vertex_element
};
#ifdef __cplusplus
}
#endif
#endif

View file

@ -30,16 +30,17 @@
#include "p_compiler.h"
#include "p_debug.h"
#include "p_pointer.h"
#include <math.h>
#ifdef WIN32
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
#ifdef WIN32
void * __stdcall
EngAllocMem(
unsigned long Flags,
@ -50,10 +51,6 @@ void __stdcall
EngFreeMem(
void *Mem );
#ifdef __cplusplus
}
#endif
static INLINE void *
MALLOC( unsigned size )
{
@ -114,33 +111,6 @@ REALLOC( void *old_ptr, unsigned old_size, unsigned new_size )
#define CALLOC_STRUCT(T) (struct T *) CALLOC(1, sizeof(struct T))
/**
* Return a pointer aligned to next multiple of N bytes.
*/
static INLINE void *
align_pointer( void *unaligned, uint alignment )
{
if (sizeof(void *) == 64) {
union {
void *p;
uint64 u;
} pu;
pu.p = unaligned;
pu.u = (pu.u + alignment - 1) & ~(uint64) (alignment - 1);
return pu.p;
}
else {
/* 32-bit pointers */
union {
void *p;
uint u;
} pu;
pu.p = unaligned;
pu.u = (pu.u + alignment - 1) & ~(alignment - 1);
return pu.p;
}
}
/**
* Return memory on given byte alignment
*/
@ -405,4 +375,8 @@ extern void pipe_copy_rect(ubyte * dst, unsigned cpp, unsigned dst_pitch,
int src_pitch, unsigned src_x, int src_y);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -25,12 +25,6 @@
*
**************************************************************************/
#ifndef P_WINSYS_H
#define P_WINSYS_H
#include "p_format.h"
/**
* \file
* This is the interface that Gallium3D requires any window system
@ -38,6 +32,17 @@
* which is public.
*/
#ifndef P_WINSYS_H
#define P_WINSYS_H
#include "p_format.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Opaque type */
struct pipe_fence_handle;
@ -156,5 +161,8 @@ struct pipe_winsys
};
#ifdef __cplusplus
}
#endif
#endif /* P_WINSYS_H */

View file

@ -4,7 +4,8 @@ if dri:
SConscript([
'dri/SConscript',
])
else:
if 'xlib' in env['drivers'] and not dri:
SConscript([
'xlib/SConscript',
])

View file

@ -26,6 +26,7 @@
**************************************************************************/
#include <errno.h>
#include <stdio.h>
#include "intel_batchbuffer.h"
#include "intel_context.h"
#include "intel_screen.h"

View file

@ -28,6 +28,7 @@
#ifndef INTEL_BATCHBUFFER_H
#define INTEL_BATCHBUFFER_H
#include "pipe/p_debug.h"
#include "pipe/p_compiler.h"
#include "dri_bufmgr.h"

View file

@ -188,7 +188,8 @@ intelCreateContext(const __GLcontextModes * visual,
/*
* Pipe-related setup
*/
if (!getenv("INTEL_HW")) {
if (getenv("INTEL_SP")) {
/* use softpipe driver instead of hw */
pipe = intel_create_softpipe( intel, intelScreen->winsys );
}
else {

View file

@ -1,9 +0,0 @@
# Makefile for Mesa for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
all :
# PIPE is avalailable on VMS7.0 and higher. For lower versions split the
#command in two conditional command. JJ
if f$search("SYS$SYSTEM:CXX$COMPILER.EXE") .nes. "" then pipe set default [.sgi] ; $(MMS)$(MMSQUALIFIERS)
if f$search("SYS$SYSTEM:CXX$COMPILER.EXE") .eqs. "" then pipe set default [.mesa] ; $(MMS)$(MMSQUALIFIERS)
set default [-]

View file

@ -1,100 +0,0 @@
# Mesa 3-D graphics library
# Version: 4.0
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP glu makefile v1.5 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Available options:
#
# Environment variables:
# CFLAGS
#
# Targets:
# all: build GLU
# clean: remove object files
#
.PHONY: all clean
TOP = ../../..
LIBDIR = $(TOP)/lib
GLU_LIB = libglu.a
GLU_DXE = glu.dxe
GLU_IMP = libiglu.a
export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -I$(TOP)/include
AR = ar
ARFLAGS = crus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
CORE_SOURCES = \
glu.c \
mipmap.c \
nurbs.c \
nurbscrv.c \
nurbssrf.c \
nurbsutl.c \
polytest.c \
project.c \
quadric.c \
tess.c \
tesselat.c
SOURCES = $(CORE_SOURCES)
OBJECTS = $(SOURCES:.c=.o)
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP)
$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLU_DXE))
else
-dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $^
endif
clean:
-$(call UNLINK,*.o)

View file

@ -1,61 +0,0 @@
# Makefile for GLU for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
.first
define gl [-.include.gl]
.include [-]mms.config
##### MACROS #####
VPATH = RCS
INCDIR = $disk2:[-.include]
LIBDIR = [-.lib]
CFLAGS = /include=$(INCDIR)/define=(FBIND=1)/name=(as_is,short)/float=ieee/ieee=denorm
SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \
polytest.c project.c quadric.c tess.c tesselat.c
OBJECTS =glu.obj,mipmap.obj,nurbs.obj,nurbscrv.obj,nurbssrf.obj,nurbsutl.obj,\
polytest.obj,project.obj,quadric.obj,tess.obj,tesselat.obj
##### RULES #####
VERSION=MesaGlu V3.2
##### TARGETS #####
# Make the library:
$(LIBDIR)$(GLU_LIB) : $(OBJECTS)
.ifdef SHARE
@ WRITE_ SYS$OUTPUT " generating mesagl1.opt"
@ OPEN_/WRITE FILE mesagl1.opt
@ WRITE_ FILE "!"
@ WRITE_ FILE "! mesagl1.opt generated by DESCRIP.$(MMS_EXT)"
@ WRITE_ FILE "!"
@ WRITE_ FILE "IDENTIFICATION=""$(VERSION)"""
@ WRITE_ FILE "GSMATCH=LEQUAL,3,2
@ WRITE_ FILE "$(OBJECTS)"
@ WRITE_ FILE "[-.lib]libmesagl.exe/SHARE"
@ WRITE_ FILE "SYS$SHARE:DECW$XEXTLIBSHR/SHARE"
@ WRITE_ FILE "SYS$SHARE:DECW$XLIBSHR/SHARE"
@ CLOSE_ FILE
@ WRITE_ SYS$OUTPUT " generating mesagl.map ..."
@ LINK_/NODEB/NOSHARE/NOEXE/MAP=mesagl.map/FULL mesagl1.opt/OPT
@ WRITE_ SYS$OUTPUT " analyzing mesagl.map ..."
@ @[-.vms]ANALYZE_MAP.COM mesagl.map mesagl.opt
@ WRITE_ SYS$OUTPUT " linking $(GLU_LIB) ..."
@ LINK_/noinform/NODEB/SHARE=$(GLU_LIB)/MAP=mesagl.map/FULL mesagl1.opt/opt,mesagl.opt/opt
.else
@ $(MAKELIB) $(GLU_LIB) $(OBJECTS)
.endif
@ rename $(GLU_LIB)* $(LIBDIR)
clean :
delete *.obj;*
purge
include mms_depend.

View file

@ -1,15 +0,0 @@
# DO NOT DELETE THIS LINE -- make depend depends on it.
glu.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h
mipmap.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h
nurbs.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h nurbs.h
nurbscrv.obj : nurbs.h gluP.h [-.include.gl]gl.h [-.include.gl]glu.h
nurbssrf.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h nurbs.h
nurbsutl.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h nurbs.h
project.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h
quadric.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h
tess.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h
tess_fist.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h
tess_hash.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h
tess_heap.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h
tess_clip.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h

View file

@ -1,188 +0,0 @@
# Mesa 3-D graphics library
# Version: 4.0
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP glu makefile v1.5 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Available options:
#
# Environment variables:
# CFLAGS
#
# Targets:
# all: build GLU
# clean: remove object files
#
.PHONY: all clean
TOP = ../../..
LIBDIR = $(TOP)/lib
GLU_LIB = libglu.a
GLU_DXE = glu.dxe
GLU_IMP = libiglu.a
export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude
CXX = gpp
CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
AR = ar
ARFLAGS = crus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
C_SOURCES = \
libutil/error.c \
libutil/glue.c \
libutil/mipmap.c \
libutil/project.c \
libutil/quad.c \
libutil/registry.c \
libtess/dict.c \
libtess/geom.c \
libtess/memalloc.c \
libtess/mesh.c \
libtess/normal.c \
libtess/priorityq.c \
libtess/render.c \
libtess/sweep.c \
libtess/tess.c \
libtess/tessmono.c
CC_SOURCES = \
libnurbs/interface/bezierEval.cc \
libnurbs/interface/bezierPatch.cc \
libnurbs/interface/bezierPatchMesh.cc \
libnurbs/interface/glcurveval.cc \
libnurbs/interface/glinterface.cc \
libnurbs/interface/glrenderer.cc \
libnurbs/interface/glsurfeval.cc \
libnurbs/interface/incurveeval.cc \
libnurbs/interface/insurfeval.cc \
libnurbs/internals/arc.cc \
libnurbs/internals/arcsorter.cc \
libnurbs/internals/arctess.cc \
libnurbs/internals/backend.cc \
libnurbs/internals/basiccrveval.cc \
libnurbs/internals/basicsurfeval.cc \
libnurbs/internals/bin.cc \
libnurbs/internals/bufpool.cc \
libnurbs/internals/cachingeval.cc \
libnurbs/internals/ccw.cc \
libnurbs/internals/coveandtiler.cc \
libnurbs/internals/curve.cc \
libnurbs/internals/curvelist.cc \
libnurbs/internals/curvesub.cc \
libnurbs/internals/dataTransform.cc \
libnurbs/internals/displaylist.cc \
libnurbs/internals/flist.cc \
libnurbs/internals/flistsorter.cc \
libnurbs/internals/hull.cc \
libnurbs/internals/intersect.cc \
libnurbs/internals/knotvector.cc \
libnurbs/internals/mapdesc.cc \
libnurbs/internals/mapdescv.cc \
libnurbs/internals/maplist.cc \
libnurbs/internals/mesher.cc \
libnurbs/internals/monoTriangulationBackend.cc \
libnurbs/internals/monotonizer.cc \
libnurbs/internals/mycode.cc \
libnurbs/internals/nurbsinterfac.cc \
libnurbs/internals/nurbstess.cc \
libnurbs/internals/patch.cc \
libnurbs/internals/patchlist.cc \
libnurbs/internals/quilt.cc \
libnurbs/internals/reader.cc \
libnurbs/internals/renderhints.cc \
libnurbs/internals/slicer.cc \
libnurbs/internals/sorter.cc \
libnurbs/internals/splitarcs.cc \
libnurbs/internals/subdivider.cc \
libnurbs/internals/tobezier.cc \
libnurbs/internals/trimline.cc \
libnurbs/internals/trimregion.cc \
libnurbs/internals/trimvertpool.cc \
libnurbs/internals/uarray.cc \
libnurbs/internals/varray.cc \
libnurbs/nurbtess/directedLine.cc \
libnurbs/nurbtess/gridWrap.cc \
libnurbs/nurbtess/monoChain.cc \
libnurbs/nurbtess/monoPolyPart.cc \
libnurbs/nurbtess/monoTriangulation.cc \
libnurbs/nurbtess/partitionX.cc \
libnurbs/nurbtess/partitionY.cc \
libnurbs/nurbtess/polyDBG.cc \
libnurbs/nurbtess/polyUtil.cc \
libnurbs/nurbtess/primitiveStream.cc \
libnurbs/nurbtess/quicksort.cc \
libnurbs/nurbtess/rectBlock.cc \
libnurbs/nurbtess/sampleComp.cc \
libnurbs/nurbtess/sampleCompBot.cc \
libnurbs/nurbtess/sampleCompRight.cc \
libnurbs/nurbtess/sampleCompTop.cc \
libnurbs/nurbtess/sampleMonoPoly.cc \
libnurbs/nurbtess/sampledLine.cc \
libnurbs/nurbtess/searchTree.cc
SOURCES = $(C_SOURCES) $(CC_SOURCES)
OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.cc.o:
$(CXX) -o $@ $(CXXFLAGS) -c $<
all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP)
$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLU_DXE))
else
-dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $^
endif
clean:
-$(call UNLINK,libutil/*.o)
-$(call UNLINK,libtess/*.o)
-$(call UNLINK,libnurbs/interface/*.o)
-$(call UNLINK,libnurbs/internals/*.o)
-$(call UNLINK,libnurbs/nurbtess/*.o)

View file

@ -1,229 +0,0 @@
# Mesa 3-D graphics library
# Version: 5.1
#
# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# MinGW core makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
# MinGW core-glu makefile updated for Mesa 7.0
#
# Updated : by Heromyth, on 2007-7-21
# Email : zxpmyth@yahoo.com.cn
# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
# The others havn't been tested yet.
# 2) The generated DLLs are *not* compatible with the ones built
# with the other compilers like VC8, especially for GLUT.
# 3) Although more tests are needed, it can be used individually!
#
# Available options:
#
# Environment variables:
# CFLAGS
#
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most WMesa code and requires fxMesa.
# As a consequence, you'll need the Win32 Glide3
# library to build any application.
# default = no
# ICD=1 build the installable client driver interface
# (windows opengl driver interface)
# default = no
# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
# default = no
#
# Targets:
# all: build GL
# clean: remove object files
#
.PHONY: all clean
.INTERMEDIATE: x86/gen_matypes.exe
.SUFFIXES: .rc .res
# Set this to the prefix of your build tools, i.e. mingw32-
TOOLS_PREFIX = mingw32-
TOP = ../../..
LIBDIR = $(TOP)/lib
GLU_DLL = glu32.dll
GLU_IMP = libglu32.a
GLU_DEF = glu.def
include $(TOP)/configs/config.mgw
GL_USING_STDCALL ?= 1
LDLIBS = -L$(LIBDIR) -lopengl32
LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GLU_IMP) -Wl,--output-def=$(LIBDIR)/$(GLU_DEF)
CFLAGS += -DBUILD_GLU32 -D_DLL
ifeq ($(GL_USING_STDCALL),1)
LDFLAGS += -Wl,--add-stdcall-alias
else
CFLAGS += -DGL_NO_STDCALL
endif
CC = gcc
CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude
CXX = g++
CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
AR = ar
ARFLAGS = crus
UNLINK = del $(subst /,\,$(1))
ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = $(RM) $(1)
endif
ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
UNLINK = $(RM) $(1)
endif
C_SOURCES = \
libutil/error.c \
libutil/glue.c \
libutil/mipmap.c \
libutil/project.c \
libutil/quad.c \
libutil/registry.c \
libtess/dict.c \
libtess/geom.c \
libtess/memalloc.c \
libtess/mesh.c \
libtess/normal.c \
libtess/priorityq.c \
libtess/render.c \
libtess/sweep.c \
libtess/tess.c \
libtess/tessmono.c
CC_SOURCES = \
libnurbs/interface/bezierEval.cc \
libnurbs/interface/bezierPatch.cc \
libnurbs/interface/bezierPatchMesh.cc \
libnurbs/interface/glcurveval.cc \
libnurbs/interface/glinterface.cc \
libnurbs/interface/glrenderer.cc \
libnurbs/interface/glsurfeval.cc \
libnurbs/interface/incurveeval.cc \
libnurbs/interface/insurfeval.cc \
libnurbs/internals/arc.cc \
libnurbs/internals/arcsorter.cc \
libnurbs/internals/arctess.cc \
libnurbs/internals/backend.cc \
libnurbs/internals/basiccrveval.cc \
libnurbs/internals/basicsurfeval.cc \
libnurbs/internals/bin.cc \
libnurbs/internals/bufpool.cc \
libnurbs/internals/cachingeval.cc \
libnurbs/internals/ccw.cc \
libnurbs/internals/coveandtiler.cc \
libnurbs/internals/curve.cc \
libnurbs/internals/curvelist.cc \
libnurbs/internals/curvesub.cc \
libnurbs/internals/dataTransform.cc \
libnurbs/internals/displaylist.cc \
libnurbs/internals/flist.cc \
libnurbs/internals/flistsorter.cc \
libnurbs/internals/hull.cc \
libnurbs/internals/intersect.cc \
libnurbs/internals/knotvector.cc \
libnurbs/internals/mapdesc.cc \
libnurbs/internals/mapdescv.cc \
libnurbs/internals/maplist.cc \
libnurbs/internals/mesher.cc \
libnurbs/internals/monoTriangulationBackend.cc \
libnurbs/internals/monotonizer.cc \
libnurbs/internals/mycode.cc \
libnurbs/internals/nurbsinterfac.cc \
libnurbs/internals/nurbstess.cc \
libnurbs/internals/patch.cc \
libnurbs/internals/patchlist.cc \
libnurbs/internals/quilt.cc \
libnurbs/internals/reader.cc \
libnurbs/internals/renderhints.cc \
libnurbs/internals/slicer.cc \
libnurbs/internals/sorter.cc \
libnurbs/internals/splitarcs.cc \
libnurbs/internals/subdivider.cc \
libnurbs/internals/tobezier.cc \
libnurbs/internals/trimline.cc \
libnurbs/internals/trimregion.cc \
libnurbs/internals/trimvertpool.cc \
libnurbs/internals/uarray.cc \
libnurbs/internals/varray.cc \
libnurbs/nurbtess/directedLine.cc \
libnurbs/nurbtess/gridWrap.cc \
libnurbs/nurbtess/monoChain.cc \
libnurbs/nurbtess/monoPolyPart.cc \
libnurbs/nurbtess/monoTriangulation.cc \
libnurbs/nurbtess/partitionX.cc \
libnurbs/nurbtess/partitionY.cc \
libnurbs/nurbtess/polyDBG.cc \
libnurbs/nurbtess/polyUtil.cc \
libnurbs/nurbtess/primitiveStream.cc \
libnurbs/nurbtess/quicksort.cc \
libnurbs/nurbtess/rectBlock.cc \
libnurbs/nurbtess/sampleComp.cc \
libnurbs/nurbtess/sampleCompBot.cc \
libnurbs/nurbtess/sampleCompRight.cc \
libnurbs/nurbtess/sampleCompTop.cc \
libnurbs/nurbtess/sampleMonoPoly.cc \
libnurbs/nurbtess/sampledLine.cc \
libnurbs/nurbtess/searchTree.cc
SOURCES = $(C_SOURCES) $(CC_SOURCES)
OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.cc.o:
$(CXX) -o $@ $(CXXFLAGS) -c $<
all: $(LIBDIR) $(LIBDIR)/$(GLU_DLL) $(LIBDIR)/$(GLU_IMP)
$(LIBDIR):
mkdir -p $(LIBDIR)
$(LIBDIR)/$(GLU_DLL) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
g++ -shared -fPIC -o $(LIBDIR)/$(GLU_DLL) $(LDFLAGS) \
$^ $(LDLIBS)
clean:
-$(call UNLINK,libutil/*.o)
-$(call UNLINK,libtess/*.o)
-$(call UNLINK,libnurbs/interface/*.o)
-$(call UNLINK,libnurbs/internals/*.o)
-$(call UNLINK,libnurbs/nurbtess/*.o)

View file

@ -1,451 +0,0 @@
# Makefile for GLU for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
.first
define gl [---.include.gl]
.include [---]mms.config
##### MACROS #####
VPATH = RCS
INCDIR =([-.include],[.include],[.internals],[.libnurbs.internals],\
[.libnurbs.interface],[.libnurbs.nurbtess])
LIBDIR = [---.lib]
CFLAGS = /include=$(INCDIR)/name=(as_is,short)/float=ieee/ieee=denorm
LU_OBJECTS=\
[.libutil]error.obj, \
[.libutil]glue.obj, \
[.libutil]mipmap.obj,\
[.libutil]project.obj,\
[.libutil]quad.obj, \
[.libutil]registry.obj
LT_OBJECTS=[.libtess]dict.obj, \
[.libtess]geom.obj, \
[.libtess]memalloc.obj,\
[.libtess]mesh.obj, \
[.libtess]normal.obj,\
[.libtess]priorityq.obj,\
[.libtess]render.obj,\
[.libtess]sweep.obj, \
[.libtess]tess.obj, \
[.libtess]tessmono.obj
LI_OBJECTS=[.libnurbs.interface]bezierEval.obj, \
[.libnurbs.interface]bezierPatch.obj, \
[.libnurbs.interface]bezierPatchMesh.obj, \
[.libnurbs.interface]glcurveval.obj, \
[.libnurbs.interface]glinterface.obj
LI_OBJECTS1=[.libnurbs.interface]glrenderer.obj, \
[.libnurbs.interface]glsurfeval.obj, \
[.libnurbs.interface]incurveeval.obj, \
[.libnurbs.interface]insurfeval.obj
LI2_OBJECTS=[.libnurbs.internals]arc.obj, \
[.libnurbs.internals]arcsorter.obj, \
[.libnurbs.internals]arctess.obj, \
[.libnurbs.internals]backend.obj, \
[.libnurbs.internals]basiccrveval.obj, \
[.libnurbs.internals]basicsurfeval.obj
LI2_OBJECTS1=[.libnurbs.internals]bin.obj, \
[.libnurbs.internals]bufpool.obj, \
[.libnurbs.internals]cachingeval.obj, \
[.libnurbs.internals]ccw.obj, \
[.libnurbs.internals]coveandtiler.obj, \
[.libnurbs.internals]curve.obj, \
[.libnurbs.internals]curvelist.obj
LI2_OBJECTS2=[.libnurbs.internals]curvesub.obj, \
[.libnurbs.internals]dataTransform.obj, \
[.libnurbs.internals]displaylist.obj, \
[.libnurbs.internals]flist.obj, \
[.libnurbs.internals]flistsorter.obj
LI2_OBJECTS3=[.libnurbs.internals]hull.obj, \
[.libnurbs.internals]intersect.obj, \
[.libnurbs.internals]knotvector.obj, \
[.libnurbs.internals]mapdesc.obj
LI2_OBJECTS4=[.libnurbs.internals]mapdescv.obj, \
[.libnurbs.internals]maplist.obj, \
[.libnurbs.internals]mesher.obj, \
[.libnurbs.internals]monoTriangulationBackend.obj,\
[.libnurbs.internals]monotonizer.obj
LI2_OBJECTS5=[.libnurbs.internals]mycode.obj, \
[.libnurbs.internals]nurbsinterfac.obj, \
[.libnurbs.internals]nurbstess.obj, \
[.libnurbs.internals]patch.obj
LI2_OBJECTS6=[.libnurbs.internals]patchlist.obj, \
[.libnurbs.internals]quilt.obj, \
[.libnurbs.internals]reader.obj, \
[.libnurbs.internals]renderhints.obj, \
[.libnurbs.internals]slicer.obj
LI2_OBJECTS7=[.libnurbs.internals]sorter.obj, \
[.libnurbs.internals]splitarcs.obj, \
[.libnurbs.internals]subdivider.obj, \
[.libnurbs.internals]tobezier.obj
LI2_OBJECTS8=[.libnurbs.internals]trimline.obj, \
[.libnurbs.internals]trimregion.obj, \
[.libnurbs.internals]trimvertpool.obj, \
[.libnurbs.internals]uarray.obj, \
[.libnurbs.internals]varray.obj
LN_OBJECTS=[.libnurbs.nurbtess]directedLine.obj, \
[.libnurbs.nurbtess]gridWrap.obj, \
[.libnurbs.nurbtess]monoChain.obj, \
[.libnurbs.nurbtess]monoPolyPart.obj, \
[.libnurbs.nurbtess]monoTriangulation.obj
LN_OBJECTS1=[.libnurbs.nurbtess]partitionX.obj, \
[.libnurbs.nurbtess]partitionY.obj, \
[.libnurbs.nurbtess]polyDBG.obj
LN_OBJECTS2=[.libnurbs.nurbtess]polyUtil.obj, \
[.libnurbs.nurbtess]primitiveStream.obj, \
[.libnurbs.nurbtess]quicksort.obj, \
[.libnurbs.nurbtess]rectBlock.obj
LN_OBJECTS3=[.libnurbs.nurbtess]sampleComp.obj, \
[.libnurbs.nurbtess]sampleCompBot.obj, \
[.libnurbs.nurbtess]sampleCompRight.obj
LN_OBJECTS4=[.libnurbs.nurbtess]sampleCompTop.obj, \
[.libnurbs.nurbtess]sampleMonoPoly.obj,\
[.libnurbs.nurbtess]sampledLine.obj, \
[.libnurbs.nurbtess]searchTree.obj
##### RULES #####
VERSION=MesaGlu V3.5
##### TARGETS #####
# Make the library:
$(LIBDIR)$(GLU_LIB) : $(LU_OBJECTS) $(LT_OBJECTS) $(LI_OBJECTS) $(LI_OBJECTS1)\
$(LI2_OBJECTS) $(LI2_OBJECTS1) $(LI2_OBJECTS2)\
$(LI2_OBJECTS3) $(LI2_OBJECTS4) $(LI2_OBJECTS5)\
$(LI2_OBJECTS6) $(LI2_OBJECTS7) $(LI2_OBJECTS8)\
$(LN_OBJECTS) $(LN_OBJECTS1) $(LN_OBJECTS2)\
$(LN_OBJECTS3) $(LN_OBJECTS4)
@ $(MAKELIB) $(GLU_LIB) $(LU_OBJECTS),$(LT_OBJECTS),$(LI_OBJECTS),\
$(LI2_OBJECTS),$(LN_OBJECTS)
@ rename $(GLU_LIB)* $(LIBDIR)
.ifdef SHARE
@ WRITE_ SYS$OUTPUT " generating mesagl1.opt"
@ OPEN_/WRITE FILE mesagl1.opt
@ WRITE_ FILE "!"
@ WRITE_ FILE "! mesagl1.opt generated by DESCRIP.$(MMS_EXT)"
@ WRITE_ FILE "!"
@ WRITE_ FILE "IDENTIFICATION=""$(VERSION)"""
@ WRITE_ FILE "GSMATCH=LEQUAL,3,5
@ WRITE_ FILE "$(LU_OBJECTS)"
@ WRITE_ FILE "$(LT_OBJECTS)"
@ WRITE_ FILE "$(LI_OBJECTS)"
@ WRITE_ FILE "$(LI_OBJECTS1)"
@ WRITE_ FILE "$(LI2_OBJECTS)"
@ WRITE_ FILE "$(LI2_OBJECTS1)"
@ WRITE_ FILE "$(LI2_OBJECTS2)"
@ WRITE_ FILE "$(LI2_OBJECTS3)"
@ WRITE_ FILE "$(LI2_OBJECTS4)"
@ WRITE_ FILE "$(LI2_OBJECTS5)"
@ WRITE_ FILE "$(LI2_OBJECTS6)"
@ WRITE_ FILE "$(LI2_OBJECTS7)"
@ WRITE_ FILE "$(LI2_OBJECTS8)"
@ WRITE_ FILE "$(LN_OBJECTS)"
@ WRITE_ FILE "$(LN_OBJECTS1)"
@ WRITE_ FILE "$(LN_OBJECTS2)"
@ WRITE_ FILE "$(LN_OBJECTS3)"
@ WRITE_ FILE "$(LN_OBJECTS4)"
@ WRITE_ FILE "[---.lib]libmesagl.exe/SHARE"
@ WRITE_ FILE "SYS$SHARE:DECW$XEXTLIBSHR/SHARE"
@ WRITE_ FILE "SYS$SHARE:DECW$XLIBSHR/SHARE"
@ CLOSE_ FILE
# @ WRITE_ SYS$OUTPUT " generating mesagl.map ..."
# @ CXXLINK_/NODEB/NOSHARE/NOEXE/MAP=mesagl.map/FULL mesagl1.opt/OPT
# @ WRITE_ SYS$OUTPUT " analyzing mesagl.map ..."
# @ @[-.vms]ANALYZE_MAP.COM mesagl.map mesagl.opt
@ WRITE_ SYS$OUTPUT " linking $(GLU_SHAR) ..."
# @ CXXLINK_/noinform/NODEB/SHARE=$(GLU_SHAR)/MAP=mesagl.map/FULL mesagl1.opt/opt,mesagl.opt/opt
@ CXXLINK_/noinform/NODEB/SHARE=$(GLU_SHAR)/MAP=mesagl.map/FULL mesagl1.opt/opt,mesaglu.opt/opt
@ rename $(GLU_SHAR)* $(LIBDIR)
.endif
clean :
delete [...]*.obj;*
purge
[.libutil]error.obj : [.libutil]error.c
$(CC) $(CFLAGS) /obj=[.libutil]error.obj [.libutil]error.c
[.libutil]glue.obj : [.libutil]glue.c
$(CC) $(CFLAGS) /obj=[.libutil]glue.obj [.libutil]glue.c
[.libutil]mipmap.obj : [.libutil]mipmap.c
$(CC) $(CFLAGS) /obj=[.libutil]mipmap.obj [.libutil]mipmap.c
[.libutil]project.obj : [.libutil]project.c
$(CC) $(CFLAGS) /obj=[.libutil]project.obj [.libutil]project.c
[.libutil]quad.obj : [.libutil]quad.c
$(CC) $(CFLAGS) /obj=[.libutil]quad.obj [.libutil]quad.c
[.libutil]registry.obj : [.libutil]registry.c
$(CC) $(CFLAGS) /obj=[.libutil]registry.obj [.libutil]registry.c
[.libtess]dict.obj : [.libtess]dict.c
$(CC) $(CFLAGS) /obj=[.libtess]dict.obj [.libtess]dict.c
[.libtess]geom.obj : [.libtess]geom.c
$(CC) $(CFLAGS) /obj=[.libtess]geom.obj [.libtess]geom.c
[.libtess]memalloc.obj : [.libtess]memalloc.c
$(CC) $(CFLAGS) /obj=[.libtess]memalloc.obj [.libtess]memalloc.c
[.libtess]mesh.obj : [.libtess]mesh.c
$(CC) $(CFLAGS) /obj=[.libtess]mesh.obj [.libtess]mesh.c
[.libtess]normal.obj : [.libtess]normal.c
$(CC) $(CFLAGS) /obj=[.libtess]normal.obj [.libtess]normal.c
[.libtess]priorityq.obj : [.libtess]priorityq.c
$(CC) $(CFLAGS) /obj=[.libtess]priorityq.obj [.libtess]priorityq.c
[.libtess]render.obj : [.libtess]render.c
$(CC) $(CFLAGS) /obj=[.libtess]render.obj [.libtess]render.c
[.libtess]sweep.obj : [.libtess]sweep.c
$(CC) $(CFLAGS) /obj=[.libtess]sweep.obj [.libtess]sweep.c
[.libtess]tess.obj : [.libtess]tess.c
$(CC) $(CFLAGS) /obj=[.libtess]tess.obj [.libtess]tess.c
[.libtess]tessmono.obj : [.libtess]tessmono.c
$(CC) $(CFLAGS) /obj=[.libtess]tessmono.obj [.libtess]tessmono.c
[.libnurbs.interface]bezierEval.obj : [.libnurbs.interface]bezierEval.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.interface]bezierEval.obj [.libnurbs.interface]bezierEval.cc
[.libnurbs.interface]bezierPatch.obj : [.libnurbs.interface]bezierPatch.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.interface]bezierPatch.obj [.libnurbs.interface]bezierPatch.cc
[.libnurbs.interface]bezierPatchMesh.obj : [.libnurbs.interface]bezierPatchMesh.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.interface]bezierPatchMesh.obj [.libnurbs.interface]bezierPatchMesh.cc
[.libnurbs.interface]glcurveval.obj : [.libnurbs.interface]glcurveval.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.interface]glcurveval.obj [.libnurbs.interface]glcurveval.cc
[.libnurbs.interface]glinterface.obj : [.libnurbs.interface]glinterface.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.interface]glinterface.obj [.libnurbs.interface]glinterface.cc
[.libnurbs.interface]glrenderer.obj : [.libnurbs.interface]glrenderer.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.interface]glrenderer.obj [.libnurbs.interface]glrenderer.cc
[.libnurbs.interface]glsurfeval.obj : [.libnurbs.interface]glsurfeval.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.interface]glsurfeval.obj [.libnurbs.interface]glsurfeval.cc
[.libnurbs.interface]incurveeval.obj : [.libnurbs.interface]incurveeval.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.interface]incurveeval.obj [.libnurbs.interface]incurveeval.cc
[.libnurbs.interface]insurfeval.obj : [.libnurbs.interface]insurfeval.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.interface]insurfeval.obj [.libnurbs.interface]insurfeval.cc
[.libnurbs.internals]arc.obj : [.libnurbs.internals]arc.cc
$(CXX) $(CFLAGS)/list/show=all /obj=[.libnurbs.internals]arc.obj [.libnurbs.internals]arc.cc
[.libnurbs.internals]arcsorter.obj : [.libnurbs.internals]arcsorter.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]arcsorter.obj [.libnurbs.internals]arcsorter.cc
[.libnurbs.internals]arctess.obj : [.libnurbs.internals]arctess.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]arctess.obj [.libnurbs.internals]arctess.cc
[.libnurbs.internals]backend.obj : [.libnurbs.internals]backend.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]backend.obj [.libnurbs.internals]backend.cc
[.libnurbs.internals]basiccrveval.obj : [.libnurbs.internals]basiccrveval.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]basiccrveval.obj [.libnurbs.internals]basiccrveval.cc
[.libnurbs.internals]basicsurfeval.obj : [.libnurbs.internals]basicsurfeval.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]basicsurfeval.obj [.libnurbs.internals]basicsurfeval.cc
[.libnurbs.internals]bin.obj : [.libnurbs.internals]bin.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]bin.obj [.libnurbs.internals]bin.cc
[.libnurbs.internals]bufpool.obj : [.libnurbs.internals]bufpool.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]bufpool.obj [.libnurbs.internals]bufpool.cc
[.libnurbs.internals]cachingeval.obj : [.libnurbs.internals]cachingeval.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]cachingeval.obj [.libnurbs.internals]cachingeval.cc
[.libnurbs.internals]ccw.obj : [.libnurbs.internals]ccw.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]ccw.obj [.libnurbs.internals]ccw.cc
[.libnurbs.internals]coveandtiler.obj : [.libnurbs.internals]coveandtiler.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]coveandtiler.obj [.libnurbs.internals]coveandtiler.cc
[.libnurbs.internals]curve.obj : [.libnurbs.internals]curve.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]curve.obj [.libnurbs.internals]curve.cc
[.libnurbs.internals]curvelist.obj : [.libnurbs.internals]curvelist.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]curvelist.obj [.libnurbs.internals]curvelist.cc
[.libnurbs.internals]curvesub.obj : [.libnurbs.internals]curvesub.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]curvesub.obj [.libnurbs.internals]curvesub.cc
[.libnurbs.internals]dataTransform.obj : [.libnurbs.internals]dataTransform.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]dataTransform.obj [.libnurbs.internals]dataTransform.cc
[.libnurbs.internals]displaylist.obj : [.libnurbs.internals]displaylist.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]displaylist.obj [.libnurbs.internals]displaylist.cc
[.libnurbs.internals]flist.obj : [.libnurbs.internals]flist.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]flist.obj [.libnurbs.internals]flist.cc
[.libnurbs.internals]flistsorter.obj : [.libnurbs.internals]flistsorter.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]flistsorter.obj [.libnurbs.internals]flistsorter.cc
[.libnurbs.internals]hull.obj : [.libnurbs.internals]hull.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]hull.obj [.libnurbs.internals]hull.cc
[.libnurbs.internals]intersect.obj : [.libnurbs.internals]intersect.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]intersect.obj [.libnurbs.internals]intersect.cc
[.libnurbs.internals]knotvector.obj : [.libnurbs.internals]knotvector.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]knotvector.obj [.libnurbs.internals]knotvector.cc
[.libnurbs.internals]mapdesc.obj : [.libnurbs.internals]mapdesc.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]mapdesc.obj [.libnurbs.internals]mapdesc.cc
[.libnurbs.internals]mapdescv.obj : [.libnurbs.internals]mapdescv.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]mapdescv.obj [.libnurbs.internals]mapdescv.cc
[.libnurbs.internals]maplist.obj : [.libnurbs.internals]maplist.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]maplist.obj [.libnurbs.internals]maplist.cc
[.libnurbs.internals]mesher.obj : [.libnurbs.internals]mesher.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]mesher.obj [.libnurbs.internals]mesher.cc
[.libnurbs.internals]monoTriangulationBackend.obj : [.libnurbs.internals]monoTriangulationBackend.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]monoTriangulationBackend.obj [.libnurbs.internals]monoTriangulationBackend.cc
[.libnurbs.internals]monotonizer.obj : [.libnurbs.internals]monotonizer.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]monotonizer.obj [.libnurbs.internals]monotonizer.cc
[.libnurbs.internals]mycode.obj : [.libnurbs.internals]mycode.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]mycode.obj [.libnurbs.internals]mycode.cc
[.libnurbs.internals]nurbsinterfac.obj : [.libnurbs.internals]nurbsinterfac.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]nurbsinterfac.obj [.libnurbs.internals]nurbsinterfac.cc
[.libnurbs.internals]nurbstess.obj : [.libnurbs.internals]nurbstess.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]nurbstess.obj [.libnurbs.internals]nurbstess.cc
[.libnurbs.internals]patch.obj : [.libnurbs.internals]patch.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]patch.obj [.libnurbs.internals]patch.cc
[.libnurbs.internals]patchlist.obj : [.libnurbs.internals]patchlist.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]patchlist.obj [.libnurbs.internals]patchlist.cc
[.libnurbs.internals]quilt.obj : [.libnurbs.internals]quilt.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]quilt.obj [.libnurbs.internals]quilt.cc
[.libnurbs.internals]reader.obj : [.libnurbs.internals]reader.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]reader.obj [.libnurbs.internals]reader.cc
[.libnurbs.internals]renderhints.obj : [.libnurbs.internals]renderhints.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]renderhints.obj [.libnurbs.internals]renderhints.cc
[.libnurbs.internals]slicer.obj : [.libnurbs.internals]slicer.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]slicer.obj [.libnurbs.internals]slicer.cc
[.libnurbs.internals]sorter.obj : [.libnurbs.internals]sorter.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]sorter.obj [.libnurbs.internals]sorter.cc
[.libnurbs.internals]splitarcs.obj : [.libnurbs.internals]splitarcs.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]splitarcs.obj [.libnurbs.internals]splitarcs.cc
[.libnurbs.internals]subdivider.obj : [.libnurbs.internals]subdivider.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]subdivider.obj [.libnurbs.internals]subdivider.cc
[.libnurbs.internals]tobezier.obj : [.libnurbs.internals]tobezier.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]tobezier.obj [.libnurbs.internals]tobezier.cc
[.libnurbs.internals]trimline.obj : [.libnurbs.internals]trimline.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]trimline.obj [.libnurbs.internals]trimline.cc
[.libnurbs.internals]trimregion.obj : [.libnurbs.internals]trimregion.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]trimregion.obj [.libnurbs.internals]trimregion.cc
[.libnurbs.internals]trimvertpool.obj : [.libnurbs.internals]trimvertpool.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]trimvertpool.obj [.libnurbs.internals]trimvertpool.cc
[.libnurbs.internals]uarray.obj : [.libnurbs.internals]uarray.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]uarray.obj [.libnurbs.internals]uarray.cc
[.libnurbs.internals]varray.obj : [.libnurbs.internals]varray.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.internals]varray.obj [.libnurbs.internals]varray.cc
[.libnurbs.nurbtess]directedLine.obj : [.libnurbs.nurbtess]directedLine.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]directedLine.obj [.libnurbs.nurbtess]directedLine.cc
[.libnurbs.nurbtess]gridWrap.obj : [.libnurbs.nurbtess]gridWrap.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]gridWrap.obj [.libnurbs.nurbtess]gridWrap.cc
[.libnurbs.nurbtess]monoChain.obj : [.libnurbs.nurbtess]monoChain.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]monoChain.obj [.libnurbs.nurbtess]monoChain.cc
[.libnurbs.nurbtess]monoPolyPart.obj : [.libnurbs.nurbtess]monoPolyPart.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]monoPolyPart.obj [.libnurbs.nurbtess]monoPolyPart.cc
[.libnurbs.nurbtess]monoTriangulation.obj : [.libnurbs.nurbtess]monoTriangulation.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]monoTriangulation.obj [.libnurbs.nurbtess]monoTriangulation.cc
[.libnurbs.nurbtess]partitionX.obj : [.libnurbs.nurbtess]partitionX.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]partitionX.obj [.libnurbs.nurbtess]partitionX.cc
[.libnurbs.nurbtess]partitionY.obj : [.libnurbs.nurbtess]partitionY.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]partitionY.obj [.libnurbs.nurbtess]partitionY.cc
[.libnurbs.nurbtess]polyDBG.obj : [.libnurbs.nurbtess]polyDBG.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]polyDBG.obj [.libnurbs.nurbtess]polyDBG.cc
[.libnurbs.nurbtess]polyUtil.obj : [.libnurbs.nurbtess]polyUtil.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]polyUtil.obj [.libnurbs.nurbtess]polyUtil.cc
[.libnurbs.nurbtess]primitiveStream.obj : [.libnurbs.nurbtess]primitiveStream.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]primitiveStream.obj [.libnurbs.nurbtess]primitiveStream.cc
[.libnurbs.nurbtess]quicksort.obj : [.libnurbs.nurbtess]quicksort.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]quicksort.obj [.libnurbs.nurbtess]quicksort.cc
[.libnurbs.nurbtess]rectBlock.obj : [.libnurbs.nurbtess]rectBlock.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]rectBlock.obj [.libnurbs.nurbtess]rectBlock.cc
[.libnurbs.nurbtess]sampleComp.obj : [.libnurbs.nurbtess]sampleComp.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampleComp.obj [.libnurbs.nurbtess]sampleComp.cc
[.libnurbs.nurbtess]sampleCompBot.obj : [.libnurbs.nurbtess]sampleCompBot.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampleCompBot.obj [.libnurbs.nurbtess]sampleCompBot.cc
[.libnurbs.nurbtess]sampleCompRight.obj : [.libnurbs.nurbtess]sampleCompRight.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampleCompRight.obj [.libnurbs.nurbtess]sampleCompRight.cc
[.libnurbs.nurbtess]sampleCompTop.obj : [.libnurbs.nurbtess]sampleCompTop.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampleCompTop.obj [.libnurbs.nurbtess]sampleCompTop.cc
[.libnurbs.nurbtess]sampleMonoPoly.obj : [.libnurbs.nurbtess]sampleMonoPoly.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampleMonoPoly.obj [.libnurbs.nurbtess]sampleMonoPoly.cc
[.libnurbs.nurbtess]sampledLine.obj : [.libnurbs.nurbtess]sampledLine.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]sampledLine.obj [.libnurbs.nurbtess]sampledLine.cc
[.libnurbs.nurbtess]searchTree.obj : [.libnurbs.nurbtess]searchTree.cc
$(CXX) $(CFLAGS) /obj=[.libnurbs.nurbtess]searchTree.obj [.libnurbs.nurbtess]searchTree.cc

View file

@ -1,126 +0,0 @@
# DOS/DJGPP Mesa Utility Toolkit
# Version: 1.0
#
# Copyright (C) 2005 Daniel Borca All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Available options:
#
# Environment variables:
# CFLAGS
#
# GLIDE path to Glide3 SDK; used to resolve DXEs.
# default = $(TOP)/glide3
#
# Targets:
# all: build GLUT
# clean: remove object files
#
.PHONY: all clean
TOP = ../../..
GLIDE ?= $(TOP)/glide3
LIBDIR = $(TOP)/lib
GLUT_LIB = libglut.a
GLUT_DXE = glut.dxe
GLUT_IMP = libiglut.a
export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -I$(TOP)/include -I. -IPC_HW
CFLAGS += -DGLUT_IMPORT_LIB
AR = ar
ARFLAGS = crus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
CORE_SOURCES = \
loop.c \
callback.c \
color.c \
extens.c \
init.c \
menu.c \
mouse.c \
overlay.c \
state.c \
util.c \
window.c \
f8x13.c \
f9x15.c \
hel10.c \
hel12.c \
hel18.c \
tr10.c \
tr24.c \
mroman.c \
roman.c \
bitmap.c \
stroke.c \
teapot.c \
shapes.c
PC_HW_SOURCES = \
PC_HW/pc_hw.c \
PC_HW/pc_keyb.c \
PC_HW/pc_mouse.c \
PC_HW/pc_timer.c \
PC_HW/pc_irq.S
SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES)
OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.S.o:
$(CC) -o $@ $(CFLAGS) -c $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP)
$(LIBDIR)/$(GLUT_LIB): $(OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLUT_DXE))
else
-dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -Y $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -U $^
endif
clean:
-$(call UNLINK,*.o)
-$(call UNLINK,PC_HW/*.o)
-include depend

View file

@ -1,198 +0,0 @@
# Mesa 3-D graphics library
# Version: 5.1
#
# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# MinGW core makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
# MinGW core-glut makefile updated for Mesa 7.0
#
# Updated : by Heromyth, on 2007-7-21
# Email : zxpmyth@yahoo.com.cn
# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
# The others havn't been tested yet.
# 2) The generated DLLs are *not* compatible with the ones built
# with the other compilers like VC8, especially for GLUT.
# 3) Although more tests are needed, it can be used individually!
#
# Available options:
#
# Environment variables:
# CFLAGS
#
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most WMesa code and requires fxMesa.
# As a consequence, you'll need the Win32 Glide3
# library to build any application.
# default = no
# ICD=1 build the installable client driver interface
# (windows opengl driver interface)
# default = no
# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
# default = no
#
# Targets:
# all: build GL
# clean: remove object files
#
.PHONY: all clean
.INTERMEDIATE: x86/gen_matypes.exe
.SUFFIXES: .rc .res
# Set this to the prefix of your build tools, i.e. mingw32-
TOOLS_PREFIX = mingw32-
TOP = ../../..
LIBDIR = $(TOP)/lib
GLUT_DLL = glut32.dll
GLUT_IMP = libglut32.a
GLUT_DEF = glut.def
include $(TOP)/configs/config.mgw
GLUT_USING_STDCALL ?= 1
LDLIBS = -L$(LIBDIR) -lwinmm -lgdi32 -luser32 -lopengl32 -lglu32
LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GLUT_IMP) -Wl,--output-def=$(LIBDIR)/$(GLUT_DEF)
CFLAGS += -DBUILD_GLUT32 -DGLUT_BUILDING_LIB -DMESA -D_DLL
ifeq ($(GL_USING_STDCALL),0)
CFLAGS += -DGL_NO_STDCALL
endif
ifeq ($(GLUT_USING_STDCALL),1)
CFLAGS += -D_STDCALL_SUPPORTED
LDFLAGS += -Wl,--add-stdcall-alias
else
CFLAGS += -DGLUT_NO_STDCALL
endif
CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include
CC = gcc
CXX = g++
CXXFLAGS = $(CFLAGS)
AR = ar
ARFLAGS = crus
UNLINK = del $(subst /,\,$(1))
ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = $(RM) $(1)
endif
ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
UNLINK = $(RM) $(1)
endif
HDRS = glutint.h glutstroke.h glutbitmap.h glutwin32.h stroke.h win32_glx.h win32_x11.h
SRCS = \
glut_bitmap.c \
glut_bwidth.c \
glut_cindex.c \
glut_cmap.c \
glut_cursor.c \
glut_dials.c \
glut_dstr.c \
glut_event.c \
glut_ext.c \
glut_fbc.c \
glut_fullscrn.c \
glut_gamemode.c \
glut_get.c \
glut_init.c \
glut_input.c \
glut_joy.c \
glut_key.c \
glut_keyctrl.c \
glut_keyup.c \
glut_mesa.c \
glut_modifier.c \
glut_overlay.c \
glut_shapes.c \
glut_space.c \
glut_stroke.c \
glut_swap.c \
glut_swidth.c \
glut_tablet.c \
glut_teapot.c \
glut_util.c \
glut_vidresize.c \
glut_warp.c \
glut_win.c \
glut_winmisc.c \
win32_glx.c \
win32_menu.c \
win32_util.c \
win32_winproc.c \
win32_x11.c
SRCSSEMIGENS = \
glut_8x13.c \
glut_9x15.c \
glut_hel10.c \
glut_hel12.c \
glut_hel18.c \
glut_mroman.c \
glut_roman.c \
glut_tr10.c \
glut_tr24.c
SOURCES = $(SRCS) $(SRCSSEMIGENS)
OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.cc.o:
$(CXX) -o $@ $(CXXFLAGS) -c $<
all: $(LIBDIR) $(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP)
$(LIBDIR):
mkdir -p $(LIBDIR)
$(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
$(CXX) -shared -fPIC -o $(LIBDIR)/$(GLUT_DLL) $(LDFLAGS) \
$^ $(LDLIBS)
clean:
-$(call UNLINK,*.o)

View file

@ -1,208 +0,0 @@
# Makefile for GLUT for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
.first
define gl [---.include.gl]
.include [---]mms.config
##### MACROS #####
GLUT_MAJOR = 3
GLUT_MINOR = 7
VPATH = RCS
INCDIR = [---.include]
LIBDIR = [---.lib]
CFLAGS = /nowarn/include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm
SOURCES = \
glut_8x13.c \
glut_9x15.c \
glut_bitmap.c \
glut_bwidth.c \
glut_cindex.c \
glut_cmap.c \
glut_cursor.c \
glut_dials.c \
glut_dstr.c \
glut_event.c \
glut_ext.c \
glut_fullscrn.c \
glut_gamemode.c \
glut_get.c \
glut_glxext.c \
glut_hel10.c \
glut_hel12.c \
glut_hel18.c \
glut_init.c \
glut_input.c \
glut_joy.c \
glut_key.c \
glut_keyctrl.c \
glut_keyup.c \
glut_menu.c \
glut_menu2.c \
glut_mesa.c \
glut_modifier.c \
glut_mroman.c \
glut_overlay.c \
glut_roman.c \
glut_shapes.c \
glut_space.c \
glut_stroke.c \
glut_swap.c \
glut_swidth.c \
glut_tablet.c \
glut_teapot.c \
glut_tr10.c \
glut_tr24.c \
glut_util.c \
glut_vidresize.c \
glut_warp.c \
glut_win.c \
glut_winmisc.c \
layerutil.c
OBJECTS0=glut_8x13.obj,\
glut_9x15.obj,\
glut_bitmap.obj,\
glut_bwidth.obj,\
glut_cindex.obj,\
glut_cmap.obj,\
glut_cursor.obj,\
glut_dials.obj,\
glut_dstr.obj,\
glut_event.obj,\
glut_ext.obj,\
glut_fullscrn.obj,\
glut_gamemode.obj
OBJECTS1=glut_get.obj,\
glut_glxext.obj,\
glut_hel10.obj,\
glut_hel12.obj,\
glut_hel18.obj,\
glut_init.obj,\
glut_input.obj,\
glut_joy.obj,\
glut_key.obj,\
glut_keyctrl.obj,\
glut_keyup.obj,\
glut_menu.obj,\
glut_menu2.obj,\
glut_mesa.obj,\
glut_modifier.obj
OBJECTS2=glut_mroman.obj,\
glut_overlay.obj,\
glut_roman.obj,\
glut_shapes.obj,\
glut_space.obj,\
glut_stroke.obj,\
glut_swap.obj,\
glut_swidth.obj,\
glut_tablet.obj,\
glut_teapot.obj,\
glut_tr10.obj,\
glut_tr24.obj,\
glut_util.obj,\
glut_vidresize.obj
OBJECTS3=glut_warp.obj,\
glut_win.obj,\
glut_winmisc.obj,\
layerutil.obj
##### RULES #####
VERSION=Glut V3.7
##### TARGETS #####
# Make the library
$(LIBDIR)$(GLUT_LIB) : $(OBJECTS0) $(OBJECTS1) $(OBJECTS2) $(OBJECTS3)
@ $(MAKELIB) $(GLUT_LIB) $(OBJECTS0)
@ library $(GLUT_LIB) $(OBJECTS1)
@ library $(GLUT_LIB) $(OBJECTS2)
@ library $(GLUT_LIB) $(OBJECTS3)
@ rename $(GLUT_LIB)* $(LIBDIR)
.ifdef SHARE
@ WRITE_ SYS$OUTPUT " generating mesagl1.opt"
@ OPEN_/WRITE FILE mesagl1.opt
@ WRITE_ FILE "!"
@ WRITE_ FILE "! mesagl1.opt generated by DESCRIP.$(MMS_EXT)"
@ WRITE_ FILE "!"
@ WRITE_ FILE "IDENTIFICATION=""$(VERSION)"""
@ WRITE_ FILE "GSMATCH=LEQUAL,3,7
@ WRITE_ FILE "$(OBJECTS0)"
@ WRITE_ FILE "$(OBJECTS1)"
@ WRITE_ FILE "$(OBJECTS2)"
@ WRITE_ FILE "$(OBJECTS3)"
@ WRITE_ FILE "[---.lib]libmesaglu.exe/SHARE"
@ WRITE_ FILE "[---.lib]libmesagl.exe/SHARE"
@ write file "sys$library:decw$xmulibshr.exe/share"
@ WRITE_ FILE "SYS$SHARE:DECW$XEXTLIBSHR/SHARE"
@ WRITE_ FILE "SYS$SHARE:DECW$XLIBSHR/SHARE"
@ CLOSE_ FILE
@ WRITE_ SYS$OUTPUT " generating mesagl.map ..."
@ CXXLINK_/NODEB/NOSHARE/NOEXE/MAP=mesagl.map/FULL mesagl1.opt/OPT
@ WRITE_ SYS$OUTPUT " analyzing mesagl.map ..."
@ @[---.vms]ANALYZE_MAP.COM mesagl.map mesagl.opt
@ WRITE_ SYS$OUTPUT " linking $(GLUT_SHAR) ..."
@ CXXLINK_/NODEB/SHARE=$(GLUT_SHAR)/MAP=mesagl.map/FULL mesagl1.opt/opt,mesagl.opt/opt
@ rename $(GLUT_SHAR)* $(LIBDIR)
.endif
clean :
delete *.obj;*
purge
include mms_depend.
glut_8x13.obj : glut_8x13.c
glut_9x15.obj : glut_9x15.c
glut_bitmap.obj : glut_bitmap.c
glut_bwidth.obj : glut_bwidth.c
glut_cindex.obj : glut_cindex.c
glut_cmap.obj : glut_cmap.c
glut_cursor.obj : glut_cursor.c
glut_dials.obj : glut_dials.c
glut_dstr.obj : glut_dstr.c
glut_event.obj : glut_event.c
glut_ext.obj : glut_ext.c
glut_fullscrn.obj : glut_fullscrn.c
glut_gamemode.obj : glut_gamemode.c
glut_get.obj : glut_get.c
glut_glxext.obj : glut_glxext.c
glut_hel10.obj : glut_hel10.c
glut_hel12.obj : glut_hel12.c
glut_hel18.obj : glut_hel18.c
glut_init.obj : glut_init.c
glut_input.obj : glut_input.c
glut_joy.obj : glut_joy.c
glut_key.obj : glut_key.c
glut_keyctrl.obj : glut_keyctrl.c
glut_keyup.obj : glut_keyup.c
glut_menu.obj : glut_menu.c
glut_menu2.obj : glut_menu2.c
glut_mesa.obj : glut_mesa.c
glut_modifier.obj : glut_modifier.c
glut_mroman.obj : glut_mroman.c
glut_overlay.obj : glut_overlay.c
glut_roman.obj : glut_roman.c
glut_shapes.obj : glut_shapes.c
glut_space.obj : glut_space.c
glut_stroke.obj : glut_stroke.c
glut_swap.obj : glut_swap.c
glut_swidth.obj : glut_swidth.c
glut_tablet.obj : glut_tablet.c
glut_teapot.obj : glut_teapot.c
glut_tr10.obj : glut_tr10.c
glut_tr24.obj : glut_tr24.c
glut_util.obj : glut_util.c
glut_vidresize.obj : glut_vidresize.c
glut_warp.obj : glut_warp.c
glut_win.obj : glut_win.c
glut_winmisc.obj : glut_winmisc.c
layerutil.obj : layerutil.c

View file

@ -1,72 +0,0 @@
# DO NOT DELETE
glut_8x13.obj : glutbitmap.h [---.include.gl]gl.h
glut_9x15.obj : glutbitmap.h [---.include.gl]gl.h
glut_bitmap.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_bitmap.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_bitmap.obj : glutbitmap.h
glut_bwidth.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_bwidth.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_bwidth.obj : glutbitmap.h
glut_cindex.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_cindex.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_cindex.obj : layerutil.h
glut_cursor.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_cursor.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_dials.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h
glut_dials.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h [---.include.gl]glu.h
glut_dstr.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h
glut_dstr.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h [---.include.gl]glu.h
glut_event.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_event.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_ext.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_ext.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_fullscrn.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h
glut_fullscrn.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h
glut_fullscrn.obj : [---.include.gl]glu.h
glut_get.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_get.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_hel10.obj : glutbitmap.h [---.include.gl]gl.h
glut_hel12.obj : glutbitmap.h [---.include.gl]gl.h
glut_hel18.obj : glutbitmap.h [---.include.gl]gl.h
glut_init.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_init.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_menu.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_menu.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h layerutil.h
glut_mesa.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h
glut_mesa.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h [---.include.gl]glu.h
glut_modifier.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h
glut_modifier.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h
glut_modifier.obj : [---.include.gl]glu.h
glut_mroman.obj : glutstroke.h
glut_overlay.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_overlay.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_overlay.obj : layerutil.h
glut_roman.obj : glutstroke.h
glut_shapes.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_shapes.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_space.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h
glut_space.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h [---.include.gl]glu.h
glut_stroke.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_stroke.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_stroke.obj : glutstroke.h
glut_swidth.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_swidth.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_swidth.obj : glutstroke.h
glut_tablet.obj : glutint.h [---.include.gl]glx.h [---.include.gl]gl.h
glut_tablet.obj : [---.include.gl]xmesa.h [---.include.gl]glut.h [---.include.gl]glu.h
glut_teapot.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_tr10.obj : glutbitmap.h [---.include.gl]gl.h
glut_tr24.obj : glutbitmap.h [---.include.gl]gl.h
glut_util.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_util.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_vidresize.obj : [---.include.gl]glx.h [---.include.gl]gl.h
glut_vidresize.obj : [---.include.gl]xmesa.h glutint.h [---.include.gl]glut.h
glut_vidresize.obj : [---.include.gl]glu.h
glut_warp.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_warp.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_win.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_win.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
glut_winmisc.obj : [---.include.gl]glut.h [---.include.gl]gl.h [---.include.gl]glu.h
glut_winmisc.obj : glutint.h [---.include.gl]glx.h [---.include.gl]xmesa.h
layerutil.obj : layerutil.h

View file

@ -1,166 +0,0 @@
# Mesa 3-D graphics library
# Version: 5.1
#
# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP core makefile v1.7 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Available options:
#
# Environment variables:
# CFLAGS
#
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most DMesa code and requires fxMesa.
# As a consequence, you'll need the DJGPP Glide3
# library to build any application.
# default = no
# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
# default = no
#
# Targets:
# all: build GL
# clean: remove object files
#
.PHONY: all clean
.INTERMEDIATE: x86/gen_matypes.exe
TOP = ../..
GLIDE ?= $(TOP)/glide3
LIBDIR = $(TOP)/lib
GL_LIB = libgl.a
GL_DXE = gl.dxe
GL_IMP = libigl.a
export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += $(INCLUDE_DIRS)
CFLAGS += -DUSE_EXTERNAL_DXTN_LIB=1
ifeq ($(FX),1)
CFLAGS += -D__DOS__
CFLAGS += -I$(GLIDE)/include -DFX
LIBNAME = "Mesa/FX DJGPP"
else
LIBNAME = "Mesa DJGPP"
endif
AR = ar
ARFLAGS = crus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
include sources
ifeq ($(X86),1)
CFLAGS += -DUSE_X86_ASM
CFLAGS += -DUSE_MMX_ASM
CFLAGS += -DUSE_SSE_ASM
CFLAGS += -DUSE_3DNOW_ASM
X86_SOURCES += $(X86_API)
else
X86_SOURCES =
endif
DRIVER_SOURCES = \
drivers/dos/dmesa.c
ifeq ($(FX),1)
DRIVER_SOURCES += \
$(GLIDE_DRIVER_SOURCES)
else
DRIVER_SOURCES += \
$(OSMESA_DRIVER_SOURCES) \
drivers/dos/video.c \
drivers/dos/vesa.c \
drivers/dos/blit.S \
drivers/dos/vga.c \
drivers/dos/null.c \
drivers/dos/dpmi.c
endif
SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(COMMON_DRIVER_SOURCES) $(DRIVER_SOURCES)
OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES)))
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.S.o:
$(CC) -o $@ $(CFLAGS) -c $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
$(LIBDIR)/$(GL_LIB): $(OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GL_DXE))
else
ifeq ($(FX),1)
-dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glide3x.dxe -U $^
else
-dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $^
endif
endif
$(X86_OBJECTS): x86/matypes.h
x86/matypes.h: x86/gen_matypes.exe
$< > $@
x86/gen_matypes.exe: x86/gen_matypes.c
$(CC) -o $@ $(CFLAGS) -s $<
clean:
-$(call UNLINK,array_cache/*.o)
-$(call UNLINK,glapi/*.o)
-$(call UNLINK,main/*.o)
-$(call UNLINK,math/*.o)
-$(call UNLINK,shader/*.o)
-$(call UNLINK,sparc/*.o)
-$(call UNLINK,ppc/*.o)
-$(call UNLINK,swrast/*.o)
-$(call UNLINK,swrast_setup/*.o)
-$(call UNLINK,tnl/*.o)
-$(call UNLINK,x86/*.o)
-$(call UNLINK,drivers/common/*.o)
-$(call UNLINK,drivers/dos/*.o)
-$(call UNLINK,drivers/glide/*.o)

View file

@ -1,235 +0,0 @@
# Mesa 3-D graphics library
# Version: 7.0
#
# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# MinGW core makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
# MinGW core-gl makefile updated for Mesa 7.0
#
# updated : by Heromyth, on 2007-7-21
# Email : zxpmyth@yahoo.com.cn
# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
# The others havn't been tested yet.
# 2) The generated DLLs are *not* compatible with the ones built
# with the other compilers like VC8, especially for GLUT.
# 3) Although more tests are needed, it can be used individually!
#
# Available options:
#
# Environment variables:
# CFLAGS
#
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most WMesa code and requires fxMesa.
# As a consequence, you'll need the Win32 Glide3
# library to build any application.
# default = no
# ICD=1 build the installable client driver interface
# (windows opengl driver interface)
# default = no
# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
# default = no
#
# Targets:
# all: build GL
# clean: remove object files
#
.PHONY: all clean
.INTERMEDIATE: x86/gen_matypes.exe
.SUFFIXES: .rc .res
# Set this to the prefix of your build tools, i.e. mingw32-
TOOLS_PREFIX = mingw32-
TOP = ../..
GLIDE ?= $(TOP)/glide3
LIBDIR = $(TOP)/lib
ifeq ($(ICD),1)
GL_DLL = mesa32.dll
GL_IMP = libmesa32.a
else
GL_DLL = opengl32.dll
GL_IMP = libopengl32.a
endif
GL_DEF = gl.def
include $(TOP)/configs/config.mgw
GL_USING_STDCALL ?= 1
MESA_LIB = libmesa.a
LDLIBS = -lgdi32 -luser32 -liberty
LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GL_IMP) -Wl,--output-def=$(LIBDIR)/gl.def
CC = $(TOOLS_PREFIX)gcc
CFLAGS += -DBUILD_GL32 -D_OPENGL32_ -D_DLL -DMESA_MINWARN -DNDEBUG -D_USRDLL -DGDI_EXPORTS
ifeq ($(GL_USING_STDCALL),1)
LDFLAGS += -Wl,--add-stdcall-alias
else
CFLAGS += -DGL_NO_STDCALL
endif
CFLAGS += -DUSE_EXTERNAL_DXTN_LIB=1
ifeq ($(FX),1)
CFLAGS += -I$(GLIDE)/include -DFX
LDLIBS += -L$(GLIDE)/lib -lglide3x
GL_DEF = drivers/windows/fx/fxopengl.def
GL_RES = drivers/windows/fx/fx.rc
else
ifeq ($(ICD),1)
CFLAGS += -DUSE_MGL_NAMESPACE
GL_DEF = drivers/windows/icd/mesa.def
else
GL_DEF = drivers/windows/gdi/mesa.def
endif
endif
AR = ar
ARFLAGS = crus
UNLINK = del $(subst /,\,$(1))
ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = $(RM) $(1)
endif
ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
UNLINK = $(RM) $(1)
endif
include sources
CFLAGS += $(INCLUDE_DIRS)
ifeq ($(X86),1)
CFLAGS += -DUSE_X86_ASM
CFLAGS += -DUSE_MMX_ASM
CFLAGS += -DUSE_SSE_ASM
CFLAGS += -DUSE_3DNOW_ASM
X86_SOURCES += $(X86_API)
else
X86_SOURCES =
endif
ifeq ($(FX),1)
DRIVER_SOURCES = \
$(GLIDE_DRIVER_SOURCES) \
drivers/windows/fx/fxwgl.c
else
ifeq ($(ICD),1)
DRIVER_SOURCES = \
drivers/windows/gdi/wmesa.c \
drivers/windows/icd/icd.c
else
DRIVER_SOURCES = \
drivers/windows/gdi/wmesa.c \
drivers/windows/gdi/wgl.c
endif
endif
SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(COMMON_DRIVER_SOURCES) $(DRIVER_SOURCES)
OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES)))
RESOURCE = $(GL_RES:.rc=.res)
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
.rc.res:
windres -o $@ -Irc -Ocoff $<
all: $(LIBDIR) $(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP)
$(LIBDIR):
mkdir -p $(LIBDIR)
$(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP): $(OBJECTS) $(RESOURCE)
$(CC) -shared -fPIC -o $(LIBDIR)/$(GL_DLL) $(LDFLAGS) \
$^ $(LDLIBS)
$(X86_OBJECTS): x86/matypes.h
x86/matypes.h: x86/gen_matypes.exe
$(subst /,\,$< > $@)
x86/gen_matypes.exe: x86/gen_matypes.c
$(CC) -o $@ $(CFLAGS) -s $<
# [dBorca]
# glapi_x86.S needs some adjustments
# in order to generate correct entrypoints
# Trick: change the following condition to
# be always false if you need C entrypoints
# with USE_X86_ASM (useful for trace/debug)
ifeq (1,1)
x86/glapi_x86.o: x86/glapi_x86.S
$(CC) -o $@ $(CFLAGS) -DSTDCALL_API -c $<
else
main/dispatch.o: main/dispatch.c
$(CC) -o $@ $(CFLAGS) -UUSE_X86_ASM -c $<
glapi/glapi.o: glapi/glapi.c
$(CC) -o $@ $(CFLAGS) -UUSE_X86_ASM -c $<
endif
# [dBorca]
# if we want codegen, we have to stdcall
tnl/t_vtx_x86_gcc.o: tnl/t_vtx_x86_gcc.S
$(CC) -o $@ $(CFLAGS) -DSTDCALL_API -c $<
clean:
-$(call UNLINK,glapi/*.o)
-$(call UNLINK,main/*.o)
-$(call UNLINK,math/*.o)
-$(call UNLINK,vbo/*.o)
-$(call UNLINK,shader/*.o)
-$(call UNLINK,shader/slang/*.o)
-$(call UNLINK,shader/grammar/*.o)
-$(call UNLINK,sparc/*.o)
-$(call UNLINK,ppc/*.o)
-$(call UNLINK,swrast/*.o)
-$(call UNLINK,swrast_setup/*.o)
-$(call UNLINK,tnl/*.o)
-$(call UNLINK,x86/*.o)
-$(call UNLINK,x86/rtasm/*.o)
-$(call UNLINK,x86-64/*.o)
-$(call UNLINK,drivers/common/*.o)
-$(call UNLINK,drivers/glide/*.o)
-$(call UNLINK,drivers/windows/fx/*.o)
-$(call UNLINK,drivers/windows/fx/*.res)
-$(call UNLINK,drivers/windows/gdi/*.o)
-$(call UNLINK,drivers/windows/icd/*.o)

View file

@ -1,26 +0,0 @@
# Makefile for Mesa for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
all :
set default [.main]
$(MMS)$(MMSQUALIFIERS)
set default [-.glapi]
$(MMS)$(MMSQUALIFIERS)
set default [-.shader]
$(MMS)$(MMSQUALIFIERS)
set default [-.drivers.common]
$(MMS)$(MMSQUALIFIERS)
set default [-.x11]
$(MMS)$(MMSQUALIFIERS)
set default [-.osmesa]
$(MMS)$(MMSQUALIFIERS)
set default [--.math]
$(MMS)$(MMSQUALIFIERS)
set default [-.tnl]
$(MMS)$(MMSQUALIFIERS)
set default [-.swrast]
$(MMS)$(MMSQUALIFIERS)
set default [-.swrast_setup]
$(MMS)$(MMSQUALIFIERS)
set default [-.array_cache]
$(MMS)$(MMSQUALIFIERS)

View file

@ -1,38 +0,0 @@
# Makefile for core library for VMS
# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
# Last revision : 2 November 2005
.first
define gl [----.include.gl]
define math [--.math]
define tnl [--.tnl]
define swrast [--.swrast]
.include [----]mms.config
##### MACROS #####
VPATH = RCS
INCDIR = [----.include],[--.main],[--.glapi],[--.shader]
LIBDIR = [----.lib]
CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
SOURCES = driverfuncs.c
OBJECTS =driverfuncs.obj
##### RULES #####
VERSION=Mesa V3.4
##### TARGETS #####
# Make the library
$(LIBDIR)$(GL_LIB) : $(OBJECTS)
@ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
clean :
purge
delete *.obj;*
driverfuncs.obj : driverfuncs.c

View file

@ -1,41 +0,0 @@
# Makefile for core library for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
# Last revision : 16 June 2003
.first
define gl [----.include.gl]
define math [--.math]
define tnl [--.tnl]
define swrast [--.swrast]
define swrast_setup [--.swrast_setup]
define array_cache [--.array_cache]
define drivers [-]
.include [----]mms.config
##### MACROS #####
VPATH = RCS
INCDIR = [----.include],[--.main],[--.glapi]
LIBDIR = [----.lib]
CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
SOURCES = osmesa.c
OBJECTS = osmesa.obj
##### RULES #####
VERSION=Mesa V3.4
##### TARGETS #####
# Make the library
$(LIBDIR)$(GL_LIB) : $(OBJECTS)
@ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
clean :
purge
delete *.obj;*
osmesa.obj : osmesa.c

View file

@ -1,51 +0,0 @@
# Makefile for core library for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
# Last revision : 16 June 2003
.first
define gl [----.include.gl]
define math [--.math]
define tnl [--.tnl]
define swrast [--.swrast]
define swrast_setup [--.swrast_setup]
define array_cache [--.array_cache]
define drivers [-]
.include [----]mms.config
##### MACROS #####
VPATH = RCS
INCDIR = [----.include],[--.main],[--.glapi]
LIBDIR = [----.lib]
CFLAGS =/include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
SOURCES = fakeglx.c glxapi.c xfonts.c xm_api.c xm_dd.c xm_line.c xm_span.c\
xm_tri.c xm_buffer.c
OBJECTS =fakeglx.obj,glxapi.obj,xfonts.obj,xm_api.obj,xm_dd.obj,xm_line.obj,\
xm_span.obj,xm_tri.obj,xm_buffer.obj
##### RULES #####
VERSION=Mesa V3.4
##### TARGETS #####
# Make the library
$(LIBDIR)$(GL_LIB) : $(OBJECTS)
@ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
clean :
purge
delete *.obj;*
fakeglx.obj : fakeglx.c
glxapi.obj : glxapi.c
xfonts.obj : xfonts.c
xm_api.obj : xm_api.c
xm_buffer.obj : xm_buffer.c
xm_dd.obj : xm_dd.c
xm_line.obj : xm_line.c
xm_span.obj : xm_span.c
xm_tri.obj : xm_tri.c

View file

@ -1,37 +0,0 @@
# Makefile for core library for VMS
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
# Last revision : 16 June 2003
.first
define gl [---.include.gl]
.include [---]mms.config
##### MACROS #####
VPATH = RCS
INCDIR = [---.include],[-.main]
LIBDIR = [---.lib]
CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
SOURCES = glapi.c glthread.c
OBJECTS = glapi.obj,glthread.obj
##### RULES #####
VERSION=Mesa V3.4
##### TARGETS #####
# Make the library
$(LIBDIR)$(GL_LIB) : $(OBJECTS)
@ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
clean :
purge
delete *.obj;*
glapi.obj : glapi.c
glthread.obj : glthread.c

Some files were not shown because too many files have changed in this diff Show more