@@ -257,7 +257,7 @@ static const GLuint undef = REG(REG_TYPE_TEMP, | |||
GL_FALSE); | |||
/* constant one source */ | |||
static const GLuint pfs_one = REG(REG_TYPE_TEMP, | |||
static const GLuint pfs_one = REG(REG_TYPE_CONST, | |||
0, | |||
SWIZZLE_111, | |||
SWIZZLE_ONE, | |||
@@ -265,7 +265,7 @@ static const GLuint pfs_one = REG(REG_TYPE_TEMP, | |||
GL_TRUE); | |||
/* constant half source */ | |||
static const GLuint pfs_half = REG(REG_TYPE_TEMP, | |||
static const GLuint pfs_half = REG(REG_TYPE_CONST, | |||
0, | |||
SWIZZLE_HHH, | |||
SWIZZLE_HALF, | |||
@@ -273,7 +273,7 @@ static const GLuint pfs_half = REG(REG_TYPE_TEMP, | |||
GL_TRUE); | |||
/* constant zero source */ | |||
static const GLuint pfs_zero = REG(REG_TYPE_TEMP, | |||
static const GLuint pfs_zero = REG(REG_TYPE_CONST, | |||
0, | |||
SWIZZLE_000, | |||
SWIZZLE_ZERO, | |||
@@ -463,7 +463,8 @@ static int swz_native(struct r300_fragment_program *rp, | |||
GLuint arbneg) | |||
{ | |||
/* Native swizzle, handle negation */ | |||
src |= ((arbneg >> 3) & 1) << REG_NEGS_SHIFT; | |||
src = (src & ~REG_NEGS_SHIFT) | | |||
(((arbneg >> 3) & 1) << REG_NEGS_SHIFT); | |||
if ((arbneg & 0x7) == 0x0) { | |||
src = src & ~REG_NEGV_MASK; |
@@ -26,6 +26,8 @@ GLX_DIR = $(XORG_BASE)/GL/glx | |||
SERVER_OUTPUTS = $(GLX_DIR)/indirect_dispatch.c \ | |||
$(GLX_DIR)/indirect_dispatch_swap.c \ | |||
$(GLX_DIR)/indirect_dispatch.h \ | |||
$(GLX_DIR)/indirect_reqsize.c \ | |||
$(GLX_DIR)/indirect_reqsize.h \ | |||
$(GLX_DIR)/indirect_size_get.c \ | |||
$(GLX_DIR)/indirect_size_get.h \ | |||
$(GLX_DIR)/indirect_table.c | |||
@@ -37,7 +39,7 @@ API_XML = gl_API.xml \ | |||
COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py | |||
COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py | |||
INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce | |||
INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool | |||
all: $(OUTPUTS) | |||
@@ -104,6 +106,12 @@ $(GLX_DIR)/indirect_size_get.h: $(COMMON_GLX) glX_proto_size.py | |||
$(GLX_DIR)/indirect_size_get.c: $(COMMON_GLX) glX_proto_size.py | |||
$(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_c | indent $(INDENT_FLAGS) > $@ | |||
$(GLX_DIR)/indirect_reqsize.h: $(COMMON_GLX) glX_proto_size.py | |||
$(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' | indent $(INDENT_FLAGS) -l200 > $@ | |||
$(GLX_DIR)/indirect_reqsize.c: $(COMMON_GLX) glX_proto_size.py | |||
$(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m reqsize_c | indent $(INDENT_FLAGS) > $@ | |||
$(GLX_DIR)/indirect_table.c: $(COMMON_GLX) glX_server_table.py glX_API.xml | |||
$(PYTHON2) $(PYTHON_FLAGS) glX_server_table.py -f gl_and_glX_API.xml > $@ | |||
@@ -81,31 +81,12 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto): | |||
print '#include <GL/gl.h>' | |||
print '#include <GL/glxproto.h>' | |||
# FIXME: Since this block will require changes as other | |||
# FIXME: platforms are added, it should probably be in a | |||
# FIXME: header file that is not generated by a script. | |||
if self.do_swap: | |||
print '#ifdef __linux__' | |||
print '#include <byteswap.h>' | |||
print '#elif defined(__OpenBSD__)' | |||
print '#include <sys/endian.h>' | |||
print '#define bswap_16 __swap16' | |||
print '#define bswap_32 __swap32' | |||
print '#define bswap_64 __swap64' | |||
print '#else' | |||
print '#include <sys/endian.h>' | |||
print '#define bswap_16 bswap16' | |||
print '#define bswap_32 bswap32' | |||
print '#define bswap_64 bswap64' | |||
print '#endif' | |||
print '#include <inttypes.h>' | |||
print '#include "indirect_size.h"' | |||
print '#include "indirect_size_get.h"' | |||
print '#include "indirect_dispatch.h"' | |||
print '#include "glxserver.h"' | |||
print '#include "glxbyteorder.h"' | |||
print '#include "indirect_util.h"' | |||
print '#include "singlesize.h"' | |||
print '#include "glapitable.h"' |
@@ -447,17 +447,9 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common): | |||
print '' | |||
print '#include <GL/gl.h>' | |||
print '#include "glxserver.h"' | |||
print '#include "glxbyteorder.h"' | |||
print '#include "indirect_size.h"' | |||
print '#include "indirect_reqsize.h"' | |||
print '' | |||
print '#if defined(linux)' | |||
print '# include <byteswap.h>' | |||
print '# define SWAP_32(v) do { (v) = bswap_32(v); } while(0)' | |||
print '#else' | |||
print '# include <X11/misc.h>' | |||
print '# define SWAP_32(v) do { char tmp; swapl(&v, tmp); } while(0)' | |||
print '#endif' | |||
print '' | |||
print '#define __GLX_PAD(x) (((x) + 3) & ~3)' | |||
print '' | |||
@@ -538,7 +530,7 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common): | |||
if fixup: | |||
print ' if (swap) {' | |||
for name in fixup: | |||
print ' SWAP_32( %s );' % (name) | |||
print ' %s = bswap_32(%s);' % (name, name) | |||
print ' }' | |||
return |