mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
Merge branch 'master' of git+ssh://michal@git.freedesktop.org/git/mesa/mesa into softpipe_0_1_branch
This commit is contained in:
commit
e0a26b0467
65 changed files with 1358 additions and 621 deletions
12
Makefile
12
Makefile
|
|
@ -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 \
|
||||
|
|
|
|||
11
Makefile.mgw
11
Makefile.mgw
|
|
@ -53,11 +53,13 @@
|
|||
|
||||
# MinGW core makefile updated for Mesa 7.0
|
||||
#
|
||||
# updated : by Heromyth, 2007-6-25
|
||||
# Updated : by Heromyth, on 2007-7-21
|
||||
# Email : zxpmyth@yahoo.com.cn
|
||||
# Bug : All the default settings work fine. But the setting X86=1 can't work.
|
||||
# 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
|
||||
|
|
@ -73,13 +75,14 @@ CFLAGS += -O2 -ffast-math
|
|||
|
||||
export CFLAGS
|
||||
|
||||
|
||||
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
|
||||
UNLINK = del $(subst /,\,$(1))
|
||||
else
|
||||
UNLINK = $(RM) $(1)
|
||||
endif
|
||||
|
||||
all: libgl libglu libglut
|
||||
all: libgl libglu libglut example
|
||||
|
||||
libgl: lib
|
||||
$(MAKE) -f Makefile.mgw -C src/mesa
|
||||
|
|
|
|||
42
configs/config.mgw
Normal file
42
configs/config.mgw
Normal 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
|
||||
|
|
@ -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);
|
||||
===================
|
||||
|
||||
*********************************************************************************
|
||||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -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,7 +112,7 @@ 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
|
||||
|
|
@ -130,8 +134,9 @@ 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)();
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
typedef int (GLUTAPIENTRY *PROC)();
|
||||
typedef void *HGLRC;
|
||||
typedef void *HDC;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -409,6 +409,8 @@ test(GLenum type, GLint bits, const char *filename)
|
|||
|
||||
printf("Rendering %d bit/channel image: %s\n", bits, filename);
|
||||
|
||||
OSMesaColorClamp(GL_TRUE);
|
||||
|
||||
init_context();
|
||||
render_image();
|
||||
if (Gradient)
|
||||
|
|
@ -421,7 +423,7 @@ test(GLenum type, GLint bits, const char *filename)
|
|||
if (WriteFiles && filename != NULL) {
|
||||
if (type == GL_UNSIGNED_SHORT) {
|
||||
GLushort *buffer16 = (GLushort *) buffer;
|
||||
GLubyte *buffer8 = malloc(WIDTH * HEIGHT * 4);
|
||||
GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4);
|
||||
int i;
|
||||
for (i = 0; i < WIDTH * HEIGHT * 4; i++)
|
||||
buffer8[i] = buffer16[i] >> 8;
|
||||
|
|
@ -430,8 +432,9 @@ test(GLenum type, GLint bits, const char *filename)
|
|||
}
|
||||
else if (type == GL_FLOAT) {
|
||||
GLfloat *buffer32 = (GLfloat *) buffer;
|
||||
GLubyte *buffer8 = malloc(WIDTH * HEIGHT * 4);
|
||||
GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4);
|
||||
int i;
|
||||
/* colors may be outside [0,1] so we need to clamp */
|
||||
for (i = 0; i < WIDTH * HEIGHT * 4; i++)
|
||||
buffer8[i] = (GLubyte) (buffer32[i] * 255.0);
|
||||
write_ppm(filename, buffer8, WIDTH, HEIGHT);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
src/glu/sgi/Makefile.mgw
Normal file
229
src/glu/sgi/Makefile.mgw
Normal 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)
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
198
src/glut/glx/Makefile.mgw
Normal file
198
src/glut/glx/Makefile.mgw
Normal 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)
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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__)
|
||||
|
|
|
|||
|
|
@ -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. */
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -509,7 +509,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);
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -390,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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -568,7 +568,7 @@ struct r300_vertex_shader_fragment {
|
|||
union {
|
||||
GLuint d[VSF_MAX_FRAGMENT_LENGTH];
|
||||
float f[VSF_MAX_FRAGMENT_LENGTH];
|
||||
struct r300_vertprog_instruction i[VSF_MAX_FRAGMENT_LENGTH / 4];
|
||||
GLuint i[VSF_MAX_FRAGMENT_LENGTH];
|
||||
} body;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -733,8 +733,8 @@ static void r300Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param)
|
|||
static void r300PointSize(GLcontext * ctx, GLfloat size)
|
||||
{
|
||||
r300ContextPtr r300 = R300_CONTEXT(ctx);
|
||||
|
||||
size = ctx->Point._Size;
|
||||
/* same size limits for AA, non-AA points */
|
||||
size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
|
||||
|
||||
R300_STATECHANGE(r300, ps);
|
||||
r300->hw.ps.cmd[R300_PS_POINTSIZE] =
|
||||
|
|
@ -749,8 +749,9 @@ static void r300LineWidth(GLcontext * ctx, GLfloat widthf)
|
|||
{
|
||||
r300ContextPtr r300 = R300_CONTEXT(ctx);
|
||||
|
||||
widthf = ctx->Line._Width;
|
||||
|
||||
widthf = CLAMP(widthf,
|
||||
ctx->Const.MinPointSize,
|
||||
ctx->Const.MaxPointSize);
|
||||
R300_STATECHANGE(r300, lcntl);
|
||||
r300->hw.lcntl.cmd[1] =
|
||||
R300_LINE_CNT_HO | R300_LINE_CNT_VE | (int)(widthf * 6.0);
|
||||
|
|
@ -1566,30 +1567,31 @@ static void r300SetupDefaultVertexProgram(r300ContextPtr rmesa)
|
|||
|
||||
for (i = VERT_ATTRIB_POS; i < VERT_ATTRIB_MAX; i++) {
|
||||
if (rmesa->state.sw_tcl_inputs[i] != -1) {
|
||||
prog->program.body.i[program_end].opcode = EASY_VSF_OP(MUL, o_reg++, ALL, RESULT);
|
||||
prog->program.body.i[program_end].src[0] = VSF_REG(rmesa->state.sw_tcl_inputs[i]);
|
||||
prog->program.body.i[program_end].src[1] = VSF_ATTR_UNITY(rmesa->state.sw_tcl_inputs[i]);
|
||||
prog->program.body.i[program_end].src[2] = VSF_UNITY(rmesa->state.sw_tcl_inputs[i]);
|
||||
program_end++;
|
||||
prog->program.body.i[program_end + 0] = EASY_VSF_OP(MUL, o_reg++, ALL, RESULT);
|
||||
prog->program.body.i[program_end + 1] = VSF_REG(rmesa->state.sw_tcl_inputs[i]);
|
||||
prog->program.body.i[program_end + 2] = VSF_ATTR_UNITY(rmesa->state.sw_tcl_inputs[i]);
|
||||
prog->program.body.i[program_end + 3] = VSF_UNITY(rmesa->state.sw_tcl_inputs[i]);
|
||||
program_end += 4;
|
||||
}
|
||||
}
|
||||
|
||||
prog->program.length = program_end * 4;
|
||||
prog->program.length = program_end;
|
||||
|
||||
r300SetupVertexProgramFragment(rmesa, R300_PVS_UPLOAD_PROGRAM, &(prog->program));
|
||||
r300SetupVertexProgramFragment(rmesa, R300_PVS_UPLOAD_PROGRAM,
|
||||
&(prog->program));
|
||||
inst_count = (prog->program.length / 4) - 1;
|
||||
|
||||
R300_STATECHANGE(rmesa, pvs);
|
||||
rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] =
|
||||
(0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
|
||||
(inst_count << R300_PVS_CNTL_1_POS_END_SHIFT) |
|
||||
(inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
|
||||
(0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
|
||||
(inst_count << R300_PVS_CNTL_1_POS_END_SHIFT) |
|
||||
(inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
|
||||
rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] =
|
||||
(0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) |
|
||||
(param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT);
|
||||
(0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) |
|
||||
(param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT);
|
||||
rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] =
|
||||
(inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) |
|
||||
(inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT);
|
||||
(inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) |
|
||||
(inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT);
|
||||
}
|
||||
|
||||
static void r300SetupRealVertexProgram(r300ContextPtr rmesa)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -3,11 +3,6 @@
|
|||
|
||||
#include "r300_reg.h"
|
||||
|
||||
struct r300_vertprog_instruction {
|
||||
GLuint opcode;
|
||||
GLuint src[3];
|
||||
};
|
||||
|
||||
#define VSF_FLAG_X 1
|
||||
#define VSF_FLAG_Y 2
|
||||
#define VSF_FLAG_Z 4
|
||||
|
|
|
|||
|
|
@ -131,7 +131,9 @@ static __inline__ void savage_draw_point (savageContextPtr imesa,
|
|||
u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize);
|
||||
const GLfloat x = tmp->v.x;
|
||||
const GLfloat y = tmp->v.y;
|
||||
const GLfloat sz = imesa->glCtx->Point._Size * .5;
|
||||
const GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size,
|
||||
imesa->glCtx->Const.MinPointSize,
|
||||
imesa->glCtx->Const.MaxPointSize);
|
||||
GLuint j;
|
||||
|
||||
*(float *)&vb[0] = x - sz;
|
||||
|
|
@ -164,7 +166,9 @@ static __inline__ void savage_draw_line (savageContextPtr imesa,
|
|||
savageVertexPtr v1 ) {
|
||||
GLuint vertsize = imesa->HwVertexSize;
|
||||
u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize);
|
||||
GLfloat width = imesa->glCtx->Line._Width;
|
||||
const GLfloat width = CLAMP(imesa->glCtx->Line.Width,
|
||||
imesa->glCtx->Const.MinLineWidth,
|
||||
imesa->glCtx->Const.MaxLineWidth);
|
||||
GLfloat dx, dy, ix, iy;
|
||||
GLuint j;
|
||||
|
||||
|
|
@ -234,7 +238,9 @@ static __inline__ void savage_ptex_line (savageContextPtr imesa,
|
|||
savageVertexPtr v1 ) {
|
||||
GLuint vertsize = imesa->HwVertexSize;
|
||||
u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize);
|
||||
GLfloat width = imesa->glCtx->Line._Width;
|
||||
const GLfloat width = CLAMP(imesa->glCtx->Line.Width,
|
||||
imesa->glCtx->Const.MinLineWidth,
|
||||
imesa->glCtx->Const.MaxLineWidth);
|
||||
GLfloat dx, dy, ix, iy;
|
||||
savageVertex tmp0, tmp1;
|
||||
GLuint j;
|
||||
|
|
@ -281,7 +287,9 @@ static __inline__ void savage_ptex_point (savageContextPtr imesa,
|
|||
u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize);
|
||||
const GLfloat x = v0->v.x;
|
||||
const GLfloat y = v0->v.y;
|
||||
const GLfloat sz = imesa->glCtx->Point._Size * .5;
|
||||
const GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size,
|
||||
imesa->glCtx->Const.MinPointSize,
|
||||
imesa->glCtx->Const.MaxPointSize);
|
||||
savageVertex tmp;
|
||||
GLuint j;
|
||||
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ tdfx_translate_vertex( GLcontext *ctx, const tdfxVertex *src, SWvertex *dst)
|
|||
}
|
||||
}
|
||||
|
||||
dst->pointSize = ctx->Point._Size;
|
||||
dst->pointSize = ctx->Point.Size;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,15 +33,30 @@
|
|||
/* We're essentially building part of GDI here, so define this so that
|
||||
* we get the right export linkage. */
|
||||
#ifdef __MINGW32__
|
||||
#include <GL/gl.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <windef.h>
|
||||
#include <wincon.h>
|
||||
#include <winbase.h>
|
||||
|
||||
# if defined(BUILD_GL32)
|
||||
# define WINGDIAPI __declspec(dllexport)
|
||||
# else
|
||||
# define __W32API_USE_DLLIMPORT__
|
||||
# endif
|
||||
|
||||
#include <wingdi.h>
|
||||
#include "GL/mesa_wgl.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#else
|
||||
|
||||
#define _GDI32_
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
#include "glapi.h"
|
||||
#endif
|
||||
|
||||
#include "glapi.h"
|
||||
#include "GL/wmesa.h" /* protos for wmesa* functions */
|
||||
|
||||
/*
|
||||
|
|
@ -339,7 +354,7 @@ WINGDIAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc)
|
|||
}
|
||||
|
||||
WINGDIAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat,
|
||||
const PIXELFORMATDESCRIPTOR *ppfd)
|
||||
const PIXELFORMATDESCRIPTOR *ppfd)
|
||||
{
|
||||
(void) hdc;
|
||||
|
||||
|
|
@ -392,12 +407,12 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar,
|
|||
|
||||
bitDevice = CreateCompatibleDC(fontDevice);
|
||||
|
||||
// Swap fore and back colors so the bitmap has the right polarity
|
||||
/* Swap fore and back colors so the bitmap has the right polarity */
|
||||
tempColor = GetBkColor(bitDevice);
|
||||
SetBkColor(bitDevice, GetTextColor(bitDevice));
|
||||
SetTextColor(bitDevice, tempColor);
|
||||
|
||||
// Place chars based on base line
|
||||
/* Place chars based on base line */
|
||||
VERIFY(SetTextAlign(bitDevice, TA_BASELINE) != GDI_ERROR ? 1 : 0);
|
||||
|
||||
for(i = 0; i < (int)numChars; i++) {
|
||||
|
|
@ -410,36 +425,36 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar,
|
|||
|
||||
curChar = (char)(i + firstChar);
|
||||
|
||||
// Find how high/wide this character is
|
||||
/* Find how high/wide this character is */
|
||||
VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size));
|
||||
|
||||
// Create the output bitmap
|
||||
/* Create the output bitmap */
|
||||
charWidth = size.cx;
|
||||
charHeight = size.cy;
|
||||
// Round up to the next multiple of 32 bits
|
||||
/* Round up to the next multiple of 32 bits */
|
||||
bmapWidth = ((charWidth + 31) / 32) * 32;
|
||||
bmapHeight = charHeight;
|
||||
bitObject = CreateCompatibleBitmap(bitDevice,
|
||||
bmapWidth,
|
||||
bmapHeight);
|
||||
//VERIFY(bitObject);
|
||||
/* VERIFY(bitObject); */
|
||||
|
||||
// Assign the output bitmap to the device
|
||||
/* Assign the output bitmap to the device */
|
||||
origBmap = SelectObject(bitDevice, bitObject);
|
||||
(void) VERIFY(origBmap);
|
||||
|
||||
VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) );
|
||||
|
||||
// Use our source font on the device
|
||||
/* Use our source font on the device */
|
||||
VERIFY(SelectObject(bitDevice, GetCurrentObject(fontDevice,OBJ_FONT)));
|
||||
|
||||
// Draw the character
|
||||
/* Draw the character */
|
||||
VERIFY(TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1));
|
||||
|
||||
// Unselect our bmap object
|
||||
/* Unselect our bmap object */
|
||||
VERIFY(SelectObject(bitDevice, origBmap));
|
||||
|
||||
// Convert the display dependant representation to a 1 bit deep DIB
|
||||
/* Convert the display dependant representation to a 1 bit deep DIB */
|
||||
numBytes = (bmapWidth * bmapHeight) / 8;
|
||||
bmap = malloc(numBytes);
|
||||
dibInfo->bmiHeader.biWidth = bmapWidth;
|
||||
|
|
@ -447,24 +462,24 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar,
|
|||
res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap,
|
||||
dibInfo,
|
||||
DIB_RGB_COLORS);
|
||||
//VERIFY(res);
|
||||
/* VERIFY(res); */
|
||||
|
||||
// Create the GL object
|
||||
/* Create the GL object */
|
||||
glNewList(i + listBase, GL_COMPILE);
|
||||
glBitmap(bmapWidth, bmapHeight, 0.0, (GLfloat)metric.tmDescent,
|
||||
(GLfloat)charWidth, 0.0,
|
||||
bmap);
|
||||
glEndList();
|
||||
// CheckGL();
|
||||
/* CheckGL(); */
|
||||
|
||||
// Destroy the bmap object
|
||||
/* Destroy the bmap object */
|
||||
DeleteObject(bitObject);
|
||||
|
||||
// Deallocate the bitmap data
|
||||
/* Deallocate the bitmap data */
|
||||
free(bmap);
|
||||
}
|
||||
|
||||
// Destroy the DC
|
||||
/* Destroy the DC */
|
||||
VERIFY(DeleteDC(bitDevice));
|
||||
|
||||
free(dibInfo);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include "wmesadef.h"
|
||||
#include "colors.h"
|
||||
#include <GL/wmesa.h>
|
||||
#include <winuser.h>
|
||||
#include "context.h"
|
||||
#include "extensions.h"
|
||||
#include "framebuffer.h"
|
||||
|
|
@ -114,7 +115,7 @@ static void wmSetPixelFormat(WMesaFramebuffer pwfb, HDC hDC)
|
|||
{
|
||||
pwfb->cColorBits = GetDeviceCaps(hDC, BITSPIXEL);
|
||||
|
||||
// Only 16 and 32 bit targets are supported now
|
||||
/* Only 16 and 32 bit targets are supported now */
|
||||
assert(pwfb->cColorBits == 0 ||
|
||||
pwfb->cColorBits == 16 ||
|
||||
pwfb->cColorBits == 32);
|
||||
|
|
@ -1171,7 +1172,7 @@ WMesaContext WMesaCreateContext(HDC hDC,
|
|||
/* I do not understand this contributed code */
|
||||
/* Support memory and device contexts */
|
||||
if(WindowFromDC(hDC) != NULL) {
|
||||
c->hDC = GetDC(WindowFromDC(hDC)); // huh ????
|
||||
c->hDC = GetDC(WindowFromDC(hDC)); /* huh ???? */
|
||||
}
|
||||
else {
|
||||
c->hDC = hDC;
|
||||
|
|
@ -1404,6 +1405,7 @@ void WMesaSwapBuffers( HDC hdc )
|
|||
* table entries. Hopefully, I'll find a better solution. The
|
||||
* dispatch table generation scripts ought to be making these dummy
|
||||
* stubs as well. */
|
||||
#if !defined(__MINGW32__) || !defined(GL_NO_STDCALL)
|
||||
void gl_dispatch_stub_543(void){}
|
||||
void gl_dispatch_stub_544(void){}
|
||||
void gl_dispatch_stub_545(void){}
|
||||
|
|
@ -1471,3 +1473,4 @@ void gl_dispatch_stub_769(void){}
|
|||
void gl_dispatch_stub_770(void){}
|
||||
void gl_dispatch_stub_771(void){}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef WMESADEF_H
|
||||
#define WMESADEF_H
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include "context.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -296,6 +296,11 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
|
|||
}
|
||||
}
|
||||
|
||||
if (stereoFlag) {
|
||||
/* stereo not supported */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Comparing IDs uses less memory but sometimes fails. */
|
||||
/* XXX revisit this after 3.0 is finished. */
|
||||
if (_mesa_getenv("MESA_GLX_VISUAL_HACK"))
|
||||
|
|
@ -1079,7 +1084,7 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
|
|||
else {
|
||||
stereo_flag = GL_TRUE;
|
||||
}
|
||||
return NULL; /* stereo not supported */
|
||||
break;
|
||||
case GLX_AUX_BUFFERS:
|
||||
parselist++;
|
||||
numAux = *parselist++;
|
||||
|
|
|
|||
|
|
@ -98,9 +98,13 @@ _mesa_PushAttrib(GLbitfield mask)
|
|||
}
|
||||
|
||||
if (mask & GL_COLOR_BUFFER_BIT) {
|
||||
GLuint i;
|
||||
struct gl_colorbuffer_attrib *attr;
|
||||
attr = MALLOC_STRUCT( gl_colorbuffer_attrib );
|
||||
MEMCPY( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) );
|
||||
/* push the Draw FBO's DrawBuffer[] state, not ctx->Color.DrawBuffer[] */
|
||||
for (i = 0; i < ctx->Const.MaxDrawBuffers; i ++)
|
||||
attr->DrawBuffer[i] = ctx->DrawBuffer->ColorDrawBuffer[i];
|
||||
newnode = new_attrib_node( GL_COLOR_BUFFER_BIT );
|
||||
newnode->data = attr;
|
||||
newnode->next = head;
|
||||
|
|
|
|||
|
|
@ -370,6 +370,14 @@ _mesa_DrawBuffer(GLenum buffer)
|
|||
|
||||
/* if we get here, there's no error so set new state */
|
||||
_mesa_drawbuffers(ctx, 1, &buffer, &destMask);
|
||||
|
||||
/*
|
||||
* Call device driver function.
|
||||
*/
|
||||
if (ctx->Driver.DrawBuffers)
|
||||
ctx->Driver.DrawBuffers(ctx, 1, &buffer);
|
||||
else if (ctx->Driver.DrawBuffer)
|
||||
ctx->Driver.DrawBuffer(ctx, buffer);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -435,6 +443,14 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
|
|||
|
||||
/* OK, if we get here, there were no errors so set the new state */
|
||||
_mesa_drawbuffers(ctx, n, buffers, destMask);
|
||||
|
||||
/*
|
||||
* Call device driver function.
|
||||
*/
|
||||
if (ctx->Driver.DrawBuffers)
|
||||
ctx->Driver.DrawBuffers(ctx, n, buffers);
|
||||
else if (ctx->Driver.DrawBuffer)
|
||||
ctx->Driver.DrawBuffer(ctx, buffers[0]);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -463,14 +479,15 @@ set_color_output(GLcontext *ctx, GLuint output, GLenum buffer,
|
|||
/* not really needed, will be set later */
|
||||
fb->_NumColorDrawBuffers[output] = 0;
|
||||
|
||||
if (fb->Name == 0)
|
||||
/* Set traditional state var */
|
||||
ctx->Color.DrawBuffer[output] = buffer;
|
||||
ctx->Color.DrawBuffer[output] = buffer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper routine used by _mesa_DrawBuffer, _mesa_DrawBuffersARB and
|
||||
* _mesa_PopAttrib to set drawbuffer state.
|
||||
* other places (window fbo fixup) to set fbo (and the old ctx) fields.
|
||||
* All error checking will have been done prior to calling this function
|
||||
* so nothing should go wrong at this point.
|
||||
* \param ctx current context
|
||||
|
|
@ -509,30 +526,15 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
|
|||
}
|
||||
|
||||
ctx->NewState |= _NEW_COLOR;
|
||||
|
||||
/*
|
||||
* Call device driver function.
|
||||
*/
|
||||
if (ctx->Driver.DrawBuffers)
|
||||
ctx->Driver.DrawBuffers(ctx, n, buffers);
|
||||
else if (ctx->Driver.DrawBuffer)
|
||||
ctx->Driver.DrawBuffer(ctx, buffers[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Called by glReadBuffer to set the source renderbuffer for reading pixels.
|
||||
* \param mode color buffer such as GL_FRONT, GL_BACK, etc.
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_ReadBuffer(GLenum buffer)
|
||||
GLboolean
|
||||
_mesa_readbuffer_update_fields(GLcontext *ctx, GLenum buffer)
|
||||
{
|
||||
struct gl_framebuffer *fb;
|
||||
GLbitfield supportedMask;
|
||||
GLint srcBuffer;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
||||
|
||||
fb = ctx->ReadBuffer;
|
||||
|
||||
|
|
@ -548,12 +550,12 @@ _mesa_ReadBuffer(GLenum buffer)
|
|||
srcBuffer = read_buffer_enum_to_index(buffer);
|
||||
if (srcBuffer == -1) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(buffer=0x%x)", buffer);
|
||||
return;
|
||||
return GL_FALSE;
|
||||
}
|
||||
supportedMask = supported_buffer_bitmask(ctx, fb);
|
||||
if (((1 << srcBuffer) & supportedMask) == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadBuffer(buffer=0x%x)", buffer);
|
||||
return;
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -563,6 +565,27 @@ _mesa_ReadBuffer(GLenum buffer)
|
|||
fb->ColorReadBuffer = buffer;
|
||||
fb->_ColorReadBufferIndex = srcBuffer;
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Called by glReadBuffer to set the source renderbuffer for reading pixels.
|
||||
* \param mode color buffer such as GL_FRONT, GL_BACK, etc.
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_ReadBuffer(GLenum buffer)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_API)
|
||||
_mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer));
|
||||
|
||||
if (!_mesa_readbuffer_update_fields(ctx, buffer))
|
||||
return;
|
||||
|
||||
ctx->NewState |= _NEW_PIXEL;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ extern void
|
|||
_mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
|
||||
const GLbitfield *destMask);
|
||||
|
||||
extern GLboolean
|
||||
_mesa_readbuffer_update_fields(GLcontext *ctx, GLenum buffer);
|
||||
|
||||
extern void GLAPIENTRY
|
||||
_mesa_ReadBuffer( GLenum mode );
|
||||
|
||||
|
|
|
|||
|
|
@ -1496,9 +1496,8 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
|
|||
if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
|
||||
_mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer);
|
||||
/* fix up the fb fields - these will end up wrong otherwise
|
||||
if the DRIdrawable changes, and someone may rely on them.
|
||||
*/
|
||||
/* What a mess!?! */
|
||||
if the DRIdrawable changes, and everything relies on them.
|
||||
This is a bit messy (same as needed in _mesa_BindFramebufferEXT) */
|
||||
int i;
|
||||
GLenum buffers[MAX_DRAW_BUFFERS];
|
||||
for(i = 0; i < newCtx->Const.MaxDrawBuffers; i++) {
|
||||
|
|
@ -1508,7 +1507,7 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
|
|||
}
|
||||
if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {
|
||||
_mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer);
|
||||
_mesa_ReadBuffer(newCtx->Pixel.ReadBuffer);
|
||||
_mesa_readbuffer_update_fields(newCtx, newCtx->Pixel.ReadBuffer);
|
||||
}
|
||||
|
||||
newCtx->NewState |= _NEW_BUFFERS;
|
||||
|
|
|
|||
|
|
@ -782,7 +782,7 @@ struct dd_function_table {
|
|||
struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name);
|
||||
struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name);
|
||||
void (*BindFramebuffer)(GLcontext *ctx, GLenum target,
|
||||
struct gl_framebuffer *fb);
|
||||
struct gl_framebuffer *fb, struct gl_framebuffer *fbread);
|
||||
void (*FramebufferRenderbuffer)(GLcontext *ctx,
|
||||
struct gl_framebuffer *fb,
|
||||
GLenum attachment,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "buffers.h"
|
||||
#include "context.h"
|
||||
#include "fbobject.h"
|
||||
#include "framebuffer.h"
|
||||
|
|
@ -924,7 +925,7 @@ check_end_texture_render(GLcontext *ctx, struct gl_framebuffer *fb)
|
|||
void GLAPIENTRY
|
||||
_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
|
||||
{
|
||||
struct gl_framebuffer *newFb;
|
||||
struct gl_framebuffer *newFb, *newFbread;
|
||||
GLboolean bindReadBuf, bindDrawBuf;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
|
|
@ -984,12 +985,14 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
|
|||
}
|
||||
_mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newFb);
|
||||
}
|
||||
newFbread = newFb;
|
||||
}
|
||||
else {
|
||||
/* Binding the window system framebuffer (which was originally set
|
||||
* with MakeCurrent).
|
||||
*/
|
||||
newFb = ctx->WinSysDrawBuffer;
|
||||
newFbread = ctx->WinSysReadBuffer;
|
||||
}
|
||||
|
||||
ASSERT(newFb);
|
||||
|
|
@ -999,8 +1002,16 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
|
|||
* XXX check if re-binding same buffer and skip some of this code.
|
||||
*/
|
||||
|
||||
/* for window-framebuffers, re-initialize the fbo values, as they
|
||||
could be wrong (makecurrent with a new drawable while still a fbo
|
||||
was bound will lead to default init fbo values).
|
||||
note that therefore the context ReadBuffer/DrawBuffer values are not
|
||||
valid while fbo's are bound!!! */
|
||||
if (bindReadBuf) {
|
||||
_mesa_reference_framebuffer(&ctx->ReadBuffer, newFb);
|
||||
_mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread);
|
||||
if (!newFbread->Name) {
|
||||
_mesa_readbuffer_update_fields(ctx, ctx->Pixel.ReadBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
if (bindDrawBuf) {
|
||||
|
|
@ -1008,14 +1019,22 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
|
|||
check_end_texture_render(ctx, ctx->DrawBuffer);
|
||||
/* check if time to delete this framebuffer */
|
||||
_mesa_reference_framebuffer(&ctx->DrawBuffer, newFb);
|
||||
if (newFb->Name != 0) {
|
||||
if (!newFb->Name) {
|
||||
GLuint i;
|
||||
GLenum buffers[MAX_DRAW_BUFFERS];
|
||||
for(i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
|
||||
buffers[i] = ctx->Color.DrawBuffer[i];
|
||||
}
|
||||
_mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, buffers, NULL);
|
||||
}
|
||||
else {
|
||||
/* check if newly bound framebuffer has any texture attachments */
|
||||
check_begin_texture_render(ctx, newFb);
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->Driver.BindFramebuffer) {
|
||||
ctx->Driver.BindFramebuffer(ctx, target, newFb);
|
||||
ctx->Driver.BindFramebuffer(ctx, target, newFb, newFbread);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -654,6 +654,27 @@ update_color_read_buffer(GLcontext *ctx, struct gl_framebuffer *fb)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
update_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
|
||||
{
|
||||
/* Completeness only matters for user-created framebuffers */
|
||||
if (fb->Name != 0) {
|
||||
/* XXX: EXT_framebuffer_blit:
|
||||
framebuffer must still be complete wrt read/draw? */
|
||||
_mesa_test_framebuffer_completeness(ctx, fb);
|
||||
_mesa_update_framebuffer_visual(fb);
|
||||
}
|
||||
|
||||
/* update_color_draw/read_buffers not needed for
|
||||
read/draw only fb, but shouldn't hurt ??? */
|
||||
update_color_draw_buffers(ctx, fb);
|
||||
update_color_read_buffer(ctx, fb);
|
||||
_mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH);
|
||||
_mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL);
|
||||
|
||||
compute_depth_max(fb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update state related to the current draw/read framebuffers.
|
||||
* Specifically, update these framebuffer fields:
|
||||
|
|
@ -671,19 +692,11 @@ void
|
|||
_mesa_update_framebuffer(GLcontext *ctx)
|
||||
{
|
||||
struct gl_framebuffer *fb = ctx->DrawBuffer;
|
||||
struct gl_framebuffer *fbread = ctx->ReadBuffer;
|
||||
|
||||
/* Completeness only matters for user-created framebuffers */
|
||||
if (fb->Name != 0) {
|
||||
_mesa_test_framebuffer_completeness(ctx, fb);
|
||||
_mesa_update_framebuffer_visual(fb);
|
||||
}
|
||||
|
||||
update_color_draw_buffers(ctx, fb);
|
||||
update_color_read_buffer(ctx, fb);
|
||||
_mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH);
|
||||
_mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL);
|
||||
|
||||
compute_depth_max(fb);
|
||||
update_framebuffer(ctx, fb);
|
||||
if (fbread != fb)
|
||||
update_framebuffer(ctx, fbread);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef WGLAPI
|
||||
#undef WGLAPI
|
||||
# undef WGLAPI
|
||||
#endif
|
||||
|
||||
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP)
|
||||
|
|
|
|||
|
|
@ -575,7 +575,11 @@ _mesa_ffs(int i)
|
|||
* if no bits set.
|
||||
*/
|
||||
int
|
||||
#ifdef __MINGW32__
|
||||
_mesa_ffsll(long val)
|
||||
#else
|
||||
_mesa_ffsll(long long val)
|
||||
#endif
|
||||
{
|
||||
#ifdef ffsll
|
||||
return ffsll(val);
|
||||
|
|
|
|||
|
|
@ -700,7 +700,11 @@ extern int
|
|||
_mesa_ffs(int i);
|
||||
|
||||
extern int
|
||||
#ifdef __MINGW32__
|
||||
_mesa_ffsll(long i);
|
||||
#else
|
||||
_mesa_ffsll(long long i);
|
||||
#endif
|
||||
|
||||
extern unsigned int
|
||||
_mesa_bitcount(unsigned int n);
|
||||
|
|
|
|||
|
|
@ -55,9 +55,6 @@ _mesa_LineWidth( GLfloat width )
|
|||
|
||||
FLUSH_VERTICES(ctx, _NEW_LINE);
|
||||
ctx->Line.Width = width;
|
||||
ctx->Line._Width = CLAMP(width,
|
||||
ctx->Const.MinLineWidth,
|
||||
ctx->Const.MaxLineWidth);
|
||||
|
||||
if (ctx->Driver.LineWidth)
|
||||
ctx->Driver.LineWidth(ctx, width);
|
||||
|
|
@ -105,13 +102,12 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
|
|||
* Initializes __GLcontextRec::Line and line related constants in
|
||||
* __GLcontextRec::Const.
|
||||
*/
|
||||
void GLAPIENTRY _mesa_init_line( GLcontext * ctx )
|
||||
void GLAPIENTRY
|
||||
_mesa_init_line( GLcontext * ctx )
|
||||
{
|
||||
/* Line group */
|
||||
ctx->Line.SmoothFlag = GL_FALSE;
|
||||
ctx->Line.StippleFlag = GL_FALSE;
|
||||
ctx->Line.Width = 1.0;
|
||||
ctx->Line._Width = 1.0;
|
||||
ctx->Line.StipplePattern = 0xffff;
|
||||
ctx->Line.StippleFactor = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -918,7 +918,6 @@ struct gl_line_attrib
|
|||
GLushort StipplePattern; /**< Stipple pattern */
|
||||
GLint StippleFactor; /**< Stipple repeat factor */
|
||||
GLfloat Width; /**< Line width */
|
||||
GLfloat _Width; /**< Clamped Line width */
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -1064,7 +1063,6 @@ struct gl_point_attrib
|
|||
{
|
||||
GLboolean SmoothFlag; /**< True if GL_POINT_SMOOTH is enabled */
|
||||
GLfloat Size; /**< User-specified point size */
|
||||
GLfloat _Size; /**< Size clamped to Const.Min/MaxPointSize */
|
||||
GLfloat Params[3]; /**< GL_EXT_point_parameters */
|
||||
GLfloat MinSize, MaxSize; /**< GL_EXT_point_parameters */
|
||||
GLfloat Threshold; /**< GL_EXT_point_parameters */
|
||||
|
|
@ -1134,13 +1132,13 @@ struct gl_stencil_attrib
|
|||
* An index for each type of texture object
|
||||
*/
|
||||
/*@{*/
|
||||
#define TEXTURE_1D_INDEX 0
|
||||
#define TEXTURE_2D_INDEX 1
|
||||
#define TEXTURE_3D_INDEX 2
|
||||
#define TEXTURE_CUBE_INDEX 3
|
||||
#define TEXTURE_RECT_INDEX 4
|
||||
#define TEXTURE_1D_ARRAY_INDEX 5
|
||||
#define TEXTURE_2D_ARRAY_INDEX 6
|
||||
#define TEXTURE_1D_INDEX 0
|
||||
#define TEXTURE_2D_INDEX 1
|
||||
#define TEXTURE_3D_INDEX 2
|
||||
#define TEXTURE_CUBE_INDEX 3
|
||||
#define TEXTURE_RECT_INDEX 4
|
||||
#define TEXTURE_1D_ARRAY_INDEX 5
|
||||
#define TEXTURE_2D_ARRAY_INDEX 6
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
|
|
@ -1148,13 +1146,13 @@ struct gl_stencil_attrib
|
|||
* Used for Texture.Unit[]._ReallyEnabled flags.
|
||||
*/
|
||||
/*@{*/
|
||||
#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX)
|
||||
#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX)
|
||||
#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX)
|
||||
#define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX)
|
||||
#define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX)
|
||||
#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX)
|
||||
#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX)
|
||||
#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX)
|
||||
#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX)
|
||||
#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX)
|
||||
#define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX)
|
||||
#define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX)
|
||||
#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX)
|
||||
#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX)
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
|
@ -1328,8 +1326,6 @@ struct gl_texture_format
|
|||
};
|
||||
|
||||
|
||||
#define MAX_3D_TEXTURE_SIZE (1 << (MAX_3D_TEXTURE_LEVELS - 1))
|
||||
|
||||
/**
|
||||
* Texture image state. Describes the dimensions of a texture image,
|
||||
* the texel format and pointers to Texel Fetch functions.
|
||||
|
|
@ -1394,7 +1390,7 @@ struct gl_texture_image
|
|||
#define FACE_NEG_Y 3
|
||||
#define FACE_POS_Z 4
|
||||
#define FACE_NEG_Z 5
|
||||
#define MAX_FACES 6
|
||||
#define MAX_FACES 6
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
|
@ -2194,12 +2190,11 @@ struct gl_shared_state
|
|||
* \todo Improve the granularity of locking.
|
||||
*/
|
||||
/*@{*/
|
||||
_glthread_Mutex TexMutex; /**< texobj thread safety */
|
||||
GLuint TextureStateStamp; /**< state notification for shared tex */
|
||||
_glthread_Mutex TexMutex; /**< texobj thread safety */
|
||||
GLuint TextureStateStamp; /**< state notification for shared tex */
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \name Vertex/fragment programs
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -57,10 +57,6 @@ _mesa_PointSize( GLfloat size )
|
|||
|
||||
FLUSH_VERTICES(ctx, _NEW_POINT);
|
||||
ctx->Point.Size = size;
|
||||
/* XXX correct clamp limits? */
|
||||
ctx->Point._Size = CLAMP(ctx->Point.Size,
|
||||
ctx->Point.MinSize,
|
||||
ctx->Point.MaxSize);
|
||||
|
||||
if (ctx->Driver.PointSize)
|
||||
ctx->Driver.PointSize(ctx, size);
|
||||
|
|
@ -253,7 +249,6 @@ _mesa_init_point(GLcontext *ctx)
|
|||
|
||||
ctx->Point.SmoothFlag = GL_FALSE;
|
||||
ctx->Point.Size = 1.0;
|
||||
ctx->Point._Size = 1.0;
|
||||
ctx->Point.Params[0] = 1.0;
|
||||
ctx->Point.Params[1] = 0.0;
|
||||
ctx->Point.Params[2] = 0.0;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ _mesa_CreateShader(GLenum type)
|
|||
}
|
||||
|
||||
|
||||
GLhandleARB APIENTRY
|
||||
GLhandleARB GLAPIENTRY
|
||||
_mesa_CreateShaderObjectARB(GLenum type)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
|
@ -99,7 +99,7 @@ _mesa_CreateProgram(void)
|
|||
}
|
||||
|
||||
|
||||
GLhandleARB APIENTRY
|
||||
GLhandleARB GLAPIENTRY
|
||||
_mesa_CreateProgramObjectARB(void)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
|
@ -319,7 +319,7 @@ _mesa_GetUniformivARB(GLhandleARB program, GLint location, GLint * params)
|
|||
|
||||
|
||||
#if 0
|
||||
GLint APIENTRY
|
||||
GLint GLAPIENTRY
|
||||
_mesa_GetUniformLocation(GLuint program, const GLcharARB *name)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
|
@ -336,7 +336,7 @@ _mesa_GetHandleARB(GLenum pname)
|
|||
}
|
||||
|
||||
|
||||
GLint APIENTRY
|
||||
GLint GLAPIENTRY
|
||||
_mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB *name)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
|
|
|||
|
|
@ -1068,7 +1068,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state)
|
|||
if (1/*new_state & _NEW_POINT*/) {
|
||||
if (ctx->Point.SmoothFlag)
|
||||
ctx->_TriangleCaps |= DD_POINT_SMOOTH;
|
||||
if (ctx->Point._Size != 1.0F)
|
||||
if (ctx->Point.Size != 1.0F)
|
||||
ctx->_TriangleCaps |= DD_POINT_SIZE;
|
||||
if (ctx->Point._Attenuated)
|
||||
ctx->_TriangleCaps |= DD_POINT_ATTEN;
|
||||
|
|
@ -1082,7 +1082,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state)
|
|||
ctx->_TriangleCaps |= DD_LINE_SMOOTH;
|
||||
if (ctx->Line.StippleFlag)
|
||||
ctx->_TriangleCaps |= DD_LINE_STIPPLE;
|
||||
if (ctx->Line._Width != 1.0)
|
||||
if (ctx->Line.Width != 1.0)
|
||||
ctx->_TriangleCaps |= DD_LINE_WIDTH;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -302,7 +302,12 @@ const struct gl_texture_format _mesa_texformat_rgba_fxt1 = {
|
|||
|
||||
#define FX64_NATIVE 1
|
||||
|
||||
#ifdef __MINGW32__
|
||||
typedef unsigned long Fx64;
|
||||
#else
|
||||
typedef unsigned long long Fx64;
|
||||
#endif
|
||||
|
||||
|
||||
#define FX64_MOV32(a, b) a = b
|
||||
#define FX64_OR32(a, b) a |= b
|
||||
|
|
|
|||
|
|
@ -536,7 +536,7 @@ new_not(slang_ir_node *n)
|
|||
static slang_ir_node *
|
||||
new_inlined_function_call(slang_ir_node *code, slang_label *name)
|
||||
{
|
||||
slang_ir_node *n = new_node1(IR_FUNC, code);
|
||||
slang_ir_node *n = new_node1(IR_CALL, code);
|
||||
assert(name);
|
||||
if (n)
|
||||
n->Label = name;
|
||||
|
|
@ -1202,17 +1202,29 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun,
|
|||
/* non-assembly function */
|
||||
inlined = slang_inline_function_call(A, fun, oper, dest);
|
||||
if (inlined && _slang_find_node_type(inlined, SLANG_OPER_RETURN)) {
|
||||
/* This inlined function has one or more 'return' statements.
|
||||
slang_operation *callOper;
|
||||
/* The function we're calling has one or more 'return' statements.
|
||||
* So, we can't truly inline this function because we need to
|
||||
* implement 'return' with RET (and CAL).
|
||||
* Nevertheless, we performed "inlining" to make a new instance
|
||||
* of the function body to deal with static register allocation.
|
||||
*
|
||||
* XXX check if there's one 'return' and if it's the very last
|
||||
* statement in the function - we can optimize that case.
|
||||
*/
|
||||
assert(inlined->type == SLANG_OPER_BLOCK_NEW_SCOPE ||
|
||||
inlined->type == SLANG_OPER_SEQUENCE);
|
||||
inlined->type = SLANG_OPER_INLINED_CALL;
|
||||
inlined->fun = fun;
|
||||
inlined->label = _slang_label_new_unique((char*) fun->header.a_name);
|
||||
if (_slang_function_has_return_value(fun) && !dest) {
|
||||
assert(inlined->children[0].type == SLANG_OPER_VARIABLE_DECL);
|
||||
assert(inlined->children[2].type == SLANG_OPER_IDENTIFIER);
|
||||
callOper = &inlined->children[1];
|
||||
}
|
||||
else {
|
||||
callOper = inlined;
|
||||
}
|
||||
callOper->type = SLANG_OPER_INLINED_CALL;
|
||||
callOper->fun = fun;
|
||||
callOper->label = _slang_label_new_unique((char*) fun->header.a_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1949,8 +1961,7 @@ static slang_ir_node *
|
|||
_slang_gen_return(slang_assemble_ctx * A, slang_operation *oper)
|
||||
{
|
||||
const GLboolean haveReturnValue
|
||||
= (oper->num_children == 1 &&
|
||||
oper->children[0].type != SLANG_OPER_VOID);
|
||||
= (oper->num_children == 1 && oper->children[0].type != SLANG_OPER_VOID);
|
||||
|
||||
/* error checking */
|
||||
assert(A->CurFunction);
|
||||
|
|
@ -1960,7 +1971,7 @@ _slang_gen_return(slang_assemble_ctx * A, slang_operation *oper)
|
|||
return NULL;
|
||||
}
|
||||
else if (!haveReturnValue &&
|
||||
A->CurFunction->header.type.specifier.type != SLANG_SPEC_VOID) {
|
||||
A->CurFunction->header.type.specifier.type != SLANG_SPEC_VOID) {
|
||||
slang_info_log_error(A->log, "return statement requires an expression");
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -2236,7 +2247,9 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
|
|||
}
|
||||
if (var->type.qualifier == SLANG_QUAL_CONST ||
|
||||
var->type.qualifier == SLANG_QUAL_ATTRIBUTE ||
|
||||
var->type.qualifier == SLANG_QUAL_UNIFORM) {
|
||||
var->type.qualifier == SLANG_QUAL_UNIFORM ||
|
||||
(var->type.qualifier == SLANG_QUAL_VARYING &&
|
||||
A->program->Target == GL_FRAGMENT_PROGRAM_ARB)) {
|
||||
slang_info_log_error(A->log,
|
||||
"illegal assignment to read-only variable '%s'",
|
||||
(char *) oper->children[0].a_id);
|
||||
|
|
@ -2264,10 +2277,11 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
|
|||
lhs = _slang_gen_operation(A, &oper->children[0]);
|
||||
|
||||
if (lhs) {
|
||||
if (lhs->Store->File != PROGRAM_OUTPUT &&
|
||||
lhs->Store->File != PROGRAM_TEMPORARY &&
|
||||
lhs->Store->File != PROGRAM_VARYING &&
|
||||
lhs->Store->File != PROGRAM_UNDEFINED) {
|
||||
if (!(lhs->Store->File == PROGRAM_OUTPUT ||
|
||||
lhs->Store->File == PROGRAM_TEMPORARY ||
|
||||
(lhs->Store->File == PROGRAM_VARYING &&
|
||||
A->program->Target == GL_VERTEX_PROGRAM_ARB) ||
|
||||
lhs->Store->File == PROGRAM_UNDEFINED)) {
|
||||
slang_info_log_error(A->log,
|
||||
"illegal assignment to read-only l-value");
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -780,16 +780,18 @@ emit_label(slang_emit_info *emitInfo, const slang_ir_node *n)
|
|||
|
||||
|
||||
/**
|
||||
* Emit code for an inlined function call (subroutine).
|
||||
* Emit code for a function call.
|
||||
* Note that for each time a function is called, we emit the function's
|
||||
* body code again because the set of available registers may be different.
|
||||
*/
|
||||
static struct prog_instruction *
|
||||
emit_func(slang_emit_info *emitInfo, slang_ir_node *n)
|
||||
emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n)
|
||||
{
|
||||
struct gl_program *progSave;
|
||||
struct prog_instruction *inst;
|
||||
GLuint subroutineId;
|
||||
|
||||
assert(n->Opcode == IR_FUNC);
|
||||
assert(n->Opcode == IR_CALL);
|
||||
assert(n->Label);
|
||||
|
||||
/* save/push cur program */
|
||||
|
|
@ -1687,10 +1689,10 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n)
|
|||
case IR_KILL:
|
||||
return emit_kill(emitInfo);
|
||||
|
||||
case IR_FUNC:
|
||||
/* new variable scope for subroutines/function calls*/
|
||||
case IR_CALL:
|
||||
/* new variable scope for subroutines/function calls */
|
||||
_slang_push_var_table(emitInfo->vt);
|
||||
inst = emit_func(emitInfo, n);
|
||||
inst = emit_fcall(emitInfo, n);
|
||||
_slang_pop_var_table(emitInfo->vt);
|
||||
return inst;
|
||||
|
||||
|
|
@ -1782,7 +1784,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo)
|
|||
emitInfo->NumSubroutines = 0;
|
||||
|
||||
/* Examine CAL instructions.
|
||||
* At this point, the BranchTarget field of the CAL instructions is
|
||||
* At this point, the BranchTarget field of the CAL instruction is
|
||||
* the number/id of the subroutine to call (an index into the
|
||||
* emitInfo->Subroutines list).
|
||||
* Translate that into an actual instruction location now.
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ _slang_print_ir_tree(const slang_ir_node *n, int indent)
|
|||
printf("RETURN\n");
|
||||
break;
|
||||
case IR_CALL:
|
||||
printf("CALL\n");
|
||||
printf("CALL %s\n", n->Label->Name);
|
||||
break;
|
||||
|
||||
case IR_LOOP:
|
||||
|
|
|
|||
|
|
@ -62,8 +62,6 @@ typedef enum
|
|||
IR_RETURN, /* return from subroutine */
|
||||
IR_CALL, /* call subroutine */
|
||||
|
||||
IR_FUNC, /* inlined function code */
|
||||
|
||||
IR_LOOP, /* high-level loop-begin / loop-end */
|
||||
/* Children[0] = loop body */
|
||||
/* Children[1] = loop tail code, or NULL */
|
||||
|
|
|
|||
|
|
@ -132,7 +132,9 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
|
|||
line.dx = line.x1 - line.x0;
|
||||
line.dy = line.y1 - line.y0;
|
||||
line.len = SQRTF(line.dx * line.dx + line.dy * line.dy);
|
||||
line.halfWidth = 0.5F * ctx->Line._Width;
|
||||
line.halfWidth = 0.5F * CLAMP(ctx->Line.Width,
|
||||
ctx->Const.MinLineWidthAA,
|
||||
ctx->Const.MaxLineWidthAA);
|
||||
|
||||
if (line.len == 0.0 || IS_INF_OR_NAN(line.len))
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5.3
|
||||
* Version: 7.1
|
||||
*
|
||||
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||
*
|
||||
|
|
@ -63,12 +63,13 @@ compute_stipple_mask( GLcontext *ctx, GLuint len, GLubyte mask[] )
|
|||
static void
|
||||
draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor )
|
||||
{
|
||||
GLint width, start;
|
||||
const GLint width = (GLint) CLAMP(ctx->Line.Width,
|
||||
ctx->Const.MinLineWidth,
|
||||
ctx->Const.MaxLineWidth);
|
||||
GLint start;
|
||||
|
||||
ASSERT(span->end < MAX_WIDTH);
|
||||
|
||||
width = (GLint) CLAMP( ctx->Line._Width, MIN_LINE_WIDTH, MAX_LINE_WIDTH );
|
||||
|
||||
if (width & 1)
|
||||
start = width / 2;
|
||||
else
|
||||
|
|
@ -143,7 +144,7 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor )
|
|||
span.arrayMask |= SPAN_MASK; \
|
||||
compute_stipple_mask(ctx, span.end, span.array->mask); \
|
||||
} \
|
||||
if (ctx->Line._Width > 1.0) { \
|
||||
if (ctx->Line.Width > 1.0) { \
|
||||
draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \
|
||||
} \
|
||||
else { \
|
||||
|
|
@ -161,7 +162,7 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor )
|
|||
span.arrayMask |= SPAN_MASK; \
|
||||
compute_stipple_mask(ctx, span.end, span.array->mask); \
|
||||
} \
|
||||
if (ctx->Line._Width > 1.0) { \
|
||||
if (ctx->Line.Width > 1.0) { \
|
||||
draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \
|
||||
} \
|
||||
else { \
|
||||
|
|
@ -180,7 +181,7 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor )
|
|||
span.arrayMask |= SPAN_MASK; \
|
||||
compute_stipple_mask(ctx, span.end, span.array->mask); \
|
||||
} \
|
||||
if (ctx->Line._Width > 1.0) { \
|
||||
if (ctx->Line.Width > 1.0) { \
|
||||
draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \
|
||||
} \
|
||||
else { \
|
||||
|
|
@ -274,16 +275,21 @@ _swrast_choose_line( GLcontext *ctx )
|
|||
USE(general_line);
|
||||
}
|
||||
else if (ctx->Depth.Test
|
||||
|| ctx->Line._Width != 1.0
|
||||
|| ctx->Line.Width != 1.0
|
||||
|| ctx->Line.StippleFlag) {
|
||||
/* no texture, but Z, fog, width>1, stipple, etc. */
|
||||
if (rgbmode)
|
||||
#if CHAN_BITS == 32
|
||||
USE(general_line);
|
||||
#else
|
||||
USE(rgba_line);
|
||||
#endif
|
||||
else
|
||||
USE(ci_line);
|
||||
}
|
||||
else {
|
||||
ASSERT(!ctx->Depth.Test);
|
||||
ASSERT(ctx->Line.Width == 1.0);
|
||||
/* simple lines */
|
||||
if (rgbmode)
|
||||
USE(simple_no_z_rgba_line);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ sprite_point(GLcontext *ctx, const SWvertex *vert)
|
|||
}
|
||||
else {
|
||||
/* use constant point size */
|
||||
size = ctx->Point._Size; /* already clamped to user range */
|
||||
size = ctx->Point.Size;
|
||||
}
|
||||
/* clamp to non-AA implementation limits */
|
||||
size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
|
||||
|
|
@ -227,7 +227,7 @@ smooth_point(GLcontext *ctx, const SWvertex *vert)
|
|||
}
|
||||
else {
|
||||
/* use constant point size */
|
||||
size = ctx->Point._Size; /* this is already clamped */
|
||||
size = ctx->Point.Size;
|
||||
}
|
||||
/* clamp to AA implementation limits */
|
||||
size = CLAMP(size, ctx->Const.MinPointSizeAA, ctx->Const.MaxPointSizeAA);
|
||||
|
|
@ -361,7 +361,7 @@ large_point(GLcontext *ctx, const SWvertex *vert)
|
|||
}
|
||||
else {
|
||||
/* use constant point size */
|
||||
size = ctx->Point._Size; /* already clamped to user range */
|
||||
size = ctx->Point.Size;
|
||||
}
|
||||
/* clamp to non-AA implementation limits */
|
||||
size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
|
||||
|
|
@ -550,7 +550,7 @@ _swrast_choose_point(GLcontext *ctx)
|
|||
else if (ctx->Point.SmoothFlag) {
|
||||
swrast->Point = smooth_point;
|
||||
}
|
||||
else if (ctx->Point._Size > 1.0 ||
|
||||
else if (ctx->Point.Size > 1.0 ||
|
||||
ctx->Point._Attenuated ||
|
||||
ctx->VertexProgram.PointSizeEnabled) {
|
||||
swrast->Point = large_point;
|
||||
|
|
|
|||
|
|
@ -1358,7 +1358,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
|
|||
|
||||
#if CHAN_BITS == 32
|
||||
if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) {
|
||||
interpolate_int_colors(ctx, span);
|
||||
interpolate_active_attribs(ctx, span, FRAG_BIT_COL0);
|
||||
}
|
||||
#else
|
||||
if ((span->arrayMask & SPAN_RGBA) == 0) {
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ void _tnl_get_attr( GLcontext *ctx, const void *vin,
|
|||
/* If the hardware vertex doesn't have point size then use size from
|
||||
* GLcontext. XXX this will be wrong if drawing attenuated points!
|
||||
*/
|
||||
dest[0] = ctx->Point._Size;
|
||||
dest[0] = ctx->Point.Size;
|
||||
}
|
||||
else {
|
||||
_mesa_memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat));
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ void TAG(translate_vertex)(GLcontext *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
dst->pointSize = ctx->Point._Size;
|
||||
dst->pointSize = ctx->Point.Size;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue