Merge branch 'master' of git+ssh://joukj@git.freedesktop.org/git/mesa/mesa

This commit is contained in:
Jouk
2007-07-25 10:16:11 +02:00
235 changed files with 5812 additions and 5106 deletions
+3 -11
View File
@@ -288,17 +288,6 @@ MAIN_FILES = \
$(DIRECTORY)/vms/analyze_map.com \
$(DIRECTORY)/vms/xlib.opt \
$(DIRECTORY)/vms/xlib_share.opt \
$(DIRECTORY)/windows/VC6/mesa/gdi/gdi.dsp \
$(DIRECTORY)/windows/VC6/mesa/glu/*.txt \
$(DIRECTORY)/windows/VC6/mesa/glu/glu.dsp \
$(DIRECTORY)/windows/VC6/mesa/mesa.dsw \
$(DIRECTORY)/windows/VC6/mesa/mesa/mesa.dsp \
$(DIRECTORY)/windows/VC6/mesa/osmesa/osmesa.dsp \
$(DIRECTORY)/windows/VC7/mesa/gdi/gdi.vcproj \
$(DIRECTORY)/windows/VC7/mesa/glu/glu.vcproj \
$(DIRECTORY)/windows/VC7/mesa/mesa.sln \
$(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj \
$(DIRECTORY)/windows/VC8/mesa/mesa.sln \
$(DIRECTORY)/windows/VC8/mesa/gdi/gdi.vcproj \
$(DIRECTORY)/windows/VC8/mesa/glu/glu.vcproj \
@@ -328,6 +317,7 @@ SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/Makefile \
$(DIRECTORY)/src/glu/descrip.mms \
$(DIRECTORY)/src/glu/sgi/Makefile \
$(DIRECTORY)/src/glu/sgi/Makefile.mgw \
$(DIRECTORY)/src/glu/sgi/Makefile.win \
$(DIRECTORY)/src/glu/sgi/Makefile.DJ \
$(DIRECTORY)/src/glu/sgi/glu.def \
@@ -372,6 +362,8 @@ DEMO_FILES = \
$(DIRECTORY)/progs/demos/*.cxx \
$(DIRECTORY)/progs/demos/*.dat \
$(DIRECTORY)/progs/demos/README \
$(DIRECTORY)/progs/fbdev/Makefile \
$(DIRECTORY)/progs/fbdev/glfbdevtest.c \
$(DIRECTORY)/progs/osdemos/Makefile \
$(DIRECTORY)/progs/osdemos/*.c \
$(DIRECTORY)/progs/xdemos/Makefile* \
+25 -3
View File
@@ -51,37 +51,59 @@
# 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 -W -Werror
CFLAGS = -Wall -Werror
else
# I love c89
CFLAGS = -Wall -W -pedantic
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
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)
+3
View File
@@ -104,6 +104,9 @@ do
# this is a special case (see bugzilla 10876)
DEPS="$DEPS $1"
;;
'-pthread')
DEPS="$DEPS -pthread"
;;
'-cplusplus')
CPLUSPLUS=1
;;
+42
View File
@@ -0,0 +1,42 @@
# 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
+2 -2
View File
@@ -27,9 +27,9 @@ ASM_SOURCES =
# Library/program dependencies
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread $(LIBDRM_LIB)
-lm -pthread $(LIBDRM_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lX11
+49
View File
@@ -88,3 +88,52 @@ Running the Build:
Paul G. <pgarceau@users.sourceforge.net>
Daniel Borca <dborca@users.sourceforge.net>
*******************This section is added by Heromyth*****************************
Updated on 2007-7-21, by Heromyth <zxpmyth@yahoo.com.cn>
Notice:
1) The generated DLLs are *not* compatible with the ones built
with the other compilers like VC8, especially for GLUT.
2) Although more tests are needed, it can be used individually!
3) You can set the options about whether using STDCALL to build MESA. The
config file is <Mesa3D-root>\configs\config.mgw. The default setting is that:
ALL_USING_STDCALL = 1
, which means using STDCALL to build MESA.
4) Of course, you can MESA without using STDCALL,I like this:)
The setting is :
ALL_USING_STDCALL = 0
To do this, however, you must modify wingdi.h which is in MingW's include dir.
For example, run:
notepad C:\MingW\include\wingdi.h
, and delete all the lines where all the wgl*() functions are. Because they would
be conflicted with the ones in <Mesa3D-root>\include\GL\mesa_wgl.h.
======= Conflicted Functions List ======
WINGDIAPI BOOL WINAPI wglCopyContext(HGLRC,HGLRC,UINT);
WINGDIAPI HGLRC WINAPI wglCreateContext(HDC);
WINGDIAPI HGLRC WINAPI wglCreateLayerContext(HDC,int);
WINGDIAPI BOOL WINAPI wglDeleteContext(HGLRC);
WINGDIAPI BOOL WINAPI wglDescribeLayerPlane(HDC,int,int,UINT,LPLAYERPLANEDESCRIPTOR);
WINGDIAPI HGLRC WINAPI wglGetCurrentContext(void);
WINGDIAPI HDC WINAPI wglGetCurrentDC(void);
WINGDIAPI int WINAPI wglGetLayerPaletteEntries(HDC,int,int,int,COLORREF*);
WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR);
WINGDIAPI BOOL WINAPI wglMakeCurrent(HDC,HGLRC);
WINGDIAPI BOOL WINAPI wglRealizeLayerPalette(HDC,int,BOOL);
WINGDIAPI int WINAPI wglSetLayerPaletteEntries(HDC,int,int,int,const COLORREF*);
WINGDIAPI BOOL WINAPI wglShareLists(HGLRC,HGLRC);
WINGDIAPI BOOL WINAPI wglSwapLayerBuffers(HDC,UINT);
WINGDIAPI BOOL WINAPI wglUseFontBitmapsA(HDC,DWORD,DWORD,DWORD);
WINGDIAPI BOOL WINAPI wglUseFontBitmapsW(HDC,DWORD,DWORD,DWORD);
WINGDIAPI BOOL WINAPI wglUseFontOutlinesA(HDC,DWORD,DWORD,DWORD,FLOAT,FLOAT,int,LPGLYPHMETRICSFLOAT);
WINGDIAPI BOOL WINAPI wglUseFontOutlinesW(HDC,DWORD,DWORD,DWORD,FLOAT,FLOAT,int,LPGLYPHMETRICSFLOAT);
===================
*********************************************************************************
+1 -5
View File
@@ -9,11 +9,7 @@
<H1>Downloading</H1>
<p>
Last development release: <b>6.5.3</b>
</p>
<p>
Last stable release: <b>6.4.2</b>
Last stable release: <b>7.0</b>
</p>
<p>
+1 -1
View File
@@ -129,7 +129,7 @@ GL_ARB_fragment_program extensions.
</p>
<p>
May 2007: Mesa 7.0 is released, implementing the OpenGL 2.1 specification
June 2007: Mesa 7.0 is released, implementing the OpenGL 2.1 specification
and OpenGL Shading Language.
</p>
+1 -1
View File
@@ -11,7 +11,7 @@
<H1>News</H1>
<h2>May ???, 2007</h2>
<h2>June 22, 2007</h2>
<p>
<a href="relnotes-7.0.html">Mesa 7.0</a> is released.
This is a stable release featuring OpenGL 2.1 support.
+17 -2
View File
@@ -8,16 +8,25 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.0 Release Notes / (<em>in progress</em>)</H1>
<H1>Mesa 7.0 Release Notes / June 22, 2007</H1>
<p>
Mesa 7.0 is a stable release, featuring OpenGL 2.1 API support.
A number of bugs have been fixed since the 6.5.3 release.
</p>
<h2>MD5 checksums</h2>
<pre>
TBD
35a1698986f7ac8dc435624ee9256cda MesaLib-7.0.tar.gz
50c371455fa7532c04aa0a970f9bc51f MesaLib-7.0.tar.bz2
bcedb6f43c97c1bc49e5cc7f12835722 MesaLib-7.0.zip
9bad332c7b74f59be96556135212ca9e MesaDemos-7.0.tar.gz
fada2bc1f29da513e015fda1e3abd0c0 MesaDemos-7.0.tar.bz2
84e3bbe470d983ae32f1f0c779faf99e MesaDemos-7.0.zip
76c7bb54f9850c689eba844f6daed332 MesaGLUT-7.0.tar.gz
4af28296e02772ef1de00e4e79bf3d12 MesaGLUT-7.0.tar.bz2
9043cb0b54cc03d1874728d74b12188c MesaGLUT-7.0.zip
</pre>
@@ -37,6 +46,12 @@ TBD
<li>Fixed R300 vertex program/matrix bug (10848)
<li>GLSL dFdx() and dFdy() work for fragment program inputs now (texcoords)
<li>Specifying an invalid texture unit as a sampler could lead to a crash
<li>The GLX protocol request for glXDestroyPBuffer() was incorrect (bug 10983)
<li>ARB vp state.light[n].half value was incorrect (bug 10987)
<li>Fixed a positional light source bug (bug 11009)
<li>Fixed point size attenuation problem (bug 11042)
<li>glPopAttrib didn't restore texture object's LOD bias (bug 11049)
<li>Fixed a TLS / TEXTREL problem (bug 7459)
</ul>
+4
View File
@@ -39,6 +39,10 @@ TBD
<h2>To Do (someday) items</h2>
<ul>
<li>Remove the MEMCPY() and _mesa_memcpy() wrappers and just use memcpy().
Probably do the same for malloc, calloc, etc.
The wrappers were useful in the past for memory debugging but now we
have valgrind. Not worried about SunOS 4 support anymore either...
<li>Switch to freeglut
<li>Fix linux-glide target/driver.
<li>Improved lambda and derivative calculation for frag progs.
+11 -6
View File
@@ -58,7 +58,11 @@
# else /* for use with static link lib build of Win32 edition only */
# define GLAPI extern
# endif /* _STATIC_MESA support */
# define GLAPIENTRY __stdcall
# if defined(__MINGW32__) && defined(GL_NO_STDCALL) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
# define GLAPIENTRY
# else
# define GLAPIENTRY __stdcall
# endif
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
# define GLAPI extern
# define GLAPIENTRY __stdcall
@@ -84,7 +88,8 @@
#include <windows.h>
#endif
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) \
&& !defined(OPENSTEP) && !defined(__CYGWIN__) || defined(__MINGW32__)
#include <GL/mesa_wgl.h>
#endif
@@ -2161,11 +2166,11 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
#define GL_DEBUG_PRINT_MESA 0x875A
#define GL_DEBUG_ASSERT_MESA 0x875B
GLAPI GLhandleARB APIENTRY glCreateDebugObjectMESA (void);
GLAPI void APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
GLAPI void APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void);
GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
GLsizei *length, GLcharARB *debugLog);
GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
#endif /* GL_MESA_shader_debug */
+93
View File
@@ -33,6 +33,7 @@
#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
#define glActiveTextureARB MANGLE(ActiveTextureARB)
#define glActiveTexture MANGLE(ActiveTexture)
#define glActiveVaryingNV MANGLE(ActiveVaryingNV)
#define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI)
#define glAlphaFragmentOp2ATI MANGLE(AlphaFragmentOp2ATI)
#define glAlphaFragmentOp3ATI MANGLE(AlphaFragmentOp3ATI)
@@ -52,11 +53,16 @@
#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
#define glBeginQueryARB MANGLE(BeginQueryARB)
#define glBeginQuery MANGLE(BeginQuery)
#define glBeginTransformFeedbackNV MANGLE(BeginTransformFeedbackNV)
#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT)
#define glBindAttribLocationARB MANGLE(BindAttribLocationARB)
#define glBindAttribLocation MANGLE(BindAttribLocation)
#define glBindBufferARB MANGLE(BindBufferARB)
#define glBindBufferBaseNV MANGLE(BindBufferBaseNV)
#define glBindBuffer MANGLE(BindBuffer)
#define glBindBufferOffsetNV MANGLE(BindBufferOffsetNV)
#define glBindBufferRangeNV MANGLE(BindBufferRangeNV)
#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT)
#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
@@ -97,6 +103,7 @@
#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT)
#define glBufferDataARB MANGLE(BufferDataARB)
#define glBufferData MANGLE(BufferData)
#define glBufferParameteriAPPLE MANGLE(BufferParameteriAPPLE)
#define glBufferSubDataARB MANGLE(BufferSubDataARB)
#define glBufferSubData MANGLE(BufferSubData)
#define glCallList MANGLE(CallList)
@@ -104,8 +111,11 @@
#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT)
#define glClampColorARB MANGLE(ClampColorARB)
#define glClearAccum MANGLE(ClearAccum)
#define glClearColorIiEXT MANGLE(ClearColorIiEXT)
#define glClearColorIuiEXT MANGLE(ClearColorIuiEXT)
#define glClearColor MANGLE(ClearColor)
#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA)
#define glClearDepthdNV MANGLE(ClearDepthdNV)
#define glClearDepth MANGLE(ClearDepth)
#define glClearIndex MANGLE(ClearIndex)
#define glClear MANGLE(Clear)
@@ -161,6 +171,7 @@
#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI)
#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI)
#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI)
#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT)
#define glColorMask MANGLE(ColorMask)
#define glColorMaterial MANGLE(ColorMaterial)
#define glColorPointerEXT MANGLE(ColorPointerEXT)
@@ -261,19 +272,23 @@
#define glDeleteTextures MANGLE(DeleteTextures)
#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
#define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT)
#define glDepthBoundsdNV MANGLE(DepthBoundsdNV)
#define glDepthBoundsEXT MANGLE(DepthBoundsEXT)
#define glDepthFunc MANGLE(DepthFunc)
#define glDepthMask MANGLE(DepthMask)
#define glDepthRangedNV MANGLE(DepthRangedNV)
#define glDepthRange MANGLE(DepthRange)
#define glDetachObjectARB MANGLE(DetachObjectARB)
#define glDetachShader MANGLE(DetachShader)
#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS)
#define glDisableClientState MANGLE(DisableClientState)
#define glDisableIndexedEXT MANGLE(DisableIndexedEXT)
#define glDisable MANGLE(Disable)
#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
#define glDrawArraysEXT MANGLE(DrawArraysEXT)
#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT)
#define glDrawArrays MANGLE(DrawArrays)
#define glDrawBuffer MANGLE(DrawBuffer)
#define glDrawBuffersARB MANGLE(DrawBuffersARB)
@@ -281,6 +296,7 @@
#define glDrawBuffers MANGLE(DrawBuffers)
#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
#define glDrawElements MANGLE(DrawElements)
#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN)
#define glDrawPixels MANGLE(DrawPixels)
@@ -296,6 +312,7 @@
#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE)
#define glElementPointerATI MANGLE(ElementPointerATI)
#define glEnableClientState MANGLE(EnableClientState)
#define glEnableIndexedEXT MANGLE(EnableIndexedEXT)
#define glEnable MANGLE(Enable)
#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
@@ -306,6 +323,7 @@
#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
#define glEndQueryARB MANGLE(EndQueryARB)
#define glEndQuery MANGLE(EndQuery)
#define glEndTransformFeedbackNV MANGLE(EndTransformFeedbackNV)
#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT)
#define glEvalCoord1d MANGLE(EvalCoord1d)
#define glEvalCoord1dv MANGLE(EvalCoord1dv)
@@ -331,6 +349,7 @@
#define glFinishObjectAPPLE MANGLE(FinishObjectAPPLE)
#define glFinishTextureSUNX MANGLE(FinishTextureSUNX)
#define glFlush MANGLE(Flush)
#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE)
#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE)
@@ -370,6 +389,9 @@
#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT)
#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT)
#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT)
#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
#define glFrontFace MANGLE(FrontFace)
@@ -398,12 +420,14 @@
#define glGetActiveAttrib MANGLE(GetActiveAttrib)
#define glGetActiveUniformARB MANGLE(GetActiveUniformARB)
#define glGetActiveUniform MANGLE(GetActiveUniform)
#define glGetActiveVaryingNV MANGLE(GetActiveVaryingNV)
#define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI)
#define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI)
#define glGetAttachedObjectsARB MANGLE(GetAttachedObjectsARB)
#define glGetAttachedShaders MANGLE(GetAttachedShaders)
#define glGetAttribLocationARB MANGLE(GetAttribLocationARB)
#define glGetAttribLocation MANGLE(GetAttribLocation)
#define glGetBooleanIndexedvEXT MANGLE(GetBooleanIndexedvEXT)
#define glGetBooleanv MANGLE(GetBooleanv)
#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB)
#define glGetBufferParameteriv MANGLE(GetBufferParameteriv)
@@ -444,6 +468,7 @@
#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV)
#define glGetFloatv MANGLE(GetFloatv)
#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT)
#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX)
#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX)
@@ -460,6 +485,7 @@
#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP)
#define glGetInfoLogARB MANGLE(GetInfoLogARB)
#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX)
#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT)
#define glGetIntegerv MANGLE(GetIntegerv)
#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT)
#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT)
@@ -503,12 +529,16 @@
#define glGetPolygonStipple MANGLE(GetPolygonStipple)
#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB)
#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB)
#define glGetProgramEnvParameterIivNV MANGLE(GetProgramEnvParameterIivNV)
#define glGetProgramEnvParameterIuivNV MANGLE(GetProgramEnvParameterIuivNV)
#define glGetProgramInfoLog MANGLE(GetProgramInfoLog)
#define glGetProgramivARB MANGLE(GetProgramivARB)
#define glGetProgramiv MANGLE(GetProgramiv)
#define glGetProgramivNV MANGLE(GetProgramivNV)
#define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB)
#define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB)
#define glGetProgramLocalParameterIivNV MANGLE(GetProgramLocalParameterIivNV)
#define glGetProgramLocalParameterIuivNV MANGLE(GetProgramLocalParameterIuivNV)
#define glGetProgramNamedParameterdvNV MANGLE(GetProgramNamedParameterdvNV)
#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
@@ -545,20 +575,27 @@
#define glGetTexLevelParameterfv MANGLE(GetTexLevelParameterfv)
#define glGetTexLevelParameteriv MANGLE(GetTexLevelParameteriv)
#define glGetTexParameterfv MANGLE(GetTexParameterfv)
#define glGetTexParameterIivEXT MANGLE(GetTexParameterIivEXT)
#define glGetTexParameterIuivEXT MANGLE(GetTexParameterIuivEXT)
#define glGetTexParameteriv MANGLE(GetTexParameteriv)
#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV)
#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT)
#define glGetUniformfvARB MANGLE(GetUniformfvARB)
#define glGetUniformfv MANGLE(GetUniformfv)
#define glGetUniformivARB MANGLE(GetUniformivARB)
#define glGetUniformiv MANGLE(GetUniformiv)
#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
#define glGetUniformLocation MANGLE(GetUniformLocation)
#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI)
#define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI)
#define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT)
#define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT)
#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT)
#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT)
#define glGetVaryingLocationNV MANGLE(GetVaryingLocationNV)
#define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI)
#define glGetVertexAttribArrayObjectivATI MANGLE(GetVertexAttribArrayObjectivATI)
#define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB)
@@ -567,6 +604,8 @@
#define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB)
#define glGetVertexAttribfv MANGLE(GetVertexAttribfv)
#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV)
#define glGetVertexAttribIivEXT MANGLE(GetVertexAttribIivEXT)
#define glGetVertexAttribIuivEXT MANGLE(GetVertexAttribIuivEXT)
#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
#define glGetVertexAttribiv MANGLE(GetVertexAttribiv)
#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
@@ -613,6 +652,7 @@
#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX)
#define glIsBufferARB MANGLE(IsBufferARB)
#define glIsBuffer MANGLE(IsBuffer)
#define glIsEnabledIndexedEXT MANGLE(IsEnabledIndexedEXT)
#define glIsEnabled MANGLE(IsEnabled)
#define glIsFenceAPPLE MANGLE(IsFenceAPPLE)
#define glIsFenceNV MANGLE(IsFenceNV)
@@ -852,17 +892,32 @@
#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
#define glPrioritizeTextures MANGLE(PrioritizeTextures)
#define glProgramBufferParametersfvNV MANGLE(ProgramBufferParametersfvNV)
#define glProgramBufferParametersIivNV MANGLE(ProgramBufferParametersIivNV)
#define glProgramBufferParametersIuivNV MANGLE(ProgramBufferParametersIuivNV)
#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA)
#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB)
#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB)
#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB)
#define glProgramEnvParameter4fvARB MANGLE(ProgramEnvParameter4fvARB)
#define glProgramEnvParameterI4iNV MANGLE(ProgramEnvParameterI4iNV)
#define glProgramEnvParameterI4ivNV MANGLE(ProgramEnvParameterI4ivNV)
#define glProgramEnvParameterI4uiNV MANGLE(ProgramEnvParameterI4uiNV)
#define glProgramEnvParameterI4uivNV MANGLE(ProgramEnvParameterI4uivNV)
#define glProgramEnvParameters4fvEXT MANGLE(ProgramEnvParameters4fvEXT)
#define glProgramEnvParametersI4ivNV MANGLE(ProgramEnvParametersI4ivNV)
#define glProgramEnvParametersI4uivNV MANGLE(ProgramEnvParametersI4uivNV)
#define glProgramLocalParameter4dARB MANGLE(ProgramLocalParameter4dARB)
#define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB)
#define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB)
#define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB)
#define glProgramLocalParameterI4iNV MANGLE(ProgramLocalParameterI4iNV)
#define glProgramLocalParameterI4ivNV MANGLE(ProgramLocalParameterI4ivNV)
#define glProgramLocalParameterI4uiNV MANGLE(ProgramLocalParameterI4uiNV)
#define glProgramLocalParameterI4uivNV MANGLE(ProgramLocalParameterI4uivNV)
#define glProgramLocalParameters4fvEXT MANGLE(ProgramLocalParameters4fvEXT)
#define glProgramLocalParametersI4ivNV MANGLE(ProgramLocalParametersI4ivNV)
#define glProgramLocalParametersI4uivNV MANGLE(ProgramLocalParametersI4uivNV)
#define glProgramNamedParameter4dNV MANGLE(ProgramNamedParameter4dNV)
#define glProgramNamedParameter4dvNV MANGLE(ProgramNamedParameter4dvNV)
#define glProgramNamedParameter4fNV MANGLE(ProgramNamedParameter4fNV)
@@ -871,9 +926,11 @@
#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV)
#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV)
#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV)
#define glProgramParameteriEXT MANGLE(ProgramParameteriEXT)
#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
#define glProgramStringARB MANGLE(ProgramStringARB)
#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
#define glPushAttrib MANGLE(PushAttrib)
#define glPushClientAttrib MANGLE(PushClientAttrib)
#define glPushMatrix MANGLE(PushMatrix)
@@ -915,6 +972,7 @@
#define glRectsv MANGLE(Rectsv)
#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV)
#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT)
#define glRenderMode MANGLE(RenderMode)
#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN)
@@ -1043,6 +1101,7 @@
#define glTestFenceAPPLE MANGLE(TestFenceAPPLE)
#define glTestFenceNV MANGLE(TestFenceNV)
#define glTestObjectAPPLE MANGLE(TestObjectAPPLE)
#define glTexBufferEXT MANGLE(TexBufferEXT)
#define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI)
#define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI)
#define glTexCoord1d MANGLE(TexCoord1d)
@@ -1121,7 +1180,9 @@
#define glTexImage4DSGIS MANGLE(TexImage4DSGIS)
#define glTexParameterf MANGLE(TexParameterf)
#define glTexParameterfv MANGLE(TexParameterfv)
#define glTexParameterIivEXT MANGLE(TexParameterIivEXT)
#define glTexParameteri MANGLE(TexParameteri)
#define glTexParameterIuivEXT MANGLE(TexParameterIuivEXT)
#define glTexParameteriv MANGLE(TexParameteriv)
#define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT)
#define glTexSubImage1D MANGLE(TexSubImage1D)
@@ -1135,6 +1196,8 @@
#define glTextureMaterialEXT MANGLE(TextureMaterialEXT)
#define glTextureNormalEXT MANGLE(TextureNormalEXT)
#define glTrackMatrixNV MANGLE(TrackMatrixNV)
#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV)
#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV)
#define glTranslated MANGLE(Translated)
#define glTranslatef MANGLE(Translatef)
#define glUniform1fARB MANGLE(Uniform1fARB)
@@ -1145,6 +1208,8 @@
#define glUniform1i MANGLE(Uniform1i)
#define glUniform1ivARB MANGLE(Uniform1ivARB)
#define glUniform1iv MANGLE(Uniform1iv)
#define glUniform1uiEXT MANGLE(Uniform1uiEXT)
#define glUniform1uivEXT MANGLE(Uniform1uivEXT)
#define glUniform2fARB MANGLE(Uniform2fARB)
#define glUniform2f MANGLE(Uniform2f)
#define glUniform2fvARB MANGLE(Uniform2fvARB)
@@ -1153,6 +1218,8 @@
#define glUniform2i MANGLE(Uniform2i)
#define glUniform2ivARB MANGLE(Uniform2ivARB)
#define glUniform2iv MANGLE(Uniform2iv)
#define glUniform2uiEXT MANGLE(Uniform2uiEXT)
#define glUniform2uivEXT MANGLE(Uniform2uivEXT)
#define glUniform3fARB MANGLE(Uniform3fARB)
#define glUniform3f MANGLE(Uniform3f)
#define glUniform3fvARB MANGLE(Uniform3fvARB)
@@ -1161,6 +1228,8 @@
#define glUniform3i MANGLE(Uniform3i)
#define glUniform3ivARB MANGLE(Uniform3ivARB)
#define glUniform3iv MANGLE(Uniform3iv)
#define glUniform3uiEXT MANGLE(Uniform3uiEXT)
#define glUniform3uivEXT MANGLE(Uniform3uivEXT)
#define glUniform4fARB MANGLE(Uniform4fARB)
#define glUniform4f MANGLE(Uniform4f)
#define glUniform4fvARB MANGLE(Uniform4fvARB)
@@ -1169,6 +1238,9 @@
#define glUniform4i MANGLE(Uniform4i)
#define glUniform4ivARB MANGLE(Uniform4ivARB)
#define glUniform4iv MANGLE(Uniform4iv)
#define glUniform4uiEXT MANGLE(Uniform4uiEXT)
#define glUniform4uivEXT MANGLE(Uniform4uivEXT)
#define glUniformBufferEXT MANGLE(UniformBufferEXT)
#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv)
@@ -1340,6 +1412,27 @@
#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB)
#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT)
#define glVertexAttribI1ivEXT MANGLE(VertexAttribI1ivEXT)
#define glVertexAttribI1uiEXT MANGLE(VertexAttribI1uiEXT)
#define glVertexAttribI1uivEXT MANGLE(VertexAttribI1uivEXT)
#define glVertexAttribI2iEXT MANGLE(VertexAttribI2iEXT)
#define glVertexAttribI2ivEXT MANGLE(VertexAttribI2ivEXT)
#define glVertexAttribI2uiEXT MANGLE(VertexAttribI2uiEXT)
#define glVertexAttribI2uivEXT MANGLE(VertexAttribI2uivEXT)
#define glVertexAttribI3iEXT MANGLE(VertexAttribI3iEXT)
#define glVertexAttribI3ivEXT MANGLE(VertexAttribI3ivEXT)
#define glVertexAttribI3uiEXT MANGLE(VertexAttribI3uiEXT)
#define glVertexAttribI3uivEXT MANGLE(VertexAttribI3uivEXT)
#define glVertexAttribI4bvEXT MANGLE(VertexAttribI4bvEXT)
#define glVertexAttribI4iEXT MANGLE(VertexAttribI4iEXT)
#define glVertexAttribI4ivEXT MANGLE(VertexAttribI4ivEXT)
#define glVertexAttribI4svEXT MANGLE(VertexAttribI4svEXT)
#define glVertexAttribI4ubvEXT MANGLE(VertexAttribI4ubvEXT)
#define glVertexAttribI4uiEXT MANGLE(VertexAttribI4uiEXT)
#define glVertexAttribI4uivEXT MANGLE(VertexAttribI4uivEXT)
#define glVertexAttribI4usvEXT MANGLE(VertexAttribI4usvEXT)
#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
#define glVertexAttribPointer MANGLE(VertexAttribPointer)
#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
+13
View File
@@ -44,6 +44,19 @@
#define GLAPIENTRYP GLAPIENTRY *
#endif
#ifdef GLAPI
#undef GLAPI
#endif
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
# define GLAPI __declspec(dllexport)
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# define GLAPI __declspec(dllimport)
# else /* for use with static link lib build of Win32 edition only */
# define GLAPI extern
# endif /* _STATIC_MESA support */
#ifndef GLAPI
#define GLAPI
#endif
+12 -5
View File
@@ -10,6 +10,10 @@
#include <GL/gl.h>
#include <GL/glu.h>
#if defined(__MINGW32__)
#include <GL/mesa_wgl.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
@@ -108,14 +112,14 @@ extern _CRTIMP void __cdecl exit(int);
and redifinition of Windows system defs, also removes requirement of
pretty much any standard windows header from this file */
#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
# define GLUTAPIENTRY __stdcall
#else
# define GLUTAPIENTRY
#endif
/* GLUT API entry point declarations for Win32. */
#if defined(GLUT_BUILDING_LIB) && defined(_DLL)
#if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && defined(_DLL)
# define GLUTAPI __declspec(dllexport)
#elif defined(_DLL)
# define GLUTAPI __declspec(dllimport)
@@ -130,9 +134,12 @@ extern _CRTIMP void __cdecl exit(int);
# pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/glut.h" )
# endif
# define CALLBACK __stdcall
typedef int (GLUTAPIENTRY *PROC)();
typedef void *HGLRC;
typedef void *HDC;
#if !defined(__MINGW32__)
typedef int (GLUTAPIENTRY *PROC)();
typedef void *HGLRC;
typedef void *HDC;
#endif
typedef unsigned long COLORREF;
#endif
+29 -30
View File
@@ -26,11 +26,12 @@
/* prototypes for the Mesa WGL functions */
/* relocated here so that I could make GLUT get them properly */
#define _mesa_wgl_h_
#ifndef _mesa_wgl_h_
#define _mesa_wgl_h_
#if defined(__MINGW32__)
# define __W32API_USE_DLLIMPORT__
#endif
#include <GL/gl.h>
@@ -39,23 +40,16 @@ extern "C" {
#endif
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# define WGLAPI __declspec(dllexport)
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# define GLAPI __declspec(dllimport)
# define WGLAPI __declspec(dllimport)
# else /* for use with static link lib build of Win32 edition only */
# define GLAPI extern
# define WGLAPI __declspec(dllimport)
# endif /* _STATIC_MESA support */
# define GLAPIENTRY __stdcall
#else
/* non-Windows compilation */
# define GLAPI extern
# define GLAPIENTRY
#endif /* WIN32 / CYGWIN32 bracket */
#ifndef WGLAPI
#define WGLAPI GLAPI
#endif
#if defined(__MINGW32__)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN 1
# endif
# include <windows.h>
#endif
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
@@ -80,23 +74,25 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC
# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
#endif
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
#if defined(GL_NO_STDCALL) || !defined(__MINGW32__)
WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
@@ -105,12 +101,15 @@ WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, un
WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
#endif
#ifndef __MINGW32__
WGLAPI int GLAPIENTRY SwapBuffers(HDC);
WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
#endif
#ifndef WGL_ARB_extensions_string
#define WGL_ARB_extensions_string 1
+1
View File
@@ -1053,6 +1053,7 @@ main (int argc, char *argv[])
else
file = argv[1];
glutInit(&argc, argv);
glutInitWindowPosition (0, 0);
glutInitWindowSize(640,480);
glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
+1
View File
@@ -569,6 +569,7 @@ main(int ac, char **av)
if (ac == 2)
frontbuffer = 0;
glutInit(&ac, av);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(0, 0);
glutInitWindowSize(640, 480);
+1
View File
@@ -1042,6 +1042,7 @@ int main(int argc, char **argv)
read_surface( "isosurf.dat" );
glutInit( &argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(400, 400);
+2 -7
View File
@@ -826,7 +826,7 @@ static void pinit(void)
}
static void INIT(void)
int main(int argc, char **argv)
{
printf("Morph 3D - Shows morphing platonic polyhedra\n");
printf("Author: Marcelo Fernandes Vianna (vianna@cat.cbpf.br)\n\n");
@@ -841,6 +841,7 @@ static void INIT(void)
object=1;
glutInit(&argc, argv);
glutInitWindowPosition(0,0);
glutInitWindowSize(640,480);
@@ -888,9 +889,3 @@ static void INIT(void)
glutMainLoop();
}
int main(int argc, char **argv)
{
INIT();
return(0);
}
+11 -11
View File
@@ -333,13 +333,13 @@ menu(int option)
smooth = 0;
break;
case 10:
glPointSize(4.0);
glPointSize(16.0);
break;
case 11:
glPointSize(8.0);
glPointSize(32.0);
break;
case 12:
glPointSize(16.0);
glPointSize(64.0);
break;
case 13:
spin = 1 - spin;
@@ -411,19 +411,19 @@ key(unsigned char c, int x, int y)
glutPostRedisplay();
break;
case '1':
glPointSize(2.0);
glPointSize(16.0);
glutPostRedisplay();
break;
case '2':
glPointSize(4.0);
glPointSize(32.0);
glutPostRedisplay();
break;
case '3':
glPointSize(8.0);
glPointSize(64.0);
glutPostRedisplay();
break;
case '4':
glPointSize(16.0);
glPointSize(128.0);
glutPostRedisplay();
break;
case 27:
@@ -526,9 +526,9 @@ main(int argc, char **argv)
glutAddMenuEntry("Threshold 10", 7);
glutAddMenuEntry("Point smooth on", 8);
glutAddMenuEntry("Point smooth off", 9);
glutAddMenuEntry("Point size 4", 10);
glutAddMenuEntry("Point size 8", 11);
glutAddMenuEntry("Point size 16", 12);
glutAddMenuEntry("Point size 16", 10);
glutAddMenuEntry("Point size 32", 11);
glutAddMenuEntry("Point size 64", 12);
glutAddMenuEntry("Toggle spin", 13);
glutAddMenuEntry("200 points ", 14);
glutAddMenuEntry("500 points ", 15);
@@ -544,7 +544,7 @@ main(int argc, char **argv)
glEnable(GL_DEPTH_TEST);
glEnable(GL_POINT_SMOOTH);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glPointSize(16.0);
glPointSize(32.0);
#ifdef GL_ARB_point_parameters
glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, theQuad);
#endif
+1
View File
@@ -100,6 +100,7 @@ static void init( void )
int main( int argc, char *argv[] )
{
glutInit(&argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(500, 500);
glutInitDisplayMode( GLUT_RGB );
+90 -15
View File
@@ -23,11 +23,21 @@
#include <GL/glfbdev.h>
#include <math.h>
#define DEFAULT_DEPTH 8
/**
* Choose one of these modes
*/
/*static const int XRes = 1280, YRes = 1024, Hz = 75;*/
/*static const int XRes = 1280, YRes = 1024, Hz = 70;*/
/*static const int XRes = 1280, YRes = 1024, Hz = 60;*/
static const int XRes = 1024, YRes = 768, Hz = 70;
static int DesiredDepth = 32;
static int NumFrames = 100;
static struct fb_fix_screeninfo FixedInfo;
static struct fb_var_screeninfo VarInfo, OrigVarInfo;
static int DesiredDepth = 0;
static int OriginalVT = -1;
static int ConsoleFD = -1;
static int FrameBufferFD = -1;
@@ -227,7 +237,6 @@ initialize_fbdev( void )
VarInfo = OrigVarInfo;
/* set the depth, resolution, etc */
DesiredDepth = 32;
if (DesiredDepth)
VarInfo.bits_per_pixel = DesiredDepth;
@@ -251,16 +260,60 @@ initialize_fbdev( void )
VarInfo.blue.length = 8;
VarInfo.transp.length = 8;
}
/* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */
VarInfo.xres_virtual = VarInfo.xres = 1280;
VarInfo.yres_virtual = VarInfo.yres = 1024;
VarInfo.pixclock = 7408;
VarInfo.left_margin = 248;
VarInfo.right_margin = 16;
VarInfo.upper_margin = 38;
VarInfo.lower_margin = 1;
VarInfo.hsync_len = 144;
VarInfo.vsync_len = 3;
/* timing values taken from /etc/fb.modes */
if (XRes == 1280 && YRes == 1024) {
VarInfo.xres_virtual = VarInfo.xres = XRes;
VarInfo.yres_virtual = VarInfo.yres = YRes;
if (Hz == 75) {
VarInfo.pixclock = 7408;
VarInfo.left_margin = 248;
VarInfo.right_margin = 16;
VarInfo.upper_margin = 38;
VarInfo.lower_margin = 1;
VarInfo.hsync_len = 144;
VarInfo.vsync_len = 3;
}
else if (Hz == 70) {
VarInfo.pixclock = 7937;
VarInfo.left_margin = 216;
VarInfo.right_margin = 80;
VarInfo.upper_margin = 36;
VarInfo.lower_margin = 1;
VarInfo.hsync_len = 112;
VarInfo.vsync_len = 5;
}
else if (Hz == 60) {
VarInfo.pixclock = 9260;
VarInfo.left_margin = 248;
VarInfo.right_margin = 48;
VarInfo.upper_margin = 38;
VarInfo.lower_margin = 1;
VarInfo.hsync_len = 112;
VarInfo.vsync_len = 3;
}
else {
fprintf(stderr, "invalid rate for 1280x1024\n");
exit(1);
}
}
else if (XRes == 1024 && YRes == 768 && Hz == 70) {
VarInfo.xres_virtual = VarInfo.xres = XRes;
VarInfo.yres_virtual = VarInfo.yres = YRes;
if (Hz == 70) {
VarInfo.pixclock = 13334;
VarInfo.left_margin = 144;
VarInfo.right_margin = 24;
VarInfo.upper_margin = 29;
VarInfo.lower_margin = 3;
VarInfo.hsync_len = 136;
VarInfo.vsync_len = 6;
}
else {
fprintf(stderr, "invalid rate for 1024x768\n");
exit(1);
}
}
VarInfo.xoffset = 0;
VarInfo.yoffset = 0;
@@ -338,7 +391,7 @@ initialize_fbdev( void )
printf("MMIOAddress = %p\n", MMIOAddress);
/* try out some simple MMIO register reads */
if (1)
if (0)
{
typedef unsigned int CARD32;
typedef unsigned char CARD8;
@@ -452,6 +505,7 @@ gltest( void )
GLFBDevVisualPtr vis;
int bytes, r, g, b, a;
float ang;
int i;
printf("GLFBDEV_VENDOR = %s\n", glFBDevGetString(GLFBDEV_VENDOR));
printf("GLFBDEV_VERSION = %s\n", glFBDevGetString(GLFBDEV_VERSION));
@@ -491,13 +545,17 @@ gltest( void )
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
for (ang = 0; ang <= 180; ang += 15) {
printf("Drawing %d frames...\n", NumFrames);
ang = 0.0;
for (i = 0; i < NumFrames; i++) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(ang, 1, 0, 0);
doughnut(1, 3, 40, 20);
glPopMatrix();
glFBDevSwapBuffers(buf);
ang += 15.0;
}
/* clean up */
@@ -510,12 +568,29 @@ gltest( void )
}
static void
parse_args(int argc, char *argv[])
{
int i;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-f") == 0) {
NumFrames = atoi(argv[i+1]);
i++;
}
}
}
int
main( int argc, char *argv[] )
{
signal(SIGUSR1, signal_handler); /* exit if someone tries a vt switch */
signal(SIGSEGV, signal_handler); /* catch segfaults */
parse_args(argc, argv);
printf("Setting mode to %d x %d @ %d Hz, %d bpp\n", XRes, YRes, Hz, DesiredDepth);
initialize_fbdev();
gltest();
shutdown_fbdev();
+29 -4
View File
@@ -26,6 +26,15 @@
# 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:
@@ -44,15 +53,31 @@
TOP = ../..
include $(TOP)/configs/config.mgw
ALL_USING_STDCALL ?= 1
GL_USING_STDCALL ?= 1
GLUT_USING_STDCALL ?= 1
CC = mingw32-gcc
CFLAGS = -Wall -W -pedantic
CFLAGS = -Wall -pedantic
CFLAGS += -O2 -ffast-math
CFLAGS += -I$(TOP)/include -I../util
ifeq ($(FX),1)
CFLAGS += -DFX
CFLAGS += -DFX
endif
CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK -D_STDCALL_SUPPORTED
CFLAGS += -D_WINDEF_ -D_WINGDI_
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
+1
View File
@@ -55,6 +55,7 @@ SOURCES = \
pbo.c \
prog_parameter.c \
projtex.c \
random.c \
readrate.c \
seccolor.c \
sharedtex.c \
+13 -8
View File
@@ -19,6 +19,7 @@ static int Win;
static int Width = 400, Height = 400;
static GLuint FBobject, RBobjects[3];
static GLfloat Xrot = 0.0, Yrot = 0.0;
static GLuint Program;
static void
@@ -40,6 +41,8 @@ Display(void)
GL_COLOR_ATTACHMENT1_EXT
};
glUseProgram_func(Program);
/* draw to user framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBobject);
@@ -71,10 +74,12 @@ Display(void)
buffer);
/* top half = colorbuffer 1 */
glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
glReadPixels(0, Height/2, Width, Height / 2, GL_RGBA, GL_UNSIGNED_BYTE,
buffer + Width * Height / 2 * 4);
glReadPixels(0, Height/2, Width, Height - Height / 2,
GL_RGBA, GL_UNSIGNED_BYTE,
buffer + Width * (Height / 2) * 4);
/* draw to window */
glUseProgram_func(0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glWindowPos2iARB(0, 0);
glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
@@ -243,15 +248,15 @@ SetupShaders(void)
" gl_FragData[1] = vec4(1.0) - gl_Color; \n"
"}\n";
GLuint fragShader, program;
GLuint fragShader;
fragShader = LoadAndCompileShader(GL_FRAGMENT_SHADER, fragShaderText);
program = glCreateProgram_func();
Program = glCreateProgram_func();
glAttachShader_func(program, fragShader);
glLinkProgram_func(program);
CheckLink(program);
glUseProgram_func(program);
glAttachShader_func(Program, fragShader);
glLinkProgram_func(Program);
CheckLink(Program);
glUseProgram_func(Program);
}
+457
View File
@@ -0,0 +1,457 @@
/**
* Random rendering, to check for crashes, hangs, etc.
*
* Brian Paul
* 21 June 2007
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glut.h>
static int Win;
static GLboolean Anim = GL_TRUE;
static int Width = 200, Height = 200;
static int DB = 0;
static int MinVertexCount = 0, MaxVertexCount = 1000;
static int Count = 0;
struct vertex
{
int type;
float v[4];
};
static int BufferSize = 10000;
static struct vertex *Vbuffer = NULL;
static int Vcount, Vprim;
enum {
BEGIN,
END,
VERTEX2,
VERTEX3,
VERTEX4,
COLOR3,
COLOR4,
TEX2,
TEX3,
TEX4,
SECCOLOR3,
NORMAL3
};
/**
* This can be called from within gdb after a crash:
* (gdb) call ReportState()
*/
static void
ReportState(void)
{
static const struct {
GLenum token;
char *str;
GLenum type;
} state [] = {
{ GL_ALPHA_TEST, "GL_ALPHA_TEST", GL_INT },
{ GL_BLEND, "GL_BLEND", GL_INT },
{ GL_CLIP_PLANE0, "GL_CLIP_PLANE0", GL_INT },
{ GL_DEPTH_TEST, "GL_DEPTH_TEST", GL_INT },
{ GL_LIGHTING, "GL_LIGHTING", GL_INT },
{ GL_LINE_WIDTH, "GL_LINE_WIDTH", GL_FLOAT },
{ GL_POINT_SIZE, "GL_POINT_SIZE", GL_FLOAT },
{ GL_SHADE_MODEL, "GL_SHADE_MODEL", GL_INT },
{ GL_SCISSOR_TEST, "GL_SCISSOR_TEST", GL_INT },
{ 0, NULL, 0 }
};
GLint i;
for (i = 0; state[i].token; i++) {
if (state[i].type == GL_INT) {
GLint v;
glGetIntegerv(state[i].token, &v);
printf("%s = %d\n", state[i].str, v);
}
else {
GLfloat v;
glGetFloatv(state[i].token, &v);
printf("%s = %f\n", state[i].str, v);
}
}
}
static void
PrintVertex(const char *f, const struct vertex *v, int sz)
{
int i;
printf("%s(", f);
for (i = 0; i < sz; i++) {
printf("%g%s", v->v[i], (i == sz-1) ? "" : ", ");
}
printf(");\n");
}
/**
* This can be called from within gdb after a crash:
* (gdb) call ReportState()
*/
static void
LastPrim(void)
{
int i;
for (i = 0; i < Vcount; i++) {
switch (Vbuffer[i].type) {
case BEGIN:
printf("glBegin(%d);\n", (int) Vbuffer[i].v[0]);
break;
case END:
printf("glEnd();\n");
break;
case VERTEX2:
PrintVertex("glVertex2f", Vbuffer + i, 2);
break;
case VERTEX3:
PrintVertex("glVertex3f", Vbuffer + i, 3);
break;
case VERTEX4:
PrintVertex("glVertex4f", Vbuffer + i, 4);
break;
case COLOR3:
PrintVertex("glColor3f", Vbuffer + i, 3);
break;
case COLOR4:
PrintVertex("glColor4f", Vbuffer + i, 4);
break;
case TEX2:
PrintVertex("glTexCoord2f", Vbuffer + i, 2);
break;
case TEX3:
PrintVertex("glTexCoord3f", Vbuffer + i, 3);
break;
case TEX4:
PrintVertex("glTexCoord4f", Vbuffer + i, 4);
break;
case SECCOLOR3:
PrintVertex("glSecondaryColor3f", Vbuffer + i, 3);
break;
case NORMAL3:
PrintVertex("glNormal3f", Vbuffer + i, 3);
break;
default:
abort();
}
}
}
static int
RandomInt(int max)
{
if (max == 0)
return 0;
return rand() % max;
}
static float
RandomFloat(float min, float max)
{
int k = rand() % 10000;
float x = min + (max - min) * k / 10000.0;
return x;
}
/*
* Return true if random number in [0,1] is <= percentile.
*/
static GLboolean
RandomChoice(float percentile)
{
return RandomFloat(0.0, 1.0) <= percentile;
}
static void
RandomStateChange(void)
{
int k = RandomInt(19);
switch (k) {
case 0:
glEnable(GL_BLEND);
break;
case 1:
glDisable(GL_BLEND);
break;
case 2:
glEnable(GL_ALPHA_TEST);
break;
case 3:
glEnable(GL_ALPHA_TEST);
break;
case 4:
glEnable(GL_DEPTH_TEST);
break;
case 5:
glEnable(GL_DEPTH_TEST);
break;
case 6:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
break;
case 7:
glPointSize(10.0);
break;
case 8:
glPointSize(1.0);
break;
case 9:
glLineWidth(10.0);
break;
case 10:
glLineWidth(1.0);
break;
case 11:
glEnable(GL_LIGHTING);
break;
case 12:
glDisable(GL_LIGHTING);
break;
case 13:
glEnable(GL_SCISSOR_TEST);
break;
case 14:
glDisable(GL_SCISSOR_TEST);
break;
case 15:
glEnable(GL_CLIP_PLANE0);
break;
case 16:
glDisable(GL_CLIP_PLANE0);
break;
case 17:
glShadeModel(GL_FLAT);
break;
case 18:
glShadeModel(GL_SMOOTH);
break;
}
}
static void
RandomPrimitive(void)
{
int i;
int len = MinVertexCount + RandomInt(MaxVertexCount - MinVertexCount);
Vprim = RandomInt(10);
glBegin(Vprim);
Vbuffer[Vcount].type = BEGIN;
Vbuffer[Vcount].v[0] = Vprim;
Vcount++;
for (i = 0; i < len; i++) {
Vbuffer[Vcount].v[0] = RandomFloat(-3, 3);
Vbuffer[Vcount].v[1] = RandomFloat(-3, 3);
Vbuffer[Vcount].v[2] = RandomFloat(-3, 3);
Vbuffer[Vcount].v[3] = RandomFloat(-3, 3);
int k = RandomInt(9);
switch (k) {
case 0:
glVertex2fv(Vbuffer[Vcount].v);
Vbuffer[Vcount].type = VERTEX2;
break;
case 1:
glVertex3fv(Vbuffer[Vcount].v);
Vbuffer[Vcount].type = VERTEX3;
break;
case 2:
glVertex4fv(Vbuffer[Vcount].v);
Vbuffer[Vcount].type = VERTEX4;
break;
case 3:
glColor3fv(Vbuffer[Vcount].v);
Vbuffer[Vcount].type = COLOR3;
break;
case 4:
glColor4fv(Vbuffer[Vcount].v);
Vbuffer[Vcount].type = COLOR4;
break;
case 5:
glTexCoord2fv(Vbuffer[Vcount].v);
Vbuffer[Vcount].type = TEX2;
break;
case 6:
glTexCoord3fv(Vbuffer[Vcount].v);
Vbuffer[Vcount].type = TEX3;
break;
case 7:
glTexCoord4fv(Vbuffer[Vcount].v);
Vbuffer[Vcount].type = TEX4;
break;
case 8:
glSecondaryColor3fv(Vbuffer[Vcount].v);
Vbuffer[Vcount].type = SECCOLOR3;
break;
case 9:
glNormal3fv(Vbuffer[Vcount].v);
Vbuffer[Vcount].type = NORMAL3;
break;
default:
abort();
}
Vcount++;
if (Vcount >= BufferSize - 2) {
/* reset */
Vcount = 0;
}
}
Vbuffer[Vcount++].type = END;
glEnd();
}
static void
RandomDraw(void)
{
int i;
GLboolean dlist = RandomChoice(0.1);
if (dlist)
glNewList(1, GL_COMPILE);
for (i = 0; i < 3; i++) {
RandomStateChange();
}
RandomPrimitive();
if (dlist) {
glEndList();
glCallList(1);
}
}
static void
Idle(void)
{
glutPostRedisplay();
}
static void
Draw(void)
{
#if 1
RandomDraw();
Count++;
#else
/* cut & paste temp code here */
#endif
assert(glGetError() == 0);
if (DB)
glutSwapBuffers();
else
glFinish();
}
static void
Reshape(int width, int height)
{
Width = width;
Height = height;
glViewport(0, 0, width, height);
glScissor(20, 20, Width-40, Height-40);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -15.0);
}
static void
Key(unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch (key) {
case 27:
glutDestroyWindow(Win);
exit(0);
break;
}
glutPostRedisplay();
}
static void
Init(void)
{
static const GLdouble plane[4] = {1, 1, 0, 0};
glDrawBuffer(GL_FRONT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_LIGHT0);
glClipPlane(GL_CLIP_PLANE0, plane);
Vbuffer = (struct vertex *)
malloc(BufferSize * sizeof(struct vertex));
/* silence warnings */
(void) ReportState;
(void) LastPrim;
}
static void
ParseArgs(int argc, char *argv[])
{
int i;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-s") == 0) {
int j = atoi(argv[i + 1]);
printf("Random seed value: %d\n", j);
srand(j);
i++;
}
else if (strcmp(argv[i], "-a") == 0) {
i++;
MinVertexCount = atoi(argv[i]);
}
else if (strcmp(argv[i], "-b") == 0) {
i++;
MaxVertexCount = atoi(argv[i]);
}
}
}
int
main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
ParseArgs(argc, argv);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
if (Anim)
glutIdleFunc(Idle);
Init();
glutMainLoop();
return 0;
}
+22 -12
View File
@@ -71,12 +71,12 @@ typedef Vertex Quad[4];
/* data to define the six faces of a unit cube */
Quad quads[MAXQUAD] = {
{ {0,0,0}, {1,0,0}, {1,1,0}, {0,1,0} },
{ {0,0,1}, {1,0,1}, {1,1,1}, {0,1,1} },
{ {0,0,0}, {1,0,0}, {1,0,1}, {0,0,1} },
{ {0,1,0}, {1,1,0}, {1,1,1}, {0,1,1} },
{ {0,0,0}, {0,0,1}, {0,1,1}, {0,1,0} },
{ {1,0,0}, {1,0,1}, {1,1,1}, {1,1,0} }
{ {0,0,0}, {0,0,1}, {0,1,1}, {0,1,0} }, /* x = 0 */
{ {0,0,0}, {1,0,0}, {1,0,1}, {0,0,1} }, /* y = 0 */
{ {0,0,0}, {1,0,0}, {1,1,0}, {0,1,0} }, /* z = 0 */
{ {1,0,0}, {1,0,1}, {1,1,1}, {1,1,0} }, /* x = 1 */
{ {0,1,0}, {1,1,0}, {1,1,1}, {0,1,1} }, /* y = 1 */
{ {0,0,1}, {1,0,1}, {1,1,1}, {0,1,1} } /* z = 1 */
};
#define WIREFRAME 0
@@ -86,7 +86,7 @@ static void error(const char* prog, const char* msg);
static void cubes(int mx, int my, int mode);
static void fill(Quad quad);
static void outline(Quad quad);
static void draw_hidden(Quad quad, int mode);
static void draw_hidden(Quad quad, int mode, int face);
static void process_input(Display *dpy, Window win);
static int query_extension(char* extName);
@@ -101,6 +101,7 @@ int main(int argc, char** argv) {
XSetWindowAttributes swa;
Window win;
GLXContext cx;
GLint z;
dpy = XOpenDisplay(0);
if (!dpy) error(argv[0], "can't open display");
@@ -134,13 +135,16 @@ int main(int argc, char** argv) {
/* set up viewing parameters */
glMatrixMode(GL_PROJECTION);
gluPerspective(20, 1, 0.1, 20);
gluPerspective(20, 1, 10, 20);
glMatrixMode(GL_MODELVIEW);
glTranslatef(0, 0, -15);
/* set other relevant state information */
glEnable(GL_DEPTH_TEST);
glGetIntegerv(GL_DEPTH_BITS, &z);
printf("GL_DEPTH_BITS = %d\n", z);
#ifdef GL_EXT_polygon_offset
printf("using 1.0 offset extension\n");
glPolygonOffsetEXT( 1.0, 0.00001 );
@@ -160,6 +164,7 @@ int main(int argc, char** argv) {
static void
draw_scene(int mx, int my) {
glClearColor(0.25, 0.25, 0.25, 0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
@@ -206,7 +211,7 @@ cubes(int mx, int my, int mode) {
glTranslatef(x, y, z);
glScalef(0.8, 0.8, 0.8);
for (i = 0; i < MAXQUAD; i++)
draw_hidden(quads[i], mode);
draw_hidden(quads[i], mode, i);
glPopMatrix();
}
}
@@ -236,13 +241,18 @@ outline(Quad quad) {
}
static void
draw_hidden(Quad quad, int mode) {
draw_hidden(Quad quad, int mode, int face) {
static const GLfloat colors[3][3] = {
{0.5, 0.5, 0.0},
{0.8, 0.5, 0.0},
{0.0, 0.5, 0.8}
};
if (mode == HIDDEN_LINE) {
glColor3f(0, 0, 0);
glColor3fv(colors[face % 3]);
fill(quad);
}
/* draw the outline using white, optionally fill the interior with black */
/* draw the outline using white */
glColor3f(1, 1, 1);
outline(quad);
}
+4 -5
View File
@@ -93,7 +93,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
None
},
{
/* Single bufferd, without depth buffer */
/* Single buffered, without depth buffer */
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RED_SIZE, 1,
@@ -105,7 +105,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
None
},
{
/* Double bufferd, without depth buffer */
/* Double buffered, without depth buffer */
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RED_SIZE, 1,
@@ -130,9 +130,8 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
/* Get list of possible frame buffer configurations */
fbConfigs = ChooseFBConfig(dpy, screen, fbAttribs[attempt], &nConfigs);
if (nConfigs==0 || !fbConfigs) {
printf("Error: glXChooseFBConfig failed\n");
XCloseDisplay(dpy);
return 0;
printf("Note: glXChooseFBConfig(%s) failed\n", fbString[attempt]);
continue;
}
#if 0 /*DEBUG*/
+229
View File
@@ -0,0 +1,229 @@
# 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)
+1 -1
View File
@@ -93,7 +93,7 @@ public:
output_triangles = flag;
}
#ifdef _WIN32
void putCallBack(GLenum which, void (APIENTRY *fn)() );
void putCallBack(GLenum which, void (GLAPIENTRY *fn)() );
#else
void putCallBack(GLenum which, _GLUfuncptr fn );
#endif
+5 -2
View File
@@ -1184,8 +1184,11 @@ return;
}
void
OpenGLSurfaceEvaluator::putCallBack(GLenum which, _GLUfuncptr fn )
#ifdef _WIN32
void OpenGLSurfaceEvaluator::putCallBack(GLenum which, void (GLAPIENTRY *fn)() )
#else
void OpenGLSurfaceEvaluator::putCallBack(GLenum which, _GLUfuncptr fn )
#endif
{
switch(which)
{
+1 -1
View File
@@ -145,7 +145,7 @@ public:
void newtmeshvert( long, long );
#ifdef _WIN32
void putCallBack(GLenum which, void (APIENTRY *fn)() );
void putCallBack(GLenum which, void (GLAPIENTRY *fn)() );
#else
void putCallBack(GLenum which, _GLUfuncptr fn );
#endif
@@ -43,10 +43,9 @@
#include "definitions.h"
#include "primitiveStream.h"
#include "directedLine.h"
#include "arc.h"
class Backend;
class Arc;
typedef Arc *Arc_ptr;
class reflexChain{
Real2 *queue;
+45 -23
View File
@@ -28,14 +28,13 @@
typedef void (GLUTCALLBACK *__GlutTimerCallback) ( int value );
typedef struct __GlutTimer_s {
unsigned int interval;
struct timeval interval;
struct timeval expire;
__GlutTimerCallback func;
int value;
struct __GlutTimer_s *next;
struct __GlutTimer_s *prev;
} __GlutTimer;
/*****************************************************************************/
@@ -207,8 +206,7 @@ glutIdleFunc( void (GLUTCALLBACK *func) (void) )
void GLUTAPIENTRY
glutTimerFunc( unsigned int msec, void (GLUTCALLBACK *func) (int value), int value )
{
__GlutTimer *timer;
struct timeval now;
__GlutTimer *timer;
if (!func)
return;
@@ -217,24 +215,19 @@ glutTimerFunc( unsigned int msec, void (GLUTCALLBACK *func) (int value), int val
if (!timer)
__glutFatalError( "out of memory" );
gettimeofday( &now, NULL );
timer->interval = msec;
timer->expire.tv_sec = now.tv_sec + (now.tv_usec/1000 + msec) / 1000;
timer->expire.tv_usec = (now.tv_usec + msec*1000) % 1000000;
timer->interval.tv_sec = msec / 1000;
timer->interval.tv_usec = (msec % 1000) * 1000;
gettimeofday( &timer->expire, NULL );
timer->expire.tv_usec += timer->interval.tv_usec;
timer->expire.tv_sec += timer->interval.tv_sec + timer->expire.tv_usec/1000000;
timer->expire.tv_usec %= 1000000;
timer->func = func;
timer->value = value;
if (g_timers) {
timer->prev = g_timers->prev;
g_timers->prev->next = timer;
g_timers->prev = timer;
}
else {
g_timers = timer;
g_timers->prev = timer;
}
timer->next = g_timers;
g_timers = timer;
}
@@ -254,12 +247,41 @@ __glutHandleTimers( void )
g_idle = GL_FALSE;
cur->func( cur->value );
cur->expire.tv_sec += (cur->expire.tv_usec/1000 + cur->interval) / 1000;
cur->expire.tv_usec = (cur->expire.tv_usec + cur->interval*1000) % 1000000;
cur->expire.tv_usec += cur->interval.tv_usec;
cur->expire.tv_sec += cur->interval.tv_sec + cur->expire.tv_usec/1000000;
cur->expire.tv_usec %= 1000000;
}
}
}
}
GLboolean
__glutGetTimeout( int *ret_msec )
{
__GlutTimer *cur;
struct timeval *time = NULL;
struct timeval now;
for (cur = g_timers; cur; cur = cur->next) {
if (time == NULL ||
time->tv_sec > cur->expire.tv_sec ||
(time->tv_sec == cur->expire.tv_sec &&
time->tv_usec > cur->expire.tv_usec)) {
time = &cur->expire;
}
}
if (time == NULL)
return GL_FALSE;
gettimeofday( &now, NULL );
*ret_msec = (time->tv_sec - now.tv_sec) * 1000 +
(time->tv_usec - now.tv_usec + 500) / 1000;
return GL_TRUE;
}
void
@@ -275,4 +297,4 @@ __glutFreeTimers( void )
g_timers = NULL;
}
+9 -2
View File
@@ -435,13 +435,14 @@ glutMainLoop( void )
{
__glutAssert( events != NULL );
__glutHandleWindows();
while (GL_TRUE) {
DFBEvent evt, prev;
g_idle = GL_TRUE;
__glutHandleTimers();
__glutHandleWindows();
prev.clazz = DFEC_NONE;
@@ -471,13 +472,19 @@ glutMainLoop( void )
__glutHandleTimers();
}
__glutHandleWindows();
if (g_idle) {
if (idle_func) {
idle_func();
}
else {
int msec;
__glutSetWindow( NULL );
usleep( 500 );
if (__glutGetTimeout( &msec ))
events->WaitForEventWithTimeout( events, msec/1000, msec%1000 );
else
events->WaitForEvent( events );
}
}
}
+1
View File
@@ -124,6 +124,7 @@ extern void __glutDestroyWindow( __GlutWindow *window );
extern void __glutDestroyWindows( void );
/* callback.c */
extern void __glutHandleTimers( void );
extern GLboolean __glutGetTimeout( int *ret_msec );
extern void __glutFreeTimers( void );
+198
View File
@@ -0,0 +1,198 @@
# 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)
+2 -2
View File
@@ -18,7 +18,7 @@
/* Set a Fortran callback function. */
void GLUTAPIENTRY
void APIENTRY
__glutSetFCB(int which, void *func)
{
#ifdef SUPPORT_FORTRAN
@@ -100,7 +100,7 @@ __glutSetFCB(int which, void *func)
/* Get a Fortran callback function. */
void* GLUTAPIENTRY
void* APIENTRY
__glutGetFCB(int which)
{
#ifdef SUPPORT_FORTRAN
+3
View File
@@ -23,6 +23,9 @@
#endif
#include <X11/Xutil.h>
#else
#ifdef __MINGW32__
#include <GL/gl.h>
#endif
#include <windows.h>
#ifndef __CYGWIN32__
#include <mmsystem.h> /* Win32 Multimedia API header. */
+3
View File
@@ -6,6 +6,9 @@
implied. This program is -not- in the public domain. */
#ifdef _WIN32
#ifdef __MINGW32__
#include <GL/gl.h>
#endif
#include <windows.h>
#ifndef __CYGWIN32__
#include <mmsystem.h> /* Win32 Multimedia API header. */
+3
View File
@@ -26,7 +26,10 @@
#include <GL/glx.h>
#endif
#ifndef GLUT_BUILDING_LIB
#define GLUT_BUILDING_LIB /* Building the GLUT library itself. */
#endif
#include <GL/glut.h>
#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__)
+1
View File
@@ -15,6 +15,7 @@
/* The following added by Paul Garceau <pgarceau@teleport.com> */
#if defined(__MINGW32__)
#include <GL/gl.h>
#include <time.h>
#include <windows.h>
struct timeval;
+3
View File
@@ -9,6 +9,9 @@
#include "glutint.h"
#include <sys/timeb.h>
#ifdef __MINGW32__
#include <ctype.h>
#endif
#if defined(_WIN32) && !defined(__CYGWIN32__)
#include <mmsystem.h> /* Win32 Multimedia API header. */
+4 -6
View File
@@ -6,16 +6,14 @@
/* This program is freely distributable without licensing fees
and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
#ifdef __MINGW32__
#include <GL/gl.h>
#endif
#include <stdlib.h>
#include <windows.h>
/* These definitions are missing from windows.h */
WINGDIAPI int WINAPI wglChoosePixelFormat(HDC, PIXELFORMATDESCRIPTOR *);
WINGDIAPI int WINAPI wglDescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
WINGDIAPI int WINAPI wglGetPixelFormat(HDC);
WINGDIAPI BOOL WINAPI wglSetPixelFormat(HDC, int, PIXELFORMATDESCRIPTOR *);
WINGDIAPI BOOL WINAPI wglSwapBuffers(HDC);
/* Type definitions (conversions) */
typedef int Visual; /* Win32 equivalent of X11 type */
+3 -3
View File
@@ -176,9 +176,9 @@ clean:
-rm -f */*/*.o
-rm -f depend depend.bak libmesa.a
-rm -f drivers/*/*.o
(cd drivers/dri ; $(MAKE) clean)
(cd x86 ; $(MAKE) clean)
(cd x86-64 ; $(MAKE) clean)
(cd drivers/dri && $(MAKE) clean)
(cd x86 && $(MAKE) clean)
(cd x86-64 && $(MAKE) clean)
include depend
+40 -11
View File
@@ -1,5 +1,5 @@
# Mesa 3-D graphics library
# Version: 5.1
# Version: 7.0
#
# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
#
@@ -26,6 +26,16 @@
# 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:
@@ -52,7 +62,6 @@
#
.PHONY: all clean
.INTERMEDIATE: x86/gen_matypes.exe
.SUFFIXES: .rc .res
@@ -60,6 +69,8 @@
# Set this to the prefix of your build tools, i.e. mingw32-
TOOLS_PREFIX = mingw32-
TOP = ../..
GLIDE ?= $(TOP)/glide3
LIBDIR = $(TOP)/lib
@@ -71,11 +82,25 @@ else
GL_IMP = libopengl32.a
endif
LDLIBS = -lgdi32
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_
CFLAGS += $(INCLUDE_DIRS)
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
@@ -104,6 +129,8 @@ endif
include sources
CFLAGS += $(INCLUDE_DIRS)
ifeq ($(X86),1)
CFLAGS += -DUSE_X86_ASM
CFLAGS += -DUSE_MMX_ASM
@@ -140,10 +167,9 @@ RESOURCE = $(GL_RES:.rc=.res)
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.S.o:
$(CC) -o $@ $(CFLAGS) -c $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
.rc.res:
windres -o $@ -Irc -Ocoff $<
@@ -153,9 +179,8 @@ $(LIBDIR):
mkdir -p $(LIBDIR)
$(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP): $(OBJECTS) $(RESOURCE)
$(TOOLS_PREFIX)dllwrap -o $(LIBDIR)/$(GL_DLL) --output-lib $(LIBDIR)/$(GL_IMP) \
--target i386-mingw32 --def $(GL_DEF) -Wl,-enable-stdcall-fixup \
$^ $(LDLIBS)
$(CC) -shared -fPIC -o $(LIBDIR)/$(GL_DLL) $(LDFLAGS) \
$^ $(LDLIBS)
$(X86_OBJECTS): x86/matypes.h
@@ -187,17 +212,21 @@ tnl/t_vtx_x86_gcc.o: tnl/t_vtx_x86_gcc.S
$(CC) -o $@ $(CFLAGS) -DSTDCALL_API -c $<
clean:
-$(call UNLINK,array_cache/*.o)
-$(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)
+16 -11
View File
@@ -134,7 +134,6 @@ static bool directfbgl_init_visual ( GLvisual *visual,
static bool directfbgl_create_context ( GLcontext *context,
GLframebuffer *framebuffer,
GLvisual *visual,
DFBSurfacePixelFormat format,
IDirectFBGL_data *data );
static void directfbgl_destroy_context( GLcontext *context,
GLframebuffer *framebuffer );
@@ -340,8 +339,9 @@ Construct( IDirectFBGL *thiz, IDirectFBSurface *surface )
}
/* Create context. */
if (!directfbgl_create_context( &data->context, &data->framebuffer,
&data->visual, data->format, data )) {
if (!directfbgl_create_context( &data->context,
&data->framebuffer,
&data->visual, data )) {
D_ERROR( "DirectFBGL/Mesa: failed to create context.\n" );
IDirectFBGL_Mesa_Destruct( thiz );
return DFB_UNSUPPORTED;
@@ -762,11 +762,10 @@ directfbgl_init_visual( GLvisual *visual,
}
static bool
directfbgl_create_context( GLcontext *context,
GLframebuffer *framebuffer,
GLvisual *visual,
DFBSurfacePixelFormat format,
IDirectFBGL_data *data )
directfbgl_create_context( GLcontext *context,
GLframebuffer *framebuffer,
GLvisual *visual,
IDirectFBGL_data *data )
{
struct dd_function_table functions;
@@ -800,7 +799,7 @@ directfbgl_create_context( GLcontext *context,
data->render.Delete = dfbDeleteRenderbuffer;
data->render.AllocStorage = dfbRenderbufferStorage;
switch (format) {
switch (data->format) {
case DSPF_RGB332:
data->render.GetRow = get_row_RGB332;
data->render.GetValues = get_values_RGB332;
@@ -887,6 +886,9 @@ directfbgl_create_context( GLcontext *context,
return false;
}
data->render.Width = data->width;
data->render.Height = data->height;
_mesa_add_renderbuffer( framebuffer, BUFFER_FRONT_LEFT, &data->render );
_mesa_add_soft_renderbuffers( framebuffer,
@@ -908,8 +910,11 @@ static void
directfbgl_destroy_context( GLcontext *context,
GLframebuffer *framebuffer )
{
_mesa_free_framebuffer_data( framebuffer );
_mesa_notifyDestroy( context );
_swsetup_DestroyContext( context );
_swrast_DestroyContext( context );
_tnl_DestroyContext( context );
_vbo_DestroyContext( context );
//_mesa_free_framebuffer_data( framebuffer );
_mesa_free_context_data( context );
}
+2
View File
@@ -428,10 +428,12 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp)
if (pdp->pClipRects) {
_mesa_free(pdp->pClipRects);
pdp->pClipRects = NULL;
}
if (pdp->pBackClipRects) {
_mesa_free(pdp->pBackClipRects);
pdp->pBackClipRects = NULL;
}
DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+15 -5
View File
@@ -1478,9 +1478,10 @@ static const char ImageTransformParameterfvHP_names[] =
"";
#endif
#if defined(need_GL_ARB_vertex_program)
#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4ivARB_names[] =
"ip\0" /* Parameter signature */
"glVertexAttrib4iv\0"
"glVertexAttrib4ivARB\0"
"";
#endif
@@ -1586,9 +1587,10 @@ static const char PixelTransformParameterfvEXT_names[] =
"";
#endif
#if defined(need_GL_ARB_vertex_program)
#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4bvARB_names[] =
"ip\0" /* Parameter signature */
"glVertexAttrib4bv\0"
"glVertexAttrib4bvARB\0"
"";
#endif
@@ -2391,9 +2393,10 @@ static const char GetAttribLocationARB_names[] =
"";
#endif
#if defined(need_GL_ARB_vertex_program)
#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4ubvARB_names[] =
"ip\0" /* Parameter signature */
"glVertexAttrib4ubv\0"
"glVertexAttrib4ubvARB\0"
"";
#endif
@@ -2910,9 +2913,10 @@ static const char ReplacementCodeuiColor4ubVertex3fSUN_names[] =
"";
#endif
#if defined(need_GL_ARB_vertex_program)
#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4usvARB_names[] =
"ip\0" /* Parameter signature */
"glVertexAttrib4usv\0"
"glVertexAttrib4usvARB\0"
"";
#endif
@@ -4393,9 +4397,10 @@ static const char WindowPos4iMESA_names[] =
"";
#endif
#if defined(need_GL_ARB_vertex_program)
#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4uivARB_names[] =
"ip\0" /* Parameter signature */
"glVertexAttrib4uiv\0"
"glVertexAttrib4uivARB\0"
"";
#endif
@@ -6257,6 +6262,8 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = {
{ GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 },
{ CreateProgram_names, CreateProgram_remap_index, -1 },
{ StencilFuncSeparate_names, StencilFuncSeparate_remap_index, -1 },
{ VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, -1 },
{ VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, -1 },
{ VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 },
{ VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 },
{ VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 },
@@ -6270,6 +6277,7 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = {
{ VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 },
{ GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 },
{ GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 },
{ VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, -1 },
{ Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 },
{ VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 },
{ VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 },
@@ -6282,6 +6290,7 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = {
{ VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 },
{ Uniform4fARB_names, Uniform4fARB_remap_index, -1 },
{ VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 },
{ VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 },
{ LinkProgramARB_names, LinkProgramARB_remap_index, -1 },
{ ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 },
{ VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 },
@@ -6311,6 +6320,7 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = {
{ DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 },
{ Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 },
{ EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 },
{ VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, -1 },
{ VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 },
{ GetShaderiv_names, GetShaderiv_remap_index, -1 },
{ VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 },
+8 -2
View File
@@ -380,7 +380,10 @@ static void i810CullFaceFrontFace(GLcontext *ctx, GLenum unused)
static void i810LineWidth( GLcontext *ctx, GLfloat widthf )
{
i810ContextPtr imesa = I810_CONTEXT( ctx );
int width = (int)ctx->Line._Width;
/* AA, non-AA limits are same */
const int width = (int) CLAMP(ctx->Line.Width,
ctx->Const.MinLineWidth,
ctx->Const.MaxLineWidth);
imesa->LcsLineWidth = 0;
if (width & 1) imesa->LcsLineWidth |= LCS_LINEWIDTH_1_0;
@@ -396,7 +399,10 @@ static void i810LineWidth( GLcontext *ctx, GLfloat widthf )
static void i810PointSize( GLcontext *ctx, GLfloat sz )
{
i810ContextPtr imesa = I810_CONTEXT( ctx );
int size = (int)ctx->Point._Size;
/* AA, non-AA limits are same */
const int size = (int) CLAMP(ctx->Point.Size,
ctx->Const.MinPointSize,
ctx->Const.MaxPointSize);
imesa->LcsPointSize = 0;
if (size & 1) imesa->LcsPointSize |= LCS_LINEWIDTH_1_0;
+3 -1
View File
@@ -112,7 +112,9 @@ static __inline__ void i810_draw_quad( i810ContextPtr imesa,
static __inline__ void i810_draw_point( i810ContextPtr imesa,
i810VertexPtr tmp )
{
GLfloat sz = imesa->glCtx->Point._Size * .5;
GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size,
imesa->glCtx->Const.MinPointSize,
imesa->glCtx->Const.MaxPointSize);
int vertsize = imesa->vertex_size;
GLuint *vb = i810AllocDmaLow( imesa, 2 * 4 * vertsize );
int j;
+1
View File
@@ -64,6 +64,7 @@ static void i915_reduced_primitive_state( intelContextPtr intel,
st1 &= ~ST1_ENABLE;
switch (rprim) {
case GL_QUADS: /* from RASTERIZE(GL_QUADS) in t_dd_tritemp.h */
case GL_TRIANGLES:
if (intel->ctx.Polygon.StippleFlag &&
intel->hw_stipple)
+25 -3
View File
@@ -439,10 +439,32 @@ intelDrawPixels( GLcontext *ctx,
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s\n", __FUNCTION__);
if (!intelTryDrawPixels( ctx, x, y, width, height, format, type,
unpack, pixels ))
if (intelTryDrawPixels( ctx, x, y, width, height, format, type,
unpack, pixels ))
return;
if (ctx->FragmentProgram._Current == ctx->FragmentProgram._TexEnvProgram) {
/*
* We don't want the i915 texenv program to be applied to DrawPixels.
* This is really just a performance optimization (mesa will other-
* wise happily run the fragment program on each pixel in the image).
*/
struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current;
/* can't just set current frag prog to 0 here as on buffer resize
we'll get new state checks which will segfault. Remains a hack. */
ctx->FragmentProgram._Current = NULL;
ctx->FragmentProgram._UseTexEnvProgram = GL_FALSE;
ctx->FragmentProgram._Active = GL_FALSE;
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
unpack, pixels );
unpack, pixels );
ctx->FragmentProgram._Current = fpSave;
ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
ctx->FragmentProgram._Active = GL_TRUE;
}
else {
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
unpack, pixels );
}
}
+7 -5
View File
@@ -490,11 +490,13 @@ i830_emit_state(struct intel_context *intel)
DRM_BO_MASK_MEM | DRM_BO_FLAG_READ,
state->tex_offset[i] | TM0S0_USE_FENCE);
}
else {
assert(i == 0);
assert(state == &i830->meta);
OUT_BATCH(0);
}
else if (state == &i830->meta) {
assert(i == 0);
OUT_BATCH(0);
}
else {
OUT_BATCH(state->tex_offset[i]);
}
OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S1]);
OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S2]);
+1
View File
@@ -61,6 +61,7 @@ i915_reduced_primitive_state(struct intel_context *intel, GLenum rprim)
st1 &= ~ST1_ENABLE;
switch (rprim) {
case GL_QUADS: /* from RASTERIZE(GL_QUADS) in t_dd_tritemp.h */
case GL_TRIANGLES:
if (intel->ctx.Polygon.StippleFlag && intel->hw_stipple)
st1 |= ST1_ENABLE;
@@ -9,7 +9,7 @@ struct intel_context;
#define BATCH_SZ 16384
#define BATCH_RESERVED 16
#define MAX_RELOCS 400
#define MAX_RELOCS 4096
#define INTEL_BATCH_NO_CLIPRECTS 0x1
#define INTEL_BATCH_CLIPRECTS 0x2
+7 -3
View File
@@ -316,7 +316,8 @@ intelWindowMoved(struct intel_context *intel)
flags = intel_fb->vblank_flags & ~VBLANK_FLAG_SECONDARY;
}
if (flags != intel_fb->vblank_flags) {
if (flags != intel_fb->vblank_flags && intel_fb->vblank_flags &&
!(intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ)) {
drmVBlank vbl;
int i;
@@ -327,7 +328,9 @@ intelWindowMoved(struct intel_context *intel)
}
for (i = 0; i < intel_fb->pf_num_pages; i++) {
if (!intel_fb->color_rb[i])
if (!intel_fb->color_rb[i] ||
(intel_fb->vbl_waited - intel_fb->color_rb[i]->vbl_pending) <=
(1<<23))
continue;
vbl.request.sequence = intel_fb->color_rb[i]->vbl_pending;
@@ -828,7 +831,8 @@ intelScheduleSwap(const __DRIdrawablePrivate * dPriv, GLboolean *missed_target)
drm_i915_vblank_swap_t swap;
GLboolean ret;
if ((intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) ||
if (!intel_fb->vblank_flags ||
(intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) ||
intelScreen->current_rotation != 0 ||
intelScreen->drmMinor < (intel_fb->pf_active ? 9 : 6))
return GL_FALSE;
+30 -27
View File
@@ -619,12 +619,23 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
if (intel->ctx.DrawBuffer == &intel_fb->Base) {
if (intel->driDrawable != driDrawPriv) {
intel_fb->vblank_flags = (intel->intelScreen->irq_active != 0)
? driGetDefaultVBlankFlags(&intel->optionCache)
: VBLANK_FLAG_NO_IRQ;
(*dri_interface->getUST) (&intel_fb->swap_ust);
driDrawableInitVBlank(driDrawPriv, intel_fb->vblank_flags,
&intel_fb->vbl_seq);
if (driDrawPriv->pdraw->swap_interval == (unsigned)-1) {
int i;
intel_fb->vblank_flags = (intel->intelScreen->irq_active != 0)
? driGetDefaultVBlankFlags(&intel->optionCache)
: VBLANK_FLAG_NO_IRQ;
(*dri_interface->getUST) (&intel_fb->swap_ust);
driDrawableInitVBlank(driDrawPriv, intel_fb->vblank_flags,
&intel_fb->vbl_seq);
intel_fb->vbl_waited = intel_fb->vbl_seq;
for (i = 0; i < (intel->intelScreen->third.handle ? 3 : 2); i++) {
if (intel_fb->color_rb[i])
intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_seq;
}
}
intel->driDrawable = driDrawPriv;
intelWindowMoved(intel);
}
@@ -670,37 +681,27 @@ intelContendedLock(struct intel_context *intel, GLuint flags)
if (sarea->width != intel->width ||
sarea->height != intel->height ||
sarea->rotation != intel->current_rotation) {
void *batchMap = intel->batch->map;
int numClipRects = intel->numClipRects;
/*
* FIXME: Really only need to do this when drawing to a
* common back- or front buffer.
*/
/*
* This will drop the outstanding batchbuffer on the floor
* This will essentially drop the outstanding batchbuffer on the floor.
*/
intel->numClipRects = 0;
if (batchMap != NULL) {
driBOUnmap(intel->batch->buffer);
intel->batch->map = NULL;
}
if (intel->Fallback)
_swrast_flush(&intel->ctx);
intel_batchbuffer_reset(intel->batch);
INTEL_FIREVERTICES(intel);
if (batchMap == NULL) {
driBOUnmap(intel->batch->buffer);
intel->batch->map = NULL;
}
if (intel->batch->map != intel->batch->ptr)
intel_batchbuffer_flush(intel->batch);
/* lose all primitives */
intel->prim.primitive = ~0;
intel->prim.start_ptr = 0;
intel->prim.flush = 0;
/* re-emit all state */
intel->vtbl.lost_hardware(intel);
intel->numClipRects = numClipRects;
/* force window update */
intel->lastStamp = 0;
@@ -741,7 +742,9 @@ void LOCK_HARDWARE( struct intel_context *intel )
BUFFER_BACK_LEFT);
}
if (intel_rb && (intel_fb->vbl_waited - intel_rb->vbl_pending) > (1<<23)) {
if (intel_rb && intel_fb->vblank_flags &&
!(intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) &&
(intel_fb->vbl_waited - intel_rb->vbl_pending) > (1<<23)) {
drmVBlank vbl;
vbl.request.type = DRM_VBLANK_ABSOLUTE;
+1 -1
View File
@@ -488,7 +488,7 @@ intel_new_renderbuffer(GLcontext * ctx, GLuint name)
*/
static void
intel_bind_framebuffer(GLcontext * ctx, GLenum target,
struct gl_framebuffer *fb)
struct gl_framebuffer *fb, struct gl_framebuffer *fbread)
{
if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
intel_draw_buffer(ctx, fb);
@@ -363,5 +363,26 @@ intelDrawPixels(GLcontext * ctx,
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
_swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels);
if (ctx->FragmentProgram._Current == ctx->FragmentProgram._TexEnvProgram) {
/*
* We don't want the i915 texenv program to be applied to DrawPixels.
* This is really just a performance optimization (mesa will other-
* wise happily run the fragment program on each pixel in the image).
*/
struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current;
/* can't just set current frag prog to 0 here as on buffer resize
we'll get new state checks which will segfault. Remains a hack. */
ctx->FragmentProgram._Current = NULL;
ctx->FragmentProgram._UseTexEnvProgram = GL_FALSE;
ctx->FragmentProgram._Active = GL_FALSE;
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
unpack, pixels );
ctx->FragmentProgram._Current = fpSave;
ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
ctx->FragmentProgram._Active = GL_TRUE;
}
else {
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
unpack, pixels );
}
}
@@ -116,7 +116,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
/* We know/require this is true by now:
*/
assert(intelObj->base.Complete);
assert(intelObj->base._Complete);
/* What levels must the tree include at a minimum?
*/
+4 -2
View File
@@ -173,7 +173,8 @@ static void upload_sf_unit( struct brw_context *brw )
/* _NEW_LINE */
sf.sf6.line_width = brw->attribs.Line->_Width * (1<<1);
/* XXX use ctx->Const.Min/MaxLineWidth here */
sf.sf6.line_width = CLAMP(brw->attribs.Line->Width, 1.0, 5.0) * (1<<1);
sf.sf6.line_endcap_aa_region_width = 1;
if (brw->attribs.Line->SmoothFlag)
@@ -183,7 +184,8 @@ static void upload_sf_unit( struct brw_context *brw )
/* _NEW_POINT */
sf.sf6.point_rast_rule = 1; /* opengl conventions */
sf.sf7.point_size = brw->attribs.Point->_Size * (1<<3);
/* XXX clamp max depends on AA vs. non-AA */
sf.sf7.point_size = CLAMP(brw->attribs.Point->Size, 1.0, 3.0) * (1<<3);
sf.sf7.use_point_size_state = !brw->attribs.Point->_Attenuated;
/* might be BRW_NEW_PRIMITIVE if we have to adjust pv for polygons:
+5 -2
View File
@@ -532,12 +532,15 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel,
GLuint dst_offset,
GLboolean dst_tiled,
GLshort x, GLshort y,
GLshort w, GLshort h)
GLshort w, GLshort h,
GLenum logic_op)
{
struct xy_setup_blit setup;
struct xy_text_immediate_blit text;
int dwords = ((src_size + 7) & ~7) / 4;
assert( logic_op - GL_CLEAR >= 0 );
assert( logic_op - GL_CLEAR < 0x10 );
if (w < 0 || h < 0)
return;
@@ -561,7 +564,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel,
setup.br0.length = (sizeof(setup) / sizeof(int)) - 2;
setup.br13.dest_pitch = dst_pitch;
setup.br13.rop = 0xcc;
setup.br13.rop = translate_raster_op(logic_op);
setup.br13.color_depth = (cpp == 4) ? BR13_8888 : BR13_565;
setup.br13.clipping_enable = 0;
setup.br13.mono_source_transparency = 1;
+2 -1
View File
@@ -72,6 +72,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel,
GLuint dst_offset,
GLboolean dst_tiled,
GLshort dst_x, GLshort dst_y,
GLshort w, GLshort h);
GLshort w, GLshort h,
GLenum logic_op );
#endif
@@ -260,7 +260,9 @@ do_blit_bitmap( GLcontext *ctx,
int h = MIN2(DY, box_h - py);
int w = MIN2(DX, box_w - px);
GLuint sz = align(align(w,8) * h, 64)/8;
GLenum logic_op = ctx->Color.ColorLogicOpEnabled ?
ctx->Color.LogicOp : GL_COPY;
assert(sz <= sizeof(stipple));
memset(stipple, 0, sz);
@@ -288,7 +290,8 @@ do_blit_bitmap( GLcontext *ctx,
dst->tiled,
rect.x1 + px,
rect.y2 - (py + h),
w, h);
w, h,
logic_op);
}
}
}
@@ -138,7 +138,7 @@ GLuint intel_finalize_mipmap_tree( struct intel_context *intel,
/* We know/require this is true by now:
*/
assert(intelObj->base.Complete);
assert(intelObj->base._Complete);
/* What levels must the tree include at a minimum?
*/
@@ -103,7 +103,7 @@ void TAG(translate_vertex)(GLcontext *ctx,
assert( p + 1 - (CARD32 *)src == 10 );
dst->pointSize = ctx->Point._Size;
dst->pointSize = ctx->Point.Size;
}
+8 -5
View File
@@ -673,7 +673,10 @@ static __inline void mach64_draw_line( mach64ContextPtr mmesa,
#if MACH64_NATIVE_VTXFMT
GLcontext *ctx = mmesa->glCtx;
const GLuint vertsize = mmesa->vertex_size;
GLint width = (GLint)(mmesa->glCtx->Line._Width * 2.0); /* 2 fractional bits for hardware */
/* 2 fractional bits for hardware: */
const int width = (int) (2.0 * CLAMP(mmesa->glCtx->Line.Width,
mmesa->glCtx->Const.MinLineWidth,
mmesa->glCtx->Const.MaxLineWidth));
GLfloat ooa;
GLuint *pxy0, *pxy1;
GLuint xy0old, xy0, xy1old, xy1;
@@ -691,9 +694,6 @@ static __inline void mach64_draw_line( mach64ContextPtr mmesa,
mach64_print_vertex( ctx, v1 );
}
if( !width )
width = 1; /* round to the nearest supported width */
pxy0 = &v0->ui[xyoffset];
xy0old = *pxy0;
xy0 = LE32_IN( &xy0old );
@@ -961,7 +961,10 @@ static __inline void mach64_draw_point( mach64ContextPtr mmesa,
#if MACH64_NATIVE_VTXFMT
GLcontext *ctx = mmesa->glCtx;
const GLuint vertsize = mmesa->vertex_size;
GLint sz = (GLint)(mmesa->glCtx->Point._Size * 2.0); /* 2 fractional bits for hardware */
/* 2 fractional bits for hardware: */
GLint sz = (GLint) (2.0 * CLAMP(mmesa->glCtx->Point.Size,
ctx->Const.MinPointSize,
ctx->Const.MaxPointSize));
GLfloat ooa;
GLuint *pxy;
GLuint xyold, xy;
+7 -3
View File
@@ -104,8 +104,10 @@ static void __inline__ mga_draw_quad( mgaContextPtr mmesa,
static __inline__ void mga_draw_point( mgaContextPtr mmesa,
mgaVertexPtr tmp )
{
GLfloat sz = mmesa->glCtx->Point._Size * .5;
int vertex_size = mmesa->vertex_size;
const GLfloat sz = 0.5 * CLAMP(mmesa->glCtx->Point.Size,
mmesa->glCtx->Const.MinPointSize,
mmesa->glCtx->Const.MaxPointSize);
const int vertex_size = mmesa->vertex_size;
GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size );
int j;
@@ -165,7 +167,9 @@ static __inline__ void mga_draw_line( mgaContextPtr mmesa,
GLuint vertex_size = mmesa->vertex_size;
GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size );
GLfloat dx, dy, ix, iy;
GLfloat width = mmesa->glCtx->Line._Width;
const GLfloat width = CLAMP(mmesa->glCtx->Line.Width,
mmesa->glCtx->Const.MinLineWidth,
mmesa->glCtx->Const.MaxLineWidth);
GLint j;
#if 0
@@ -41,7 +41,7 @@ nouveau_bo_download_from_screen(GLcontext *ctx, GLuint offset, GLuint size,
DEBUG("..sys_mem\n");
in_mem = nouveau_mem_alloc(ctx, NOUVEAU_MEM_AGP, size, 0);
if (in_mem) {
DEBUG("....via AGP\n");
DEBUG("....via GART\n");
/* otherwise, try blitting to faster memory and
* copying from there
*/
@@ -86,7 +86,7 @@ nouveau_bo_upload_to_screen(GLcontext *ctx, GLuint offset, GLuint size,
NOUVEAU_MEM_MAPPED,
size, 0);
if (out_mem) {
DEBUG("....via AGP\n");
DEBUG("....via GART\n");
_mesa_memcpy(out_mem->map,
nbo->cpu_mem_sys + offset, size);
nouveau_memformat_flat_emit(ctx, nbo->gpu_mem, out_mem,
@@ -511,7 +511,7 @@ nouveauBufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
gpu_flags = 0;
break;
default:
gpu_flags = NOUVEAU_BO_VRAM_OK | NOUVEAU_BO_AGP_OK;
gpu_flags = NOUVEAU_BO_VRAM_OK | NOUVEAU_BO_GART_OK;
break;
}
nouveau_bo_init_storage(ctx, gpu_flags, size, data, usage, obj);
@@ -5,7 +5,7 @@
#include "nouveau_buffers.h"
#define NOUVEAU_BO_VRAM_OK (NOUVEAU_MEM_FB | NOUVEAU_MEM_FB_ACCEPTABLE)
#define NOUVEAU_BO_AGP_OK (NOUVEAU_MEM_AGP | NOUVEAU_MEM_AGP_ACCEPTABLE)
#define NOUVEAU_BO_GART_OK (NOUVEAU_MEM_AGP | NOUVEAU_MEM_AGP_ACCEPTABLE)
typedef struct nouveau_bufferobj_region_t {
uint32_t start;
+18 -16
View File
@@ -32,8 +32,8 @@ nouveau_memformat_flat_emit(GLcontext *ctx,
return GL_FALSE;
}
src_handle = (src->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaAGP;
dst_handle = (dst->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaAGP;
src_handle = (src->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaTT;
dst_handle = (dst->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaTT;
src_offset += nouveau_mem_gpu_offset_get(ctx, src);
dst_offset += nouveau_mem_gpu_offset_get(ctx, dst);
@@ -69,7 +69,7 @@ void
nouveau_mem_free(GLcontext *ctx, nouveau_mem *mem)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
drm_nouveau_mem_free_t memf;
struct drm_nouveau_mem_free memf;
if (NOUVEAU_DEBUG & DEBUG_MEM) {
fprintf(stderr, "%s: type=0x%x, offset=0x%x, size=0x%x\n",
@@ -78,8 +78,8 @@ nouveau_mem_free(GLcontext *ctx, nouveau_mem *mem)
if (mem->map)
drmUnmap(mem->map, mem->size);
memf.flags = mem->type;
memf.region_offset = mem->offset;
memf.flags = mem->type;
memf.offset = mem->offset;
drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_MEM_FREE, &memf, sizeof(memf));
FREE(mem);
}
@@ -88,7 +88,7 @@ nouveau_mem *
nouveau_mem_alloc(GLcontext *ctx, int type, GLuint size, GLuint align)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
drm_nouveau_mem_alloc_t mema;
struct drm_nouveau_mem_alloc mema;
nouveau_mem *mem;
int ret;
@@ -111,7 +111,7 @@ nouveau_mem_alloc(GLcontext *ctx, int type, GLuint size, GLuint align)
FREE(mem);
return NULL;
}
mem->offset = mema.region_offset;
mem->offset = mema.offset;
mem->type = mema.flags;
if (NOUVEAU_DEBUG & DEBUG_MEM) {
@@ -120,7 +120,7 @@ nouveau_mem_alloc(GLcontext *ctx, int type, GLuint size, GLuint align)
}
if (type & NOUVEAU_MEM_MAPPED)
ret = drmMap(nmesa->driFd, mem->offset, mem->size, &mem->map);
ret = drmMap(nmesa->driFd, mema.map_handle, mem->size, &mem->map);
if (ret) {
mem->map = NULL;
nouveau_mem_free(ctx, mem);
@@ -135,12 +135,7 @@ nouveau_mem_gpu_offset_get(GLcontext *ctx, nouveau_mem *mem)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
if (mem->type & NOUVEAU_MEM_FB)
return (uint32_t)mem->offset - nmesa->vram_phys;
else if (mem->type & NOUVEAU_MEM_AGP)
return (uint32_t)mem->offset - nmesa->agp_phys;
else
return 0xDEADF00D;
return mem->offset;
}
static GLboolean
@@ -299,6 +294,8 @@ nouveau_cliprects_drawable_set(nouveauContextPtr nmesa,
nmesa->pClipRects = dPriv->pClipRects;
nmesa->drawX = dPriv->x;
nmesa->drawY = dPriv->y;
nmesa->drawW = dPriv->w;
nmesa->drawH = dPriv->h;
}
static void
@@ -313,6 +310,8 @@ nouveau_cliprects_renderbuffer_set(nouveauContextPtr nmesa,
nmesa->osClipRect.y2 = nrb->mesa.Height;
nmesa->drawX = 0;
nmesa->drawY = 0;
nmesa->drawW = nrb->mesa.Width;
nmesa->drawH = nrb->mesa.Height;
}
void
@@ -391,9 +390,12 @@ nouveauNewRenderbuffer(GLcontext *ctx, GLuint name)
}
static void
nouveauBindFramebuffer(GLcontext *ctx, GLenum target, struct gl_framebuffer *fb)
nouveauBindFramebuffer(GLcontext *ctx, GLenum target,
struct gl_framebuffer *fb, struct gl_framebuffer *fbread)
{
nouveau_build_framebuffer(ctx, fb);
if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
nouveau_build_framebuffer(ctx, fb);
}
}
static void
@@ -145,10 +145,10 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
&nmesa->vram_size))
return GL_FALSE;
if (!nouveauDRMGetParam(nmesa, NOUVEAU_GETPARAM_AGP_PHYSICAL,
&nmesa->agp_phys))
&nmesa->gart_phys))
return GL_FALSE;
if (!nouveauDRMGetParam(nmesa, NOUVEAU_GETPARAM_AGP_SIZE,
&nmesa->agp_size))
&nmesa->gart_size))
return GL_FALSE;
if (!nouveauFifoInit(nmesa))
return GL_FALSE;
@@ -180,7 +180,7 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
driParseConfigFiles (&nmesa->optionCache, &screen->optionCache,
screen->driScreen->myNum, "nouveau");
nmesa->sarea = (drm_nouveau_sarea_t *)((char *)sPriv->pSAREA +
nmesa->sarea = (struct drm_nouveau_sarea *)((char *)sPriv->pSAREA +
screen->sarea_priv_offset);
/* Enable any supported extensions */
@@ -224,6 +224,8 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
nv04TriInitFunctions( ctx );
break;
case NV_10:
case NV_11:
case NV_17:
case NV_20:
case NV_30:
case NV_40:
@@ -99,19 +99,22 @@ typedef struct nouveau_context {
/* The read-only regs */
volatile unsigned char* mmio;
/* The per-channel notifier block */
volatile void *notifier_block;
/* Physical addresses of AGP/VRAM apertures */
uint64_t vram_phys;
uint64_t vram_size;
uint64_t agp_phys;
uint64_t agp_size;
uint64_t gart_phys;
uint64_t gart_size;
/* Channel synchronisation */
nouveau_notifier *syncNotifier;
struct drm_nouveau_notifier_alloc *syncNotifier;
/* ARB_occlusion_query / EXT_timer_query */
GLuint query_object_max;
GLboolean * query_alloc;
nouveau_notifier *queryNotifier;
struct drm_nouveau_notifier_alloc *queryNotifier;
/* Additional hw-specific functions */
nouveau_hw_func hw_func;
@@ -150,7 +153,7 @@ typedef struct nouveau_context {
GLuint numClipRects;
drm_clip_rect_t *pClipRects;
drm_clip_rect_t osClipRect;
GLuint drawX, drawY;
GLuint drawX, drawY, drawW, drawH;
/* The rendering context information */
GLenum current_primitive; /* the current primitive enum */
@@ -165,7 +168,7 @@ typedef struct nouveau_context {
nouveauShader *passthrough_fp;
nouveauScreenRec *screen;
drm_nouveau_sarea_t *sarea;
struct drm_nouveau_sarea *sarea;
__DRIcontextPrivate *driContext; /* DRI context */
__DRIscreenPrivate *driScreen; /* DRI screen */
@@ -41,7 +41,7 @@ GLboolean nouveauDRMGetParam(nouveauContextPtr nmesa,
unsigned int param,
uint64_t* value)
{
drm_nouveau_getparam_t getp;
struct drm_nouveau_getparam getp;
getp.param = param;
if (!value || drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_GETPARAM,
@@ -56,7 +56,7 @@ GLboolean nouveauDRMSetParam(nouveauContextPtr nmesa,
unsigned int param,
uint64_t value)
{
drm_nouveau_setparam_t setp;
struct drm_nouveau_setparam setp;
setp.param = param;
setp.value = value;
+13 -3
View File
@@ -98,14 +98,15 @@ void nouveauWaitForIdle(nouveauContextPtr nmesa)
// here we call the fifo initialization ioctl and fill in stuff accordingly
GLboolean nouveauFifoInit(nouveauContextPtr nmesa)
{
drm_nouveau_fifo_alloc_t fifo_init;
int i;
struct drm_nouveau_fifo_alloc fifo_init;
int i, ret;
#ifdef NOUVEAU_RING_DEBUG
return GL_TRUE;
#endif
int ret;
fifo_init.fb_ctxdma_handle = NvDmaFB;
fifo_init.tt_ctxdma_handle = NvDmaTT;
ret=drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_FIFO_ALLOC, &fifo_init, sizeof(fifo_init));
if (ret) {
FATAL("Fifo initialization ioctl failed (returned %d)\n",ret);
@@ -117,12 +118,21 @@ GLboolean nouveauFifoInit(nouveauContextPtr nmesa)
FATAL("Unable to map the fifo (returned %d)\n",ret);
return GL_FALSE;
}
ret = drmMap(nmesa->driFd, fifo_init.ctrl, fifo_init.ctrl_size, &nmesa->fifo.mmio);
if (ret) {
FATAL("Unable to map the control regs (returned %d)\n",ret);
return GL_FALSE;
}
ret = drmMap(nmesa->driFd, fifo_init.notifier,
fifo_init.notifier_size,
&nmesa->notifier_block);
if (ret) {
FATAL("Unable to map the notifier block (returned %d)\n",ret);
return GL_FALSE;
}
/* Setup our initial FIFO tracking params */
nmesa->fifo.channel = fifo_init.channel;
nmesa->fifo.put_base = fifo_init.put_base;
+1 -1
View File
@@ -44,7 +44,7 @@ void nouveauGetLock( nouveauContextPtr nmesa, GLuint flags )
{
__DRIdrawablePrivate *dPriv = nmesa->driDrawable;
__DRIscreenPrivate *sPriv = nmesa->driScreen;
drm_nouveau_sarea_t *sarea = nmesa->sarea;
struct drm_nouveau_sarea *sarea = nmesa->sarea;
drmGetLock( nmesa->driFd, nmesa->hHWContext, flags );
+7 -57
View File
@@ -7,61 +7,18 @@
GLboolean nouveauCreateContextObject(nouveauContextPtr nmesa,
uint32_t handle, int class)
{
drm_nouveau_object_init_t cto;
struct drm_nouveau_grobj_alloc cto;
int ret;
cto.channel = nmesa->fifo.channel;
cto.handle = handle;
cto.class = class;
ret = drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_OBJECT_INIT, &cto, sizeof(cto));
ret = drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_GROBJ_ALLOC,
&cto, sizeof(cto));
return ret == 0;
}
GLboolean nouveauCreateDmaObject(nouveauContextPtr nmesa,
uint32_t handle,
int class,
uint32_t offset,
uint32_t size,
int target,
int access)
{
drm_nouveau_dma_object_init_t dma;
int ret;
dma.channel = nmesa->fifo.channel;
dma.class = class;
dma.handle = handle;
dma.target = target;
dma.access = access;
dma.offset = offset;
dma.size = size;
ret = drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_DMA_OBJECT_INIT,
&dma, sizeof(dma));
return ret == 0;
}
GLboolean nouveauCreateDmaObjectFromMem(nouveauContextPtr nmesa,
uint32_t handle, int class,
nouveau_mem *mem,
int access)
{
uint32_t offset = mem->offset;
int target = mem->type & (NOUVEAU_MEM_FB | NOUVEAU_MEM_AGP);
if (!target)
return GL_FALSE;
if (target & NOUVEAU_MEM_FB)
offset -= nmesa->vram_phys;
else if (target & NOUVEAU_MEM_AGP)
offset -= nmesa->agp_phys;
return nouveauCreateDmaObject(nmesa, handle, class,
offset, mem->size,
target, access);
}
void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int subchannel, int handle)
{
BEGIN_RING_SIZE(subchannel, 0, 1);
@@ -74,23 +31,16 @@ void nouveauObjectInit(nouveauContextPtr nmesa)
return;
#endif
/* We need to know vram size.. and AGP size (and even if the card is AGP..) */
nouveauCreateDmaObject( nmesa, NvDmaFB, NV_DMA_IN_MEMORY,
0, nmesa->vram_size,
NOUVEAU_MEM_FB,
NOUVEAU_MEM_ACCESS_RW);
nouveauCreateDmaObject( nmesa, NvDmaAGP, NV_DMA_IN_MEMORY,
0, nmesa->agp_size,
NOUVEAU_MEM_AGP,
NOUVEAU_MEM_ACCESS_RW);
nouveauCreateContextObject(nmesa, Nv3D, nmesa->screen->card->class_3d);
if (nmesa->screen->card->type>=NV_10) {
nouveauCreateContextObject(nmesa, NvCtxSurf2D, NV10_CONTEXT_SURFACES_2D);
nouveauCreateContextObject(nmesa, NvImageBlit, NV10_IMAGE_BLIT);
} else {
nouveauCreateContextObject(nmesa, NvCtxSurf2D, NV04_CONTEXT_SURFACES_2D);
nouveauCreateContextObject(nmesa, NvCtxSurf3D, NV04_CONTEXT_SURFACES_3D);
}
if (nmesa->screen->card->type>=NV_11) {
nouveauCreateContextObject(nmesa, NvImageBlit, NV10_IMAGE_BLIT);
} else {
nouveauCreateContextObject(nmesa, NvImageBlit, NV_IMAGE_BLIT);
}
nouveauCreateContextObject(nmesa, NvMemFormat, NV_MEMORY_TO_MEMORY_FORMAT);
+1 -13
View File
@@ -14,7 +14,7 @@ enum DMAObjects {
NvMemFormat = 0x80000022,
NvCtxSurf3D = 0x80000023,
NvDmaFB = 0xD0FB0001,
NvDmaAGP = 0xD0AA0001,
NvDmaTT = 0xD0AA0001,
NvSyncNotify = 0xD0000001,
NvQueryNotify = 0xD0000002
};
@@ -31,17 +31,5 @@ extern void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int subchannel, i
extern GLboolean nouveauCreateContextObject(nouveauContextPtr nmesa,
uint32_t handle, int class);
extern GLboolean nouveauCreateDmaObject(nouveauContextPtr nmesa,
uint32_t handle,
int class,
uint32_t offset,
uint32_t size,
int target,
int access);
extern GLboolean nouveauCreateDmaObjectFromMem(nouveauContextPtr nmesa,
uint32_t handle,
int class,
nouveau_mem *mem,
int access);
#endif
+5 -4
View File
@@ -68,7 +68,7 @@ nouveauBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
nouveau_query_object *nq = (nouveau_query_object *)q;
nouveau_notifier_reset(nmesa->queryNotifier, nq->notifier_id);
nouveau_notifier_reset(ctx, nmesa->queryNotifier, nq->notifier_id);
switch (nmesa->screen->card->type) {
case NV_20:
@@ -105,12 +105,13 @@ nouveauUpdateQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
nouveau_query_object *nq = (nouveau_query_object *)q;
int status;
status = nouveau_notifier_status(nmesa->queryNotifier,
status = nouveau_notifier_status(ctx, nmesa->queryNotifier,
nq->notifier_id);
q->Ready = (status == NV_NOTIFY_STATE_STATUS_COMPLETED);
if (q->Ready)
q->Result = nouveau_notifier_return_val(nmesa->queryNotifier,
q->Result = nouveau_notifier_return_val(ctx,
nmesa->queryNotifier,
nq->notifier_id);
}
@@ -120,7 +121,7 @@ nouveauWaitQueryResult(GLcontext *ctx, GLenum target, struct gl_query_object *q)
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
nouveau_query_object *nq = (nouveau_query_object *)q;
nouveau_notifier_wait_status(nmesa->queryNotifier, nq->notifier_id,
nouveau_notifier_wait_status(ctx, nmesa->queryNotifier, nq->notifier_id,
NV_NOTIFY_STATE_STATUS_COMPLETED, 0);
nouveauUpdateQuery(ctx, target, q);
}
@@ -328,7 +328,7 @@ void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIsc
static const __DRIversion ddx_expected = { 1, 2, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 0, 0, NOUVEAU_DRM_HEADER_PATCHLEVEL };
#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 6
#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 9
#error nouveau_drm.h version doesn't match expected version
#endif
dri_interface = interface;
+4 -1
View File
@@ -37,6 +37,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define HAVE_HW_STENCIL_SPANS 0
#define HAVE_HW_STENCIL_PIXELS 0
static char *fake_span[1280*1024*4];
#define HW_CLIPLOOP() \
do { \
int _nc = nmesa->numClipRects; \
@@ -52,6 +54,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
GLuint height = nrb->mesa.Height; \
GLubyte *map = (GLubyte *)(nrb->map ? nrb->map : nrb->mem->map) + \
(nmesa->drawY * nrb->pitch) + (nmesa->drawX * nrb->cpp); \
map = fake_span; \
GLuint p; \
(void) p;
@@ -120,6 +123,6 @@ nouveauSpanSetFunctions(nouveau_renderbuffer *nrb, const GLvisual *vis)
{
if (nrb->mesa._ActualFormat == GL_RGBA8)
nouveauInitPointers_ARGB8888(&nrb->mesa);
else if (nrb->mesa._ActualFormat == GL_RGB5)
else // if (nrb->mesa._ActualFormat == GL_RGB5)
nouveauInitPointers_RGB565(&nrb->mesa);
}
+4 -2
View File
@@ -60,14 +60,14 @@ static void nouveauCalcViewport(GLcontext *ctx)
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
const GLfloat *v = ctx->Viewport._WindowMap.m;
GLfloat *m = nmesa->viewport.m;
GLfloat xoffset = nmesa->drawX, yoffset = nmesa->drawY;
GLfloat xoffset = nmesa->drawX, yoffset = nmesa->drawY + nmesa->drawH;
nmesa->depth_scale = 1.0 / ctx->DrawBuffer->_DepthMaxF;
m[MAT_SX] = v[MAT_SX];
m[MAT_TX] = v[MAT_TX] + xoffset + SUBPIXEL_X;
m[MAT_SY] = - v[MAT_SY];
m[MAT_TY] = v[MAT_TY] + yoffset + SUBPIXEL_Y;
m[MAT_TY] = (-v[MAT_TY]) + yoffset + SUBPIXEL_Y;
m[MAT_SZ] = v[MAT_SZ] * nmesa->depth_scale;
m[MAT_TZ] = v[MAT_TZ] * nmesa->depth_scale;
@@ -162,6 +162,8 @@ void nouveauDDInitState(nouveauContextPtr nmesa)
nv04InitStateFuncs(nmesa->glCtx, &nmesa->glCtx->Driver);
break;
case NV_10:
case NV_11:
case NV_17:
nv10InitStateFuncs(nmesa->glCtx, &nmesa->glCtx->Driver);
break;
case NV_20:
+40 -34
View File
@@ -35,53 +35,53 @@
#include "nouveau_msg.h"
#include "nouveau_sync.h"
nouveau_notifier *
#define NOTIFIER(__v) \
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); \
volatile uint32_t *__v = (void*)nmesa->notifier_block + notifier->offset
struct drm_nouveau_notifier_alloc *
nouveau_notifier_new(GLcontext *ctx, GLuint handle, GLuint count)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
nouveau_notifier *notifier;
struct drm_nouveau_notifier_alloc *notifier;
int ret;
#ifdef NOUVEAU_RING_DEBUG
return NULL;
#endif
notifier = CALLOC_STRUCT(nouveau_notifier_t);
notifier = CALLOC_STRUCT(drm_nouveau_notifier_alloc);
if (!notifier)
return NULL;
notifier->mem = nouveau_mem_alloc(ctx,
NOUVEAU_MEM_FB | NOUVEAU_MEM_MAPPED,
count * NV_NOTIFIER_SIZE,
0);
if (!notifier->mem) {
notifier->channel = nmesa->fifo.channel;
notifier->handle = handle;
notifier->count = count;
ret = drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_NOTIFIER_ALLOC,
notifier, sizeof(*notifier));
if (ret) {
MESSAGE("Failed to create notifier 0x%08x: %d\n", handle, ret);
FREE(notifier);
return NULL;
}
if (!nouveauCreateDmaObjectFromMem(nmesa, handle, NV_DMA_IN_MEMORY,
notifier->mem,
NOUVEAU_MEM_ACCESS_RW)) {
nouveau_mem_free(ctx, notifier->mem);
FREE(notifier);
return NULL;
}
notifier->handle = handle;
return notifier;
}
void
nouveau_notifier_destroy(GLcontext *ctx, nouveau_notifier *notifier)
nouveau_notifier_destroy(GLcontext *ctx,
struct drm_nouveau_notifier_alloc *notifier)
{
/*XXX: free DMA object.. */
nouveau_mem_free(ctx, notifier->mem);
/*XXX: free notifier object.. */
FREE(notifier);
}
void
nouveau_notifier_reset(nouveau_notifier *notifier, GLuint id)
nouveau_notifier_reset(GLcontext *ctx,
struct drm_nouveau_notifier_alloc *notifier,
GLuint id)
{
volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE);
NOTIFIER(n);
#ifdef NOUVEAU_RING_DEBUG
return;
@@ -95,26 +95,31 @@ nouveau_notifier_reset(nouveau_notifier *notifier, GLuint id)
}
GLuint
nouveau_notifier_status(nouveau_notifier *notifier, GLuint id)
nouveau_notifier_status(GLcontext *ctx,
struct drm_nouveau_notifier_alloc *notifier,
GLuint id)
{
volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE);
NOTIFIER(n);
return n[NV_NOTIFY_STATE/4] >> NV_NOTIFY_STATE_STATUS_SHIFT;
}
GLuint
nouveau_notifier_return_val(nouveau_notifier *notifier, GLuint id)
nouveau_notifier_return_val(GLcontext *ctx,
struct drm_nouveau_notifier_alloc *notifier,
GLuint id)
{
volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE);
NOTIFIER(n);
return n[NV_NOTIFY_RETURN_VALUE/4];
}
GLboolean
nouveau_notifier_wait_status(nouveau_notifier *notifier, GLuint id,
GLuint status, GLuint timeout)
nouveau_notifier_wait_status(GLcontext *ctx,
struct drm_nouveau_notifier_alloc *notifier,
GLuint id, GLuint status, GLuint timeout)
{
volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE);
NOTIFIER(n);
unsigned int time = 0;
#ifdef NOUVEAU_RING_DEBUG
@@ -144,13 +149,14 @@ nouveau_notifier_wait_status(nouveau_notifier *notifier, GLuint id,
}
void
nouveau_notifier_wait_nop(GLcontext *ctx, nouveau_notifier *notifier,
GLuint subc)
nouveau_notifier_wait_nop(GLcontext *ctx,
struct drm_nouveau_notifier_alloc *notifier,
GLuint subc)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
NOTIFIER(n);
GLboolean ret;
nouveau_notifier_reset(notifier, 0);
nouveau_notifier_reset(ctx, notifier, 0);
BEGIN_RING_SIZE(subc, NV_NOTIFY, 1);
OUT_RING (NV_NOTIFY_STYLE_WRITE_ONLY);
@@ -158,7 +164,7 @@ nouveau_notifier_wait_nop(GLcontext *ctx, nouveau_notifier *notifier,
OUT_RING (0);
FIRE_RING();
ret = nouveau_notifier_wait_status(notifier, 0,
ret = nouveau_notifier_wait_status(ctx, notifier, 0,
NV_NOTIFY_STATE_STATUS_COMPLETED,
0 /* no timeout */);
if (ret == GL_FALSE) MESSAGE("wait on notifier failed\n");
+19 -15
View File
@@ -47,21 +47,25 @@
#define NV_NOTIFY 0x00000104
#define NV_NOTIFY_STYLE_WRITE_ONLY 0
typedef struct nouveau_notifier_t {
GLuint handle;
nouveau_mem *mem;
} nouveau_notifier;
extern nouveau_notifier *nouveau_notifier_new(GLcontext *, GLuint handle,
GLuint count);
extern void nouveau_notifier_destroy(GLcontext *, nouveau_notifier *);
extern void nouveau_notifier_reset(nouveau_notifier *, GLuint id);
extern GLuint nouveau_notifier_status(nouveau_notifier *, GLuint id);
extern GLuint nouveau_notifier_return_val(nouveau_notifier *, GLuint id);
extern GLboolean nouveau_notifier_wait_status(nouveau_notifier *r, GLuint id,
GLuint status, GLuint timeout);
extern void nouveau_notifier_wait_nop(GLcontext *ctx,
nouveau_notifier *, GLuint subc);
extern struct drm_nouveau_notifier_alloc *
nouveau_notifier_new(GLcontext *, GLuint handle, GLuint count);
extern void
nouveau_notifier_destroy(GLcontext *, struct drm_nouveau_notifier_alloc *);
extern void
nouveau_notifier_reset(GLcontext *, struct drm_nouveau_notifier_alloc *,
GLuint id);
extern GLuint
nouveau_notifier_status(GLcontext *, struct drm_nouveau_notifier_alloc *,
GLuint id);
extern GLuint
nouveau_notifier_return_val(GLcontext *, struct drm_nouveau_notifier_alloc *,
GLuint id);
extern GLboolean
nouveau_notifier_wait_status(GLcontext *, struct drm_nouveau_notifier_alloc *,
GLuint id, GLuint status, GLuint timeout);
extern void
nouveau_notifier_wait_nop(GLcontext *ctx, struct drm_nouveau_notifier_alloc *,
GLuint subc);
extern GLboolean nouveauSyncInitFuncs(GLcontext *ctx);
#endif
+3 -4
View File
@@ -697,8 +697,7 @@ static GLboolean nv10InitCard(nouveauContextPtr nmesa)
BEGIN_RING_SIZE(NvSub3D, 0x03f4, 1);
OUT_RING(0);
/* not for nv10, only for >= nv11 */
if ((nmesa->screen->card->id>>4) >= 0x11) {
if (nmesa->screen->card->type >= NV_11) {
BEGIN_RING_SIZE(NvSub3D, 0x120, 3);
OUT_RING(0);
OUT_RING(1);
@@ -739,11 +738,11 @@ static GLboolean nv10BindBuffers(nouveauContextPtr nmesa, int num_color,
OUT_RING_CACHE(depth ? depth->offset : color[0]->offset);
/* Always set to bottom left of buffer */
BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_X, 4);
/*BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_X, 4);
OUT_RING_CACHEf (0.0);
OUT_RING_CACHEf ((GLfloat) h);
OUT_RING_CACHEf (0.0);
OUT_RING_CACHEf (0.0);
OUT_RING_CACHEf (0.0);*/
return GL_TRUE;
}
+18 -35
View File
@@ -58,7 +58,7 @@ static void nv10ResetLineStipple( GLcontext *ctx );
static inline void nv10StartPrimitive(struct nouveau_context* nmesa,uint32_t primitive,uint32_t size)
{
if (nmesa->screen->card->type==NV_10)
if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<=NV_17))
BEGIN_RING_SIZE(NvSub3D,NV10_TCL_PRIMITIVE_3D_BEGIN_END,1);
else if (nmesa->screen->card->type==NV_20)
BEGIN_RING_SIZE(NvSub3D,NV20_TCL_PRIMITIVE_3D_BEGIN_END,1);
@@ -66,7 +66,7 @@ static inline void nv10StartPrimitive(struct nouveau_context* nmesa,uint32_t pri
BEGIN_RING_SIZE(NvSub3D,NV30_TCL_PRIMITIVE_3D_BEGIN_END,1);
OUT_RING(primitive);
if (nmesa->screen->card->type==NV_10)
if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<=NV_17))
BEGIN_RING_SIZE(NvSub3D,NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_DATA|NONINC_METHOD,size);
else if (nmesa->screen->card->type==NV_20)
BEGIN_RING_SIZE(NvSub3D,NV20_TCL_PRIMITIVE_3D_VERTEX_DATA|NONINC_METHOD,size);
@@ -76,7 +76,7 @@ static inline void nv10StartPrimitive(struct nouveau_context* nmesa,uint32_t pri
inline void nv10FinishPrimitive(struct nouveau_context *nmesa)
{
if (nmesa->screen->card->type==NV_10)
if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<=NV_17))
BEGIN_RING_SIZE(NvSub3D,NV10_TCL_PRIMITIVE_3D_BEGIN_END,1);
else if (nmesa->screen->card->type==NV_20)
BEGIN_RING_SIZE(NvSub3D,NV20_TCL_PRIMITIVE_3D_BEGIN_END,1);
@@ -392,15 +392,6 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa)
int i;
int slots=0;
int total_size=0;
/* t_vertex_generic dereferences a NULL pointer if we
* pass NULL as the vp transform...
*/
const GLfloat ident_vp[16] = {
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0
};
nmesa->vertex_attr_count = 0;
RENDERINPUTS_COPY(index, nmesa->render_inputs_bitset);
@@ -431,28 +422,20 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa)
if (RENDERINPUTS_TEST(index, i))
{
slots=i+1;
if (i==_TNL_ATTRIB_POS)
switch(attr_size[i])
{
/* special-case POS */
EMIT_ATTR(_TNL_ATTRIB_POS,EMIT_3F_VIEWPORT);
}
else
{
switch(attr_size[i])
{
case 1:
EMIT_ATTR(i,EMIT_1F);
break;
case 2:
EMIT_ATTR(i,EMIT_2F);
break;
case 3:
EMIT_ATTR(i,EMIT_3F);
break;
case 4:
EMIT_ATTR(i,EMIT_4F);
break;
}
case 1:
EMIT_ATTR(i,EMIT_1F);
break;
case 2:
EMIT_ATTR(i,EMIT_2F);
break;
case 3:
EMIT_ATTR(i,EMIT_3F);
break;
case 4:
EMIT_ATTR(i,EMIT_4F);
break;
}
if (i==_TNL_ATTRIB_COLOR0)
nmesa->color_offset=total_size;
@@ -465,13 +448,13 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa)
nmesa->vertex_size=_tnl_install_attrs( ctx,
nmesa->vertex_attrs,
nmesa->vertex_attr_count,
ident_vp, 0 );
NULL, 0 );
assert(nmesa->vertex_size==total_size*4);
/*
* Tell the hardware about the vertex format
*/
if (nmesa->screen->card->type==NV_10) {
if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<=NV_17)) {
int size;
#define NV_VERTEX_ATTRIBUTE_TYPE_FLOAT 2
+4 -4
View File
@@ -568,10 +568,10 @@ static void nv20Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
y += nmesa->drawY;
}
BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_SCISSOR_X2_X1, 1);
/*BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_SCISSOR_X2_X1, 1);
OUT_RING_CACHE((w << 16) | x );
BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_SCISSOR_Y2_Y1, 1);
OUT_RING_CACHE((h << 16) | y );
OUT_RING_CACHE((h << 16) | y );*/
}
@@ -764,11 +764,11 @@ static GLboolean nv20BindBuffers(nouveauContextPtr nmesa, int num_color,
}
/* Always set to bottom left of buffer */
BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_X, 4);
/*BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_X, 4);
OUT_RING_CACHEf (0.0);
OUT_RING_CACHEf ((GLfloat) h);
OUT_RING_CACHEf (0.0);
OUT_RING_CACHEf (0.0);
OUT_RING_CACHEf (0.0);*/
return GL_TRUE;
}
+37 -15
View File
@@ -639,25 +639,45 @@ void (*ReadBuffer)( GLcontext *ctx, GLenum buffer );
/** Set rasterization mode */
void (*RenderMode)(GLcontext *ctx, GLenum mode );
/* Translate GL coords to window coords, clamping w/h to the
* dimensions of the window.
*/
static void nv30WindowCoords(nouveauContextPtr nmesa,
GLuint x, GLuint y, GLuint w, GLuint h,
GLuint *wX, GLuint *wY, GLuint *wW, GLuint *wH)
{
if ((x+w) > nmesa->drawW)
w = nmesa->drawW - x;
(*wX) = x + nmesa->drawX;
(*wW) = w;
if ((y+h) > nmesa->drawH)
h = nmesa->drawH - y;
(*wY) = (nmesa->drawH - y) - h + nmesa->drawY;
(*wH) = h;
}
/** Define the scissor box */
static void nv30Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
GLuint wX, wY, wW, wH;
/* There's no scissor enable bit, so adjust the scissor to cover the
* maximum draw buffer bounds
*/
if (!ctx->Scissor.Enabled) {
x = y = 0;
w = h = 4095;
wX = nmesa->drawX;
wY = nmesa->drawY;
wW = nmesa->drawW;
wH = nmesa->drawH;
} else {
x += nmesa->drawX;
y += nmesa->drawY;
nv30WindowCoords(nmesa, x, y, w, h, &wX, &wY, &wW, &wH);
}
BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SCISSOR_WIDTH_XPOS, 2);
OUT_RING_CACHE(((w) << 16) | x);
OUT_RING_CACHE(((h) << 16) | y);
OUT_RING_CACHE ((wW << 16) | wX);
OUT_RING_CACHE ((wH << 16) | wY);
}
/** Select flat or smooth shading */
@@ -751,19 +771,21 @@ static void nv30WindowMoved(nouveauContextPtr nmesa)
{
GLcontext *ctx = nmesa->glCtx;
GLfloat *v = nmesa->viewport.m;
GLuint w = ctx->Viewport.Width;
GLuint h = ctx->Viewport.Height;
GLuint x = ctx->Viewport.X + nmesa->drawX;
GLuint y = ctx->Viewport.Y + nmesa->drawY;
GLuint wX, wY, wW, wH;
nv30WindowCoords(nmesa, ctx->Viewport.X, ctx->Viewport.Y,
ctx->Viewport.Width, ctx->Viewport.Height,
&wX, &wY, &wW, &wH);
BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_DIMS_0, 2);
OUT_RING_CACHE((w << 16) | x);
OUT_RING_CACHE((h << 16) | y);
OUT_RING_CACHE ((wW << 16) | wX);
OUT_RING_CACHE ((wH << 16) | wY);
/* something to do with clears, possibly doesn't belong here */
BEGIN_RING_CACHE(NvSub3D,
NV30_TCL_PRIMITIVE_3D_VIEWPORT_COLOR_BUFFER_OFS0, 2);
OUT_RING_CACHE(((w+x) << 16) | x);
OUT_RING_CACHE(((h+y) << 16) | y);
OUT_RING_CACHE(((nmesa->drawX + nmesa->drawW) << 16) | nmesa->drawX);
OUT_RING_CACHE(((nmesa->drawY + nmesa->drawH) << 16) | nmesa->drawY);
/* viewport transform */
BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_OX, 8);
OUT_RING_CACHEf (v[MAT_TX]);
@@ -786,7 +808,7 @@ static GLboolean nv30InitCard(nouveauContextPtr nmesa)
BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SET_OBJECT1, 3);
OUT_RING(NvDmaFB);
OUT_RING(NvDmaAGP);
OUT_RING(NvDmaTT);
OUT_RING(NvDmaFB);
BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SET_OBJECT8, 1);
OUT_RING(NvDmaFB);
+3 -1
View File
@@ -772,9 +772,11 @@ static void r200LineWidth( GLcontext *ctx, GLfloat widthf )
R200_STATECHANGE( rmesa, set );
/* Line width is stored in U6.4 format.
* Same min/max limits for AA, non-AA lines.
*/
rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] &= ~0xffff;
rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] |= (GLuint)(ctx->Line._Width * 16.0);
rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] |= (GLuint)
(CLAMP(widthf, ctx->Const.MinLineWidth, ctx->Const.MaxLineWidth) * 16.0);
if ( widthf > 1.0 ) {
rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_WIDELINE_ENABLE;
+1
View File
@@ -41,6 +41,7 @@ DRIVER_SOURCES = \
r300_fragprog.c \
r300_shader.c \
r300_emit.c \
r300_swtcl.c \
$(EGL_SOURCES)
C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES)
+6 -2
View File
@@ -321,8 +321,12 @@ void r300InitCmdBuf(r300ContextPtr r300)
r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1);
ALLOC_STATE(vap_clip, always, 5, 0);
r300->hw.vap_clip.cmd[0] = cmdpacket0(R300_VAP_CLIP_X_0, 4);
ALLOC_STATE(unk2288, always, 2, 0);
r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1);
if (has_tcl) {
ALLOC_STATE(unk2288, always, 2, 0);
r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1);
}
ALLOC_STATE(vof, always, R300_VOF_CMDSIZE, 0);
r300->hw.vof.cmd[R300_VOF_CMD_0] =
cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2);
+14 -9
View File
@@ -63,6 +63,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r300_ioctl.h"
#include "r300_tex.h"
#include "r300_emit.h"
#include "r300_swtcl.h"
#ifdef USER_BUFFERS
#include "r300_mem.h"
@@ -317,15 +318,17 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
_tnl_allow_vertex_fog(ctx, GL_TRUE);
/* currently bogus data */
ctx->Const.VertexProgram.MaxInstructions = VSF_MAX_FRAGMENT_LENGTH / 4;
ctx->Const.VertexProgram.MaxNativeInstructions =
VSF_MAX_FRAGMENT_LENGTH / 4;
ctx->Const.VertexProgram.MaxNativeAttribs = 16; /* r420 */
ctx->Const.VertexProgram.MaxTemps = 32;
ctx->Const.VertexProgram.MaxNativeTemps =
/*VSF_MAX_FRAGMENT_TEMPS */ 32;
ctx->Const.VertexProgram.MaxNativeParameters = 256; /* r420 */
ctx->Const.VertexProgram.MaxNativeAddressRegs = 1;
if (screen->chip_flags & RADEON_CHIPSET_TCL) {
ctx->Const.VertexProgram.MaxInstructions = VSF_MAX_FRAGMENT_LENGTH / 4;
ctx->Const.VertexProgram.MaxNativeInstructions =
VSF_MAX_FRAGMENT_LENGTH / 4;
ctx->Const.VertexProgram.MaxNativeAttribs = 16; /* r420 */
ctx->Const.VertexProgram.MaxTemps = 32;
ctx->Const.VertexProgram.MaxNativeTemps =
/*VSF_MAX_FRAGMENT_TEMPS */ 32;
ctx->Const.VertexProgram.MaxNativeParameters = 256; /* r420 */
ctx->Const.VertexProgram.MaxNativeAddressRegs = 1;
}
ctx->Const.FragmentProgram.MaxNativeTemps = PFS_NUM_TEMP_REGS;
ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */
@@ -363,6 +366,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
radeonInitSpanFuncs(ctx);
r300InitCmdBuf(r300);
r300InitState(r300);
if (!(screen->chip_flags & RADEON_CHIPSET_TCL))
r300InitSwtcl(ctx);
TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
+67 -28
View File
@@ -568,38 +568,21 @@ struct r300_vertex_shader_fragment {
union {
GLuint d[VSF_MAX_FRAGMENT_LENGTH];
float f[VSF_MAX_FRAGMENT_LENGTH];
VERTEX_SHADER_INSTRUCTION i[VSF_MAX_FRAGMENT_LENGTH / 4];
GLuint i[VSF_MAX_FRAGMENT_LENGTH];
} body;
};
#define VSF_DEST_PROGRAM 0x0
#define VSF_DEST_MATRIX0 0x200
#define VSF_DEST_MATRIX1 0x204
#define VSF_DEST_MATRIX2 0x208
#define VSF_DEST_VECTOR0 0x20c
#define VSF_DEST_VECTOR1 0x20d
#define VSF_DEST_UNKNOWN1 0x400
#define VSF_DEST_UNKNOWN2 0x406
struct r300_vertex_shader_state {
struct r300_vertex_shader_fragment program;
struct r300_vertex_shader_fragment unknown1;
struct r300_vertex_shader_fragment unknown2;
int program_start;
int unknown_ptr1; /* pointer within program space */
int program_end;
int param_offset;
int param_count;
int unknown_ptr2; /* pointer within program space */
int unknown_ptr3; /* pointer within program space */
};
extern int hw_tcl_on;
#define COLOR_IS_RGBA
#define TAG(x) r300##x
#include "tnl_dd/t_dd_vertex.h"
#undef TAG
//#define CURRENT_VERTEX_SHADER(ctx) (ctx->VertexProgram._Current)
#define CURRENT_VERTEX_SHADER(ctx) (R300_CONTEXT(ctx)->selected_vp)
@@ -796,13 +779,10 @@ struct r300_state {
GLuint *Elts;
struct r300_dma_region elt_dma;
DECLARE_RENDERINPUTS(render_inputs_bitset); /* actual render inputs that R300 was configured for.
struct r300_dma_region swtcl_dma;
DECLARE_RENDERINPUTS(render_inputs_bitset); /* actual render inputs that R300 was configured for.
They are the same as tnl->render_inputs for fixed pipeline */
struct {
int transform_offset; /* Transform matrix offset, -1 if none */
} vap_param; /* vertex processor parameter allocation - tells where to write parameters */
struct r300_stencilbuffer_state stencil;
};
@@ -811,6 +791,62 @@ struct r300_state {
#define R300_FALLBACK_TCL 1
#define R300_FALLBACK_RAST 2
/* r300_swtcl.c
*/
struct r300_swtcl_info {
GLuint RenderIndex;
/**
* Size of a hardware vertex. This is calculated when \c ::vertex_attrs is
* installed in the Mesa state vector.
*/
GLuint vertex_size;
/**
* Attributes instructing the Mesa TCL pipeline where / how to put vertex
* data in the hardware buffer.
*/
struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
/**
* Number of elements of \c ::vertex_attrs that are actually used.
*/
GLuint vertex_attr_count;
/**
* Cached pointer to the buffer where Mesa will store vertex data.
*/
GLubyte *verts;
/* Fallback rasterization functions
*/
// r200_point_func draw_point;
// r200_line_func draw_line;
// r200_tri_func draw_tri;
GLuint hw_primitive;
GLenum render_primitive;
GLuint numverts;
/**
* Offset of the 4UB color data within a hardware (swtcl) vertex.
*/
GLuint coloroffset;
/**
* Offset of the 3UB specular color data within a hardware (swtcl) vertex.
*/
GLuint specoffset;
/**
* Should Mesa project vertex data or will the hardware do it?
*/
GLboolean needproj;
struct r300_dma_region indexed_verts;
};
/**
* \brief R300 context structure.
*/
@@ -849,6 +885,9 @@ struct r300_context {
GLvector4f *temp_attrib[_TNL_ATTRIB_MAX];
GLboolean disable_lowimpact_fallback;
DECLARE_RENDERINPUTS(tnl_index_bitset); /* index of bits for last tnl_install_attrs */
struct r300_swtcl_info swtcl;
};
struct r300_buffer_object {
+45 -28
View File
@@ -217,14 +217,14 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr,
dw = R300_INPUT_ROUTE_FLOAT | (inputs[tab[i]] << 8) | (attribptr[tab[i]]->size - 1);
dw |= (R300_INPUT_ROUTE_FLOAT | (inputs[tab[i + 1]] << 8) | (attribptr[tab[i + 1]]->size - 1)) << 16;
if (i + 2 == nr) {
dw |= (1 << (13 + 16));
dw |= (R300_VAP_INPUT_ROUTE_END << 16);
}
dst[i >> 1] = dw;
}
if (nr & 1) {
dw = R300_INPUT_ROUTE_FLOAT | (inputs[tab[nr - 1]] << 8) | (attribptr[tab[nr - 1]]->size - 1);
dw |= 1 << 13;
dw |= R300_VAP_INPUT_ROUTE_END;
dst[nr >> 1] = dw;
}
@@ -239,7 +239,7 @@ static GLuint r300VAPInputRoute1Swizzle(int swizzle[4])
(swizzle[3] << R300_INPUT_ROUTE_W_SHIFT);
}
static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr)
GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr)
{
GLuint i;
@@ -255,14 +255,14 @@ static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr)
return (nr + 1) >> 1;
}
static GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead)
GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead)
{
/* No idea what this value means. I have seen other values written to
* this register... */
return 0x5555;
}
static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead)
GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
GLuint i, vic_1 = 0;
@@ -286,7 +286,7 @@ static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead)
return vic_1;
}
static GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten)
GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten)
{
GLuint ret = 0;
@@ -299,13 +299,14 @@ static GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten)
if (OutputsWritten & (1 << VERT_RESULT_COL1))
ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT;
if (OutputsWritten & (1 << VERT_RESULT_BFC0)
|| OutputsWritten & (1 << VERT_RESULT_BFC1))
ret |=
R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT |
R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT |
R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT;
#if 0
if (OutputsWritten & (1 << VERT_RESULT_BFC0))
ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT;
if (OutputsWritten & (1 << VERT_RESULT_BFC1))
ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT;
if (OutputsWritten & (1 << VERT_RESULT_FOGC)) ;
#endif
@@ -315,7 +316,7 @@ static GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten)
return ret;
}
static GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten)
GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten)
{
GLuint i, ret = 0;
@@ -358,9 +359,11 @@ int r300EmitArrays(GLcontext * ctx)
DECLARE_RENDERINPUTS(render_inputs_bitset);
RENDERINPUTS_COPY(render_inputs_bitset, tnl->render_inputs_bitset);
vb->AttribPtr[VERT_ATTRIB_POS] = vb->ClipPtr;
assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_POS));
assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_NORMAL) == 0);
assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_COLOR0));
//assert(RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_COLOR0));
if (RENDERINPUTS_TEST(render_inputs_bitset, _TNL_ATTRIB_POS)) {
InputsRead |= 1 << VERT_ATTRIB_POS;
@@ -392,20 +395,18 @@ int r300EmitArrays(GLcontext * ctx)
}
}
if (!(rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) {
/* Fixed, apply to vir0 only */
memcpy(vir_inputs, inputs, VERT_ATTRIB_MAX * sizeof(int));
inputs = vir_inputs;
if (InputsRead & VERT_ATTRIB_POS)
inputs[VERT_ATTRIB_POS] = 0;
if (InputsRead & (1 << VERT_ATTRIB_COLOR0))
inputs[VERT_ATTRIB_COLOR0] = 2;
if (InputsRead & (1 << VERT_ATTRIB_COLOR1))
inputs[VERT_ATTRIB_COLOR1] = 3;
for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++)
if (InputsRead & (1 << i))
inputs[i] = 6 + (i - VERT_ATTRIB_TEX0);
}
/* Fixed, apply to vir0 only */
memcpy(vir_inputs, inputs, VERT_ATTRIB_MAX * sizeof(int));
inputs = vir_inputs;
if (InputsRead & VERT_ATTRIB_POS)
inputs[VERT_ATTRIB_POS] = 0;
if (InputsRead & (1 << VERT_ATTRIB_COLOR0))
inputs[VERT_ATTRIB_COLOR0] = 2;
if (InputsRead & (1 << VERT_ATTRIB_COLOR1))
inputs[VERT_ATTRIB_COLOR1] = 3;
for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++)
if (InputsRead & (1 << i))
inputs[i] = 6 + (i - VERT_ATTRIB_TEX0);
RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, render_inputs_bitset);
}
@@ -532,3 +533,19 @@ void r300ReleaseArrays(GLcontext * ctx)
r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i], __FUNCTION__);
}
}
void r300EmitCacheFlush(r300ContextPtr rmesa)
{
int cmd_reserved = 0;
int cmd_written = 0;
drm_radeon_cmd_header_t *cmd = NULL;
reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0);
e32(R300_RB3D_DSTCACHE_UNKNOWN_0A);
reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0);
e32(R300_RB3D_ZCACHE_UNKNOWN_03);
}
+10
View File
@@ -225,5 +225,15 @@ void r300UseArrays(GLcontext * ctx);
#endif
extern void r300ReleaseArrays(GLcontext * ctx);
extern int r300PrimitiveType(r300ContextPtr rmesa, int prim);
extern int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim);
extern void r300EmitCacheFlush(r300ContextPtr rmesa);
extern GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr);
extern GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead);
extern GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead);
extern GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten);
extern GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten);
#endif
+13 -11
View File
@@ -172,11 +172,7 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
cmd2[7].u = r300PackFloat32(ctx->Color.ClearColor[2]);
cmd2[8].u = r300PackFloat32(ctx->Color.ClearColor[3]);
reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0);
e32(R300_RB3D_DSTCACHE_UNKNOWN_0A);
reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0);
e32(R300_RB3D_ZCACHE_UNKNOWN_03);
r300EmitCacheFlush(rmesa);
cp_wait(rmesa, R300_WAIT_3D | R300_WAIT_3D_CLEAN);
}
@@ -412,19 +408,22 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask)
void r300Flush(GLcontext * ctx)
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
r300ContextPtr rmesa = R300_CONTEXT(ctx);
if (RADEON_DEBUG & DEBUG_IOCTL)
fprintf(stderr, "%s\n", __FUNCTION__);
if (r300->cmdbuf.count_used > r300->cmdbuf.count_reemit)
r300FlushCmdBuf(r300, __FUNCTION__);
if (rmesa->dma.flush)
rmesa->dma.flush( rmesa );
if (rmesa->cmdbuf.count_used > rmesa->cmdbuf.count_reemit)
r300FlushCmdBuf(rmesa, __FUNCTION__);
}
#ifdef USER_BUFFERS
#include "r300_mem.h"
static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size)
void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size)
{
struct r300_dma_buffer *dmabuf;
size = MAX2(size, RADEON_BUFFER_SIZE * 16);
@@ -436,9 +435,12 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size)
rmesa->dma.flush(rmesa);
}
if (rmesa->dma.current.buf)
if (rmesa->dma.current.buf) {
#ifdef USER_BUFFERS
r300_mem_use(rmesa, rmesa->dma.current.buf->id);
#endif
r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, __FUNCTION__);
}
if (rmesa->dma.nr_released_bufs > 4)
r300FlushCmdBuf(rmesa, __FUNCTION__);
+1
View File
@@ -56,4 +56,5 @@ extern void r300AllocDmaRegion(r300ContextPtr rmesa,
extern void r300InitIoctlFuncs(struct dd_function_table *functions);
extern void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size);
#endif /* __R300_IOCTL_H__ */
+28 -3
View File
@@ -282,9 +282,32 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define R300_VAP_PVS_UPLOAD_ADDRESS 0x2200
# define R300_PVS_UPLOAD_PROGRAM 0x00000000
/* gap */
# define R300_PVS_UPLOAD_PARAMETERS 0x00000200
/* gap */
# define R300_PVS_UPLOAD_CLIP_PLANE0 0x00000400
# define R300_PVS_UPLOAD_CLIP_PLANE1 0x00000401
# define R300_PVS_UPLOAD_CLIP_PLANE2 0x00000402
# define R300_PVS_UPLOAD_CLIP_PLANE3 0x00000403
# define R300_PVS_UPLOAD_CLIP_PLANE4 0x00000404
# define R300_PVS_UPLOAD_CLIP_PLANE5 0x00000405
# define R300_PVS_UPLOAD_POINTSIZE 0x00000406
/*
* These are obsolete defines form r300_context.h, but they might give some
* clues when investigating the addresses further...
*/
#if 0
#define VSF_DEST_PROGRAM 0x0
#define VSF_DEST_MATRIX0 0x200
#define VSF_DEST_MATRIX1 0x204
#define VSF_DEST_MATRIX2 0x208
#define VSF_DEST_VECTOR0 0x20c
#define VSF_DEST_VECTOR1 0x20d
#define VSF_DEST_UNKNOWN1 0x400
#define VSF_DEST_UNKNOWN2 0x406
#endif
/* gap */
#define R300_VAP_PVS_UPLOAD_DATA 0x2208
@@ -336,13 +359,15 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* The meaning of the two UNKNOWN fields is obviously not known. However,
* experiments so far have shown that both *must* point to an instruction
* inside the vertex program, otherwise the GPU locks up.
*
* fglrx usually sets CNTL_3_UNKNOWN to the end of the program and
* CNTL_1_UNKNOWN points to instruction where last write to position takes
* place.
* R300_PVS_CNTL_1_POS_END_SHIFT points to instruction where last write to
* position takes place.
*
* Most likely this is used to ignore rest of the program in cases
* where group of verts arent visible. For some reason this "section"
* is sometimes accepted other instruction that have no relationship with
*position calculations.
* position calculations.
*/
#define R300_VAP_PVS_CNTL_1 0x22D0
# define R300_PVS_CNTL_1_PROGRAM_START_SHIFT 0

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