Merge remote branch 'origin/gallium-0.2' into gallium-0.2
This commit is contained in:
commit
32e6be6362
2
Makefile
2
Makefile
|
@ -295,6 +295,8 @@ MAIN_FILES = \
|
|||
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/glslcompiler/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/glslcompiler/glslcompiler.c \
|
||||
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/x86/Makefile \
|
||||
|
|
|
@ -26,7 +26,7 @@ SDK = /opt/cell/sdk/usr
|
|||
|
||||
CFLAGS = $(OPT_FLAGS) -Wall -Winline -fPIC -m32 -std=c99 -mabi=altivec -maltivec \
|
||||
-I. -I$(SDK)/include \
|
||||
-DGALLIUM_CELL -DUSE_XSHM
|
||||
-DGALLIUM_CELL -DUSE_XSHM -D_BSD_SOURCE
|
||||
|
||||
CXXFLAGS = $(CFLAGS)
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ dnl Compiler macros
|
|||
DEFINES=""
|
||||
AC_SUBST([DEFINES])
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
*-gnu)
|
||||
if test "x$GCC" = xyes; then
|
||||
DEFINES="$DEFINES -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE"
|
||||
fi
|
||||
|
@ -271,14 +271,14 @@ if test "x$enable_asm" = xyes; then
|
|||
case "$host_cpu" in
|
||||
i?86)
|
||||
case "$host_os" in
|
||||
linux* | freebsd* | dragonfly*)
|
||||
linux* | *freebsd* | dragonfly*)
|
||||
test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
x86_64)
|
||||
case "$host_os" in
|
||||
linux* | freebsd* | dragonfly*)
|
||||
linux* | *freebsd* | dragonfly*)
|
||||
test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
|
||||
;;
|
||||
esac
|
||||
|
@ -368,7 +368,7 @@ linux*)
|
|||
i*86|x86_64|powerpc*) default_driver="dri";;
|
||||
esac
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
*freebsd* | dragonfly*)
|
||||
case "$host_cpu" in
|
||||
i*86|x86_64) default_driver="dri";;
|
||||
esac
|
||||
|
|
|
@ -46,9 +46,9 @@ extern "C" {
|
|||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glext.h last updated 2008/08/10 */
|
||||
/* glext.h last updated 2008/10/09 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GL_GLEXT_VERSION 41
|
||||
#define GL_GLEXT_VERSION 43
|
||||
|
||||
#ifndef GL_VERSION_1_2
|
||||
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
|
||||
|
@ -588,6 +588,132 @@ extern "C" {
|
|||
#define GL_QUERY_NO_WAIT 0x8E14
|
||||
#define GL_QUERY_BY_REGION_WAIT 0x8E15
|
||||
#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
|
||||
/* Reuse tokens from ARB_depth_buffer_float */
|
||||
/* reuse GL_DEPTH_COMPONENT32F */
|
||||
/* reuse GL_DEPTH32F_STENCIL8 */
|
||||
/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */
|
||||
/* Reuse tokens from ARB_framebuffer_object */
|
||||
/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
|
||||
/* reuse GL_FRAMEBUFFER_DEFAULT */
|
||||
/* reuse GL_FRAMEBUFFER_UNDEFINED */
|
||||
/* reuse GL_DEPTH_STENCIL_ATTACHMENT */
|
||||
/* reuse GL_INDEX */
|
||||
/* reuse GL_MAX_RENDERBUFFER_SIZE */
|
||||
/* reuse GL_DEPTH_STENCIL */
|
||||
/* reuse GL_UNSIGNED_INT_24_8 */
|
||||
/* reuse GL_DEPTH24_STENCIL8 */
|
||||
/* reuse GL_TEXTURE_STENCIL_SIZE */
|
||||
/* reuse GL_TEXTURE_RED_TYPE */
|
||||
/* reuse GL_TEXTURE_GREEN_TYPE */
|
||||
/* reuse GL_TEXTURE_BLUE_TYPE */
|
||||
/* reuse GL_TEXTURE_ALPHA_TYPE */
|
||||
/* reuse GL_TEXTURE_LUMINANCE_TYPE */
|
||||
/* reuse GL_TEXTURE_INTENSITY_TYPE */
|
||||
/* reuse GL_TEXTURE_DEPTH_TYPE */
|
||||
/* reuse GL_UNSIGNED_NORMALIZED */
|
||||
/* reuse GL_FRAMEBUFFER_BINDING */
|
||||
/* reuse GL_DRAW_FRAMEBUFFER_BINDING */
|
||||
/* reuse GL_RENDERBUFFER_BINDING */
|
||||
/* reuse GL_READ_FRAMEBUFFER */
|
||||
/* reuse GL_DRAW_FRAMEBUFFER */
|
||||
/* reuse GL_READ_FRAMEBUFFER_BINDING */
|
||||
/* reuse GL_RENDERBUFFER_SAMPLES */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
|
||||
/* reuse GL_FRAMEBUFFER_COMPLETE */
|
||||
/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
|
||||
/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
|
||||
/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
|
||||
/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
|
||||
/* reuse GL_FRAMEBUFFER_UNSUPPORTED */
|
||||
/* reuse GL_MAX_COLOR_ATTACHMENTS */
|
||||
/* reuse GL_COLOR_ATTACHMENT0 */
|
||||
/* reuse GL_COLOR_ATTACHMENT1 */
|
||||
/* reuse GL_COLOR_ATTACHMENT2 */
|
||||
/* reuse GL_COLOR_ATTACHMENT3 */
|
||||
/* reuse GL_COLOR_ATTACHMENT4 */
|
||||
/* reuse GL_COLOR_ATTACHMENT5 */
|
||||
/* reuse GL_COLOR_ATTACHMENT6 */
|
||||
/* reuse GL_COLOR_ATTACHMENT7 */
|
||||
/* reuse GL_COLOR_ATTACHMENT8 */
|
||||
/* reuse GL_COLOR_ATTACHMENT9 */
|
||||
/* reuse GL_COLOR_ATTACHMENT10 */
|
||||
/* reuse GL_COLOR_ATTACHMENT11 */
|
||||
/* reuse GL_COLOR_ATTACHMENT12 */
|
||||
/* reuse GL_COLOR_ATTACHMENT13 */
|
||||
/* reuse GL_COLOR_ATTACHMENT14 */
|
||||
/* reuse GL_COLOR_ATTACHMENT15 */
|
||||
/* reuse GL_DEPTH_ATTACHMENT */
|
||||
/* reuse GL_STENCIL_ATTACHMENT */
|
||||
/* reuse GL_FRAMEBUFFER */
|
||||
/* reuse GL_RENDERBUFFER */
|
||||
/* reuse GL_RENDERBUFFER_WIDTH */
|
||||
/* reuse GL_RENDERBUFFER_HEIGHT */
|
||||
/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */
|
||||
/* reuse GL_STENCIL_INDEX1 */
|
||||
/* reuse GL_STENCIL_INDEX4 */
|
||||
/* reuse GL_STENCIL_INDEX8 */
|
||||
/* reuse GL_STENCIL_INDEX16 */
|
||||
/* reuse GL_RENDERBUFFER_RED_SIZE */
|
||||
/* reuse GL_RENDERBUFFER_GREEN_SIZE */
|
||||
/* reuse GL_RENDERBUFFER_BLUE_SIZE */
|
||||
/* reuse GL_RENDERBUFFER_ALPHA_SIZE */
|
||||
/* reuse GL_RENDERBUFFER_DEPTH_SIZE */
|
||||
/* reuse GL_RENDERBUFFER_STENCIL_SIZE */
|
||||
/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
|
||||
/* reuse GL_MAX_SAMPLES */
|
||||
/* Reuse tokens from ARB_framebuffer_sRGB */
|
||||
/* reuse GL_FRAMEBUFFER_SRGB */
|
||||
/* Reuse tokens from ARB_half_float_vertex */
|
||||
/* reuse GL_HALF_FLOAT */
|
||||
/* Reuse tokens from ARB_map_buffer_range */
|
||||
/* reuse GL_MAP_READ_BIT */
|
||||
/* reuse GL_MAP_WRITE_BIT */
|
||||
/* reuse GL_MAP_INVALIDATE_RANGE_BIT */
|
||||
/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */
|
||||
/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */
|
||||
/* reuse GL_MAP_UNSYNCHRONIZED_BIT */
|
||||
/* Reuse tokens from ARB_texture_compression_rgtc */
|
||||
/* reuse GL_COMPRESSED_RED_RGTC1 */
|
||||
/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */
|
||||
/* reuse GL_COMPRESSED_RG_RGTC2 */
|
||||
/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */
|
||||
/* Reuse tokens from ARB_texture_rg */
|
||||
/* reuse GL_RG */
|
||||
/* reuse GL_RG_INTEGER */
|
||||
/* reuse GL_R8 */
|
||||
/* reuse GL_R16 */
|
||||
/* reuse GL_RG8 */
|
||||
/* reuse GL_RG16 */
|
||||
/* reuse GL_R16F */
|
||||
/* reuse GL_R32F */
|
||||
/* reuse GL_RG16F */
|
||||
/* reuse GL_RG32F */
|
||||
/* reuse GL_R8I */
|
||||
/* reuse GL_R8UI */
|
||||
/* reuse GL_R16I */
|
||||
/* reuse GL_R16UI */
|
||||
/* reuse GL_R32I */
|
||||
/* reuse GL_R32UI */
|
||||
/* reuse GL_RG8I */
|
||||
/* reuse GL_RG8UI */
|
||||
/* reuse GL_RG16I */
|
||||
/* reuse GL_RG16UI */
|
||||
/* reuse GL_RG32I */
|
||||
/* reuse GL_RG32UI */
|
||||
/* Reuse tokens from ARB_vertex_array_object */
|
||||
/* reuse GL_VERTEX_ARRAY_BINDING */
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_multitexture
|
||||
|
@ -1192,6 +1318,8 @@ extern "C" {
|
|||
#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
|
||||
#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
|
||||
#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
|
||||
/* reuse GL_MAX_VARYING_COMPONENTS */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_half_float_vertex
|
||||
|
@ -3696,6 +3824,16 @@ extern "C" {
|
|||
#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_direct_state_access
|
||||
#define GL_PROGRAM_MATRIX_EXT 0x8E2D
|
||||
#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E
|
||||
#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_vertex_array_bgra
|
||||
/* reuse GL_BGRA */
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
|
@ -4306,6 +4444,128 @@ typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei co
|
|||
|
||||
#ifndef GL_VERSION_3_0
|
||||
#define GL_VERSION_3_0 1
|
||||
/* OpenGL 3.0 also reuses entry points from these extensions: */
|
||||
/* ARB_framebuffer_object */
|
||||
/* ARB_map_buffer_range */
|
||||
/* ARB_vertex_array_object */
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glColorMaski (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
|
||||
GLAPI void APIENTRY glGetBooleani_v (GLenum, GLuint, GLboolean *);
|
||||
GLAPI void APIENTRY glGetIntegeri_v (GLenum, GLuint, GLint *);
|
||||
GLAPI void APIENTRY glEnablei (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDisablei (GLenum, GLuint);
|
||||
GLAPI GLboolean APIENTRY glIsEnabledi (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glBeginTransformFeedback (GLenum);
|
||||
GLAPI void APIENTRY glEndTransformFeedback (void);
|
||||
GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
|
||||
GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLint *, GLenum);
|
||||
GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLint *);
|
||||
GLAPI void APIENTRY glClampColor (GLenum, GLenum);
|
||||
GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum);
|
||||
GLAPI void APIENTRY glEndConditionalRender (void);
|
||||
GLAPI void APIENTRY glVertexAttribI1i (GLuint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI2i (GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI3i (GLuint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI1ui (GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI2ui (GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI1iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI2iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI3iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI1uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI2uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI3uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4bv (GLuint, const GLbyte *);
|
||||
GLAPI void APIENTRY glVertexAttribI4sv (GLuint, const GLshort *);
|
||||
GLAPI void APIENTRY glVertexAttribI4ubv (GLuint, const GLubyte *);
|
||||
GLAPI void APIENTRY glVertexAttribI4usv (GLuint, const GLushort *);
|
||||
GLAPI void APIENTRY glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glGetVertexAttribIiv (GLuint, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint, GLenum, GLuint *);
|
||||
GLAPI void APIENTRY glGetUniformuiv (GLuint, GLint, GLuint *);
|
||||
GLAPI void APIENTRY glBindFragDataLocation (GLuint, GLuint, const GLchar *);
|
||||
GLAPI GLint APIENTRY glGetFragDataLocation (GLuint, const GLchar *);
|
||||
GLAPI void APIENTRY glUniform1ui (GLint, GLuint);
|
||||
GLAPI void APIENTRY glUniform2ui (GLint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glUniform3ui (GLint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glUniform4ui (GLint, GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glUniform1uiv (GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glUniform2uiv (GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glUniform3uiv (GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glUniform4uiv (GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glTexParameterIiv (GLenum, GLenum, const GLint *);
|
||||
GLAPI void APIENTRY glTexParameterIuiv (GLenum, GLenum, const GLuint *);
|
||||
GLAPI void APIENTRY glGetTexParameterIiv (GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetTexParameterIuiv (GLenum, GLenum, GLuint *);
|
||||
GLAPI void APIENTRY glClearBufferiv (GLenum, GLint, const GLint *);
|
||||
GLAPI void APIENTRY glClearBufferuiv (GLenum, GLint, const GLuint *);
|
||||
GLAPI void APIENTRY glClearBufferfv (GLenum, GLint, const GLfloat *);
|
||||
GLAPI void APIENTRY glClearBufferfi (GLenum, GLint, GLfloat, GLint);
|
||||
GLAPI const GLubyte * APIENTRY glGetStringi (GLenum, GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
|
||||
typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
|
||||
typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
|
||||
typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
|
||||
typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
|
||||
typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
|
||||
typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
|
||||
typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
|
||||
typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
|
||||
typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
|
||||
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLint *location);
|
||||
typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
|
||||
typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);
|
||||
typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
|
||||
typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
|
||||
typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_multitexture
|
||||
|
@ -4893,10 +5153,58 @@ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
|
|||
|
||||
#ifndef GL_ARB_draw_instanced
|
||||
#define GL_ARB_draw_instanced 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum, GLint, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
|
||||
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_framebuffer_object
|
||||
#define GL_ARB_framebuffer_object 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint);
|
||||
GLAPI void APIENTRY glBindRenderbuffer (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenRenderbuffers (GLsizei, GLuint *);
|
||||
GLAPI void APIENTRY glRenderbufferStorage (GLenum, GLenum, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum, GLenum, GLint *);
|
||||
GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint);
|
||||
GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDeleteFramebuffers (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenFramebuffers (GLsizei, GLuint *);
|
||||
GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum);
|
||||
GLAPI void APIENTRY glFramebufferTexture1D (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTexture2D (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTexture3D (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum, GLenum, GLenum, GLuint);
|
||||
GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGenerateMipmap (GLenum);
|
||||
GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
|
||||
GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glFramebufferTextureLayer (GLenum, GLenum, GLuint, GLint, GLint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
|
||||
typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
|
||||
typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
|
||||
typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
|
||||
typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_framebuffer_sRGB
|
||||
|
@ -4905,6 +5213,16 @@ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
|
|||
|
||||
#ifndef GL_ARB_geometry_shader4
|
||||
#define GL_ARB_geometry_shader4 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glProgramParameteriARB (GLuint, GLenum, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTextureARB (GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum, GLenum, GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum, GLenum, GLuint, GLint, GLenum);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_half_float_vertex
|
||||
|
@ -4913,14 +5231,28 @@ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
|
|||
|
||||
#ifndef GL_ARB_instanced_arrays
|
||||
#define GL_ARB_instanced_arrays 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glVertexAttribDivisor (GLuint, GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_map_buffer_range
|
||||
#define GL_ARB_map_buffer_range 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield);
|
||||
GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
|
||||
typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_buffer_object
|
||||
#define GL_ARB_texture_buffer_object 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glTexBufferARB (GLenum, GLenum, GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_compression_rgtc
|
||||
|
@ -4933,6 +5265,16 @@ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
|
|||
|
||||
#ifndef GL_ARB_vertex_array_object
|
||||
#define GL_ARB_vertex_array_object 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBindVertexArray (GLuint);
|
||||
GLAPI void APIENTRY glDeleteVertexArrays (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenVertexArrays (GLsizei, GLuint *);
|
||||
GLAPI GLboolean APIENTRY glIsVertexArray (GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
|
||||
typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
|
||||
typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
|
||||
typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_abgr
|
||||
|
@ -7631,6 +7973,12 @@ typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
|
|||
|
||||
#ifndef GL_NV_conditional_render
|
||||
#define GL_NV_conditional_render 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint, GLenum);
|
||||
GLAPI void APIENTRY glEndConditionalRenderNV (void);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_present_video
|
||||
|
@ -7639,6 +7987,404 @@ typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
|
|||
|
||||
#ifndef GL_EXT_transform_feedback
|
||||
#define GL_EXT_transform_feedback 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum);
|
||||
GLAPI void APIENTRY glEndTransformFeedbackEXT (void);
|
||||
GLAPI void APIENTRY glBindBufferRangeEXT (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
|
||||
GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum, GLuint, GLuint, GLintptr);
|
||||
GLAPI void APIENTRY glBindBufferBaseEXT (GLenum, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLint *, GLenum);
|
||||
GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLint *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
|
||||
typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
|
||||
typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
|
||||
typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
|
||||
typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
|
||||
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLint *location);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_direct_state_access
|
||||
#define GL_EXT_direct_state_access 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield);
|
||||
GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield);
|
||||
GLAPI void APIENTRY glMatrixLoadfEXT (GLenum, const GLfloat *);
|
||||
GLAPI void APIENTRY glMatrixLoaddEXT (GLenum, const GLdouble *);
|
||||
GLAPI void APIENTRY glMatrixMultfEXT (GLenum, const GLfloat *);
|
||||
GLAPI void APIENTRY glMatrixMultdEXT (GLenum, const GLdouble *);
|
||||
GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum);
|
||||
GLAPI void APIENTRY glMatrixRotatefEXT (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glMatrixRotatedEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
|
||||
GLAPI void APIENTRY glMatrixScalefEXT (GLenum, GLfloat, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glMatrixScaledEXT (GLenum, GLdouble, GLdouble, GLdouble);
|
||||
GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum, GLfloat, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum, GLdouble, GLdouble, GLdouble);
|
||||
GLAPI void APIENTRY glMatrixFrustumEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
|
||||
GLAPI void APIENTRY glMatrixOrthoEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
|
||||
GLAPI void APIENTRY glMatrixPopEXT (GLenum);
|
||||
GLAPI void APIENTRY glMatrixPushEXT (GLenum);
|
||||
GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum, const GLfloat *);
|
||||
GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum, const GLdouble *);
|
||||
GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum, const GLfloat *);
|
||||
GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum, const GLdouble *);
|
||||
GLAPI void APIENTRY glTextureParameterfEXT (GLuint, GLenum, GLenum, GLfloat);
|
||||
GLAPI void APIENTRY glTextureParameterfvEXT (GLuint, GLenum, GLenum, const GLfloat *);
|
||||
GLAPI void APIENTRY glTextureParameteriEXT (GLuint, GLenum, GLenum, GLint);
|
||||
GLAPI void APIENTRY glTextureParameterivEXT (GLuint, GLenum, GLenum, const GLint *);
|
||||
GLAPI void APIENTRY glTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
|
||||
GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
|
||||
GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei);
|
||||
GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glGetTextureImageEXT (GLuint, GLenum, GLint, GLenum, GLenum, GLvoid *);
|
||||
GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint, GLenum, GLenum, GLfloat *);
|
||||
GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint, GLenum, GLint, GLenum, GLfloat *);
|
||||
GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint, GLenum, GLint, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum, GLenum, GLenum, GLfloat);
|
||||
GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum, GLenum, GLenum, const GLfloat *);
|
||||
GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum, GLenum, GLenum, GLint);
|
||||
GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum, GLenum, GLenum, const GLint *);
|
||||
GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
|
||||
GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
|
||||
GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei);
|
||||
GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum, GLenum, GLint, GLenum, GLenum, GLvoid *);
|
||||
GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum, GLenum, GLenum, GLfloat *);
|
||||
GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum, GLenum, GLint, GLenum, GLfloat *);
|
||||
GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum, GLenum, GLint, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glBindMultiTextureEXT (GLenum, GLenum, GLuint);
|
||||
GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum, GLint, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum, GLenum, GLenum, GLfloat);
|
||||
GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum, GLenum, GLenum, const GLfloat *);
|
||||
GLAPI void APIENTRY glMultiTexEnviEXT (GLenum, GLenum, GLenum, GLint);
|
||||
GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum, GLenum, GLenum, const GLint *);
|
||||
GLAPI void APIENTRY glMultiTexGendEXT (GLenum, GLenum, GLenum, GLdouble);
|
||||
GLAPI void APIENTRY glMultiTexGendvEXT (GLenum, GLenum, GLenum, const GLdouble *);
|
||||
GLAPI void APIENTRY glMultiTexGenfEXT (GLenum, GLenum, GLenum, GLfloat);
|
||||
GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum, GLenum, GLenum, const GLfloat *);
|
||||
GLAPI void APIENTRY glMultiTexGeniEXT (GLenum, GLenum, GLenum, GLint);
|
||||
GLAPI void APIENTRY glMultiTexGenivEXT (GLenum, GLenum, GLenum, const GLint *);
|
||||
GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum, GLenum, GLenum, GLfloat *);
|
||||
GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum, GLenum, GLenum, GLdouble *);
|
||||
GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum, GLenum, GLenum, GLfloat *);
|
||||
GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum, GLuint, GLfloat *);
|
||||
GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum, GLuint, GLdouble *);
|
||||
GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum, GLuint, GLvoid* *);
|
||||
GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint, GLenum, GLint, GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum, GLenum, GLint, GLvoid *);
|
||||
GLAPI void APIENTRY glNamedProgramStringEXT (GLuint, GLenum, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint, GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint, GLenum, GLuint, const GLdouble *);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint, GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint, GLenum, GLuint, const GLfloat *);
|
||||
GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint, GLenum, GLuint, GLdouble *);
|
||||
GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint, GLenum, GLuint, GLfloat *);
|
||||
GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint, GLenum, GLenum, GLvoid *);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint, GLenum, GLuint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint, GLenum, GLuint, GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint, GLenum, GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint, GLenum, GLuint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint, GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint, GLenum, GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint, GLenum, GLuint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint, GLenum, GLuint, GLint *);
|
||||
GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint, GLenum, GLuint, GLuint *);
|
||||
GLAPI void APIENTRY glTextureParameterIivEXT (GLuint, GLenum, GLenum, const GLint *);
|
||||
GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint, GLenum, GLenum, const GLuint *);
|
||||
GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint, GLenum, GLenum, GLuint *);
|
||||
GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum, GLenum, GLenum, const GLint *);
|
||||
GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, const GLuint *);
|
||||
GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, GLuint *);
|
||||
GLAPI void APIENTRY glProgramUniform1fEXT (GLuint, GLint, GLfloat);
|
||||
GLAPI void APIENTRY glProgramUniform2fEXT (GLuint, GLint, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glProgramUniform3fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glProgramUniform4fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glProgramUniform1iEXT (GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glProgramUniform2iEXT (GLuint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glProgramUniform3iEXT (GLuint, GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glProgramUniform4iEXT (GLuint, GLint, GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint, GLint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint, GLint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint, GLint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint, GLint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint, GLint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint, GLint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint, GLint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint, GLint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint, GLint, GLuint);
|
||||
GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint, GLint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint, GLint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint, GLint, GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint, GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint, GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint, GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint, GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glNamedBufferDataEXT (GLuint, GLsizeiptr, const GLvoid *, GLenum);
|
||||
GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, const GLvoid *);
|
||||
GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint, GLenum);
|
||||
GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint);
|
||||
GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint, GLenum, GLvoid* *);
|
||||
GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, GLvoid *);
|
||||
GLAPI void APIENTRY glTextureBufferEXT (GLuint, GLenum, GLenum, GLuint);
|
||||
GLAPI void APIENTRY glMultiTexBufferEXT (GLenum, GLenum, GLenum, GLuint);
|
||||
GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint, GLenum, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint, GLenum, GLint *);
|
||||
GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint, GLenum);
|
||||
GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint, GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint, GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint, GLenum, GLenum, GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint, GLenum, GLenum, GLuint);
|
||||
GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint, GLenum);
|
||||
GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum, GLenum);
|
||||
GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint, GLenum);
|
||||
GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint, GLsizei, const GLenum *);
|
||||
GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint, GLenum);
|
||||
GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint, GLsizei, GLenum, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint, GLsizei, GLsizei, GLenum, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint, GLenum, GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint, GLenum, GLuint, GLint, GLenum);
|
||||
GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint, GLenum, GLuint);
|
||||
GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum, GLenum, GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
|
||||
typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
|
||||
typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m);
|
||||
typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m);
|
||||
typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m);
|
||||
typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);
|
||||
typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
|
||||
typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
|
||||
typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
|
||||
typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);
|
||||
typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
|
||||
typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data);
|
||||
typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data);
|
||||
typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
|
||||
typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
|
||||
typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
|
||||
typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
|
||||
typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params);
|
||||
typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);
|
||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);
|
||||
typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
|
||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
|
||||
typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_vertex_array_bgra
|
||||
#define GL_EXT_vertex_array_bgra 1
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -38,8 +38,12 @@
|
|||
#include <GL/gl.h>
|
||||
|
||||
#ifndef GLAPIENTRY
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#define GLAPIENTRY __stdcall
|
||||
#else
|
||||
#define GLAPIENTRY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GLAPIENTRYP
|
||||
#define GLAPIENTRYP GLAPIENTRY *
|
||||
|
|
|
@ -290,17 +290,25 @@ extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
|
|||
extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
|
||||
unsigned long *mask );
|
||||
|
||||
|
||||
/* GLX 1.4 and later */
|
||||
extern void (*glXGetProcAddress(const GLubyte *procname))( void );
|
||||
|
||||
|
||||
#ifndef GLX_GLXEXT_LEGACY
|
||||
|
||||
#include <GL/glxext.h>
|
||||
|
||||
#else
|
||||
|
||||
/* GLX 1.3 function pointer typedefs */
|
||||
typedef GLXFBConfig * (* PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef GLXFBConfig * (* PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
typedef int (* PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
typedef XVisualInfo * (* PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
|
||||
typedef GLXWindow (* PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
typedef void (* PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
|
||||
typedef GLXPixmap (* PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
typedef void (* PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
|
||||
typedef GLXPbuffer (* PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
typedef void (* PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef void (* PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
typedef GLXContext (* PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef Bool (* PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable (* PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
|
||||
typedef Display * (* PFNGLXGETCURRENTDISPLAYPROC) (void);
|
||||
typedef int (* PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
typedef void (* PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
typedef void (* PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -316,6 +324,17 @@ extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
|
|||
|
||||
|
||||
|
||||
/* GLX 1.4 and later */
|
||||
extern void (*glXGetProcAddress(const GLubyte *procname))( void );
|
||||
|
||||
/* GLX 1.4 function pointer typedefs */
|
||||
typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
|
||||
|
||||
|
||||
#ifndef GLX_GLXEXT_LEGACY
|
||||
|
||||
#include <GL/glxext.h>
|
||||
|
||||
#endif /* GLX_GLXEXT_LEGACY */
|
||||
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ extern "C" {
|
|||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glxext.h last updated 2008/08/10 */
|
||||
/* glxext.h last updated 2008/10/22 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GLX_GLXEXT_VERSION 20
|
||||
#define GLX_GLXEXT_VERSION 21
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
|
@ -347,25 +347,33 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#ifndef GLX_NV_present_video
|
||||
#define GLX_GLX_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_video_out
|
||||
#define GLX_GLX_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define GLX_GLX_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define GLX_GLX_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define GLX_GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define GLX_GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define GLX_GLX_VIDEO_OUT_FRAME_NV 0x20C8
|
||||
#define GLX_GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
|
||||
#define GLX_GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
|
||||
#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
|
||||
#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
|
||||
#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
|
||||
#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
|
||||
#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
|
||||
#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
|
||||
#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_swap_group
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_create_context
|
||||
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define GLX_CONTEXT_FLAGS_ARB 0x2094
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
|
@ -809,6 +817,14 @@ typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawab
|
|||
#define GLX_NV_swap_group 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_create_context
|
||||
#define GLX_ARB_create_context 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXContext glXCreateContextAttribsARB (Display *, GLXFBConfig, GLXContext, Bool, const int *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ PROGS = \
|
|||
noise \
|
||||
points \
|
||||
pointcoord \
|
||||
skinning \
|
||||
texdemo1 \
|
||||
toyball \
|
||||
twoside \
|
||||
|
@ -148,6 +149,13 @@ pointcoord: pointcoord.o readtex.o shaderutil.o
|
|||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
|
||||
skinning.o: skinning.c readtex.h extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) skinning.c
|
||||
|
||||
skinning: skinning.o readtex.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
|
||||
texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
|
||||
|
||||
|
|
|
@ -141,9 +141,6 @@ Redisplay(void)
|
|||
|
||||
glPopMatrix();
|
||||
|
||||
glFinish();
|
||||
glFlush();
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
glutSwapBuffers();
|
||||
|
|
|
@ -439,8 +439,6 @@ static void draw()
|
|||
|
||||
glPopMatrix();
|
||||
|
||||
glFlush();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ static GLuint fragShader;
|
|||
static GLuint vertShader;
|
||||
static GLuint program;
|
||||
static GLint win = 0;
|
||||
static GLboolean anim = GL_TRUE;
|
||||
static GLboolean anim = GL_FALSE;
|
||||
static GLfloat xRot = 0.0f, yRot = 0.0f;
|
||||
static int w,h;
|
||||
|
||||
|
|
|
@ -74,8 +74,6 @@ Redisplay(void)
|
|||
|
||||
glPopMatrix();
|
||||
|
||||
glFinish();
|
||||
glFlush();
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
|
|
@ -7,9 +7,29 @@
|
|||
uniform sampler2D tex1;
|
||||
uniform sampler2D tex2;
|
||||
|
||||
void main()
|
||||
vec4 sample(sampler2D t, vec2 coord)
|
||||
{
|
||||
return texture2D(t, coord);
|
||||
}
|
||||
|
||||
void main0()
|
||||
{
|
||||
vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
|
||||
vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
|
||||
//vec4 t1 = sample(tex1, gl_TexCoord[0].xy);
|
||||
//vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
|
||||
vec4 t2 = sample(tex2, gl_TexCoord[0].xy);
|
||||
gl_FragColor = mix(t1, t2, t2.w);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 t1 = sample(tex1, gl_TexCoord[0].xy);
|
||||
vec4 t2 = sample(tex2, gl_TexCoord[0].xy);
|
||||
gl_FragColor = t1 + t2;
|
||||
}
|
||||
/*
|
||||
0: MOV SAMPLER[0].x, SAMPLER[0];
|
||||
1: MOV TEMP[1], INPUT[4];
|
||||
2: TEX OUTPUT[0], TEMP[1], texture[0], 2D;
|
||||
3: END
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,280 @@
|
|||
/**
|
||||
* Vertex "skinning" example.
|
||||
* The idea is there are multiple modeling matrices applied to every
|
||||
* vertex. Weighting values in [0,1] control the influence of each
|
||||
* matrix on each vertex.
|
||||
*
|
||||
* 4 Nov 2008
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
#include "extfuncs.h"
|
||||
#include "shaderutil.h"
|
||||
|
||||
|
||||
static char *FragProgFile = "skinning.frag";
|
||||
static char *VertProgFile = "skinning.vert";
|
||||
|
||||
/* program/shader objects */
|
||||
static GLuint fragShader;
|
||||
static GLuint vertShader;
|
||||
static GLuint program;
|
||||
|
||||
|
||||
static GLint win = 0;
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
static GLboolean WireFrame = GL_TRUE;
|
||||
static GLfloat xRot = 0.0f, yRot = 90.0f, zRot = 0.0f;
|
||||
|
||||
#define NUM_MATS 2
|
||||
|
||||
static GLfloat Matrices[NUM_MATS][16];
|
||||
static GLint uMat0, uMat1;
|
||||
static GLint WeightAttr;
|
||||
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
{
|
||||
yRot = 90 + glutGet(GLUT_ELAPSED_TIME) * 0.005;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Cylinder(GLfloat length, GLfloat radius, GLint slices, GLint stacks)
|
||||
{
|
||||
float dw = 1.0 / (stacks - 1);
|
||||
float dz = length / stacks;
|
||||
int i, j;
|
||||
|
||||
for (j = 0; j < stacks; j++) {
|
||||
float w0 = j * dw;
|
||||
float z0 = j * dz;
|
||||
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
for (i = 0; i < slices; i++) {
|
||||
float a = (float) i / (slices - 1) * M_PI * 2.0;
|
||||
float x = radius * cos(a);
|
||||
float y = radius * sin(a);
|
||||
glVertexAttrib1f_func(WeightAttr, w0);
|
||||
glNormal3f(x, y, 0.0);
|
||||
glVertex3f(x, y, z0);
|
||||
|
||||
glVertexAttrib1f_func(WeightAttr, w0 + dw);
|
||||
glNormal3f(x, y, 0.0);
|
||||
glVertex3f(x, y, z0 + dz);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update/animate the two matrices. One rotates, the other scales.
|
||||
*/
|
||||
static void
|
||||
UpdateMatrices(void)
|
||||
{
|
||||
GLfloat t = glutGet(GLUT_ELAPSED_TIME) * 0.0025;
|
||||
GLfloat scale = 0.5 * (1.1 + sin(0.5 * t));
|
||||
GLfloat rot = cos(t) * 90.0;
|
||||
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glScalef(1.0, scale, 1.0);
|
||||
glGetFloatv(GL_MODELVIEW_MATRIX, Matrices[0]);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glRotatef(rot, 0, 0, 1);
|
||||
glGetFloatv(GL_MODELVIEW_MATRIX, Matrices[1]);
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
UpdateMatrices();
|
||||
|
||||
glUniformMatrix4fv_func(uMat0, 1, GL_FALSE, Matrices[0]);
|
||||
glUniformMatrix4fv_func(uMat1, 1, GL_FALSE, Matrices[1]);
|
||||
|
||||
if (WireFrame)
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
else
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
|
||||
glRotatef(zRot, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(0, 0, -2.5);
|
||||
Cylinder(5.0, 1.0, 10, 20);
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Reshape(int width, int height)
|
||||
{
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0f, 0.0f, -15.0f);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CleanUp(void)
|
||||
{
|
||||
glDeleteShader_func(fragShader);
|
||||
glDeleteShader_func(vertShader);
|
||||
glDeleteProgram_func(program);
|
||||
glutDestroyWindow(win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 2.0;
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case 'a':
|
||||
Anim = !Anim;
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
break;
|
||||
case 'w':
|
||||
WireFrame = !WireFrame;
|
||||
break;
|
||||
case 'z':
|
||||
zRot += step;
|
||||
break;
|
||||
case 'Z':
|
||||
zRot -= step;
|
||||
break;
|
||||
case 27:
|
||||
CleanUp();
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
SpecialKey(int key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 2.0;
|
||||
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case GLUT_KEY_UP:
|
||||
xRot += step;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
xRot -= step;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
yRot -= step;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
yRot += step;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
if (!ShadersSupported())
|
||||
exit(1);
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile);
|
||||
fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile);
|
||||
program = LinkShaders(vertShader, fragShader);
|
||||
|
||||
glUseProgram_func(program);
|
||||
|
||||
uMat0 = glGetUniformLocation_func(program, "mat0");
|
||||
uMat1 = glGetUniformLocation_func(program, "mat1");
|
||||
|
||||
WeightAttr = glGetAttribLocation_func(program, "weight");
|
||||
|
||||
assert(glGetError() == 0);
|
||||
|
||||
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glColor3f(1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ParseOptions(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-fs") == 0) {
|
||||
FragProgFile = argv[i+1];
|
||||
}
|
||||
else if (strcmp(argv[i], "-vs") == 0) {
|
||||
VertProgFile = argv[i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowSize(500, 500);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
glutDisplayFunc(Redisplay);
|
||||
ParseOptions(argc, argv);
|
||||
Init();
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
// color pass-through
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = gl_Color;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Vertex weighting/blendin shader
|
||||
// Brian Paul
|
||||
// 4 Nov 2008
|
||||
|
||||
uniform mat4 mat0, mat1;
|
||||
attribute float weight;
|
||||
|
||||
void main()
|
||||
{
|
||||
// simple diffuse shading
|
||||
// Note that we should really transform the normal vector along with
|
||||
// the postion below... someday.
|
||||
vec3 lightVec = vec3(0, 0, 1);
|
||||
vec3 norm = gl_NormalMatrix * gl_Normal;
|
||||
float dot = 0.2 + max(0.0, dot(norm, lightVec));
|
||||
gl_FrontColor = vec4(dot);
|
||||
|
||||
// compute sum of weighted transformations
|
||||
vec4 pos0 = mat0 * gl_Vertex;
|
||||
vec4 pos1 = mat1 * gl_Vertex;
|
||||
vec4 pos = mix(pos0, pos1, weight);
|
||||
|
||||
gl_Position = gl_ModelViewProjectionMatrix * pos;
|
||||
}
|
|
@ -79,8 +79,6 @@ Redisplay(void)
|
|||
|
||||
glPopMatrix();
|
||||
|
||||
glFinish();
|
||||
glFlush();
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,15 @@ static void Key(unsigned char key, int x, int y)
|
|||
|
||||
switch (key) {
|
||||
case 27:
|
||||
printf("Exiting...\n");
|
||||
exit(1);
|
||||
case 'r':
|
||||
printf("Redisplaying...\n");
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
default:
|
||||
printf("No such key '%c'...\n", key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +97,7 @@ static void Draw(void)
|
|||
glEnd();
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
glStencilFunc(GL_EQUAL, 1, 1);
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
|
||||
|
||||
|
@ -130,7 +138,8 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 300, 300);
|
||||
glutInitWindowPosition(0, 0);
|
||||
glutInitWindowSize( 300, 300);
|
||||
|
||||
type = GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH | GLUT_STENCIL;
|
||||
glutInitDisplayMode(type);
|
||||
|
|
|
@ -80,6 +80,7 @@ CompileShaderFile(GLenum shaderType, const char *filename)
|
|||
|
||||
FILE *f = fopen(filename, "r");
|
||||
if (!f) {
|
||||
fprintf(stderr, "Unable to open shader file %s\n", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,13 +26,13 @@ INCLUDES = -I. -I$(TOP)/include -I../samples
|
|||
.SUFFIXES: .c
|
||||
|
||||
.c:
|
||||
$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
|
||||
$(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
$(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
.S.o:
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
$(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
!!VP1.0
|
||||
EXP R0, v[COL0].x;
|
||||
ADD o[COL0], R0.z, -R0.w;
|
||||
MOV o[HPOS], v[OPOS];
|
||||
!!ARBvp1.0
|
||||
TEMP R0;
|
||||
EXP R0, vertex.color.x;
|
||||
SUB result.color, R0.z, R0.w;
|
||||
MOV result.position, vertex.position;
|
||||
END
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
!!VP1.0
|
||||
ADD R0, v[COL0], v[COL0];
|
||||
!!ARBvp1.0
|
||||
TEMP R0;
|
||||
ADD R0, vertex.color, vertex.color;
|
||||
ADD R0, R0, R0;
|
||||
LOG o[COL0], R0.x;
|
||||
MOV o[HPOS], v[OPOS];
|
||||
LOG result.color, R0.x;
|
||||
MOV result.position, vertex.position;
|
||||
END
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
|
@ -15,6 +14,8 @@
|
|||
#include <GL/glext.h>
|
||||
#endif
|
||||
|
||||
#include <GL/glut.h>
|
||||
|
||||
#ifdef WIN32
|
||||
static PFNGLBINDPROGRAMARBPROC glBindProgramARB = NULL;
|
||||
static PFNGLGENPROGRAMSARBPROC glGenProgramsARB = NULL;
|
||||
|
|
|
@ -419,6 +419,52 @@ init(void)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove window border/decorations.
|
||||
*/
|
||||
static void
|
||||
no_border( Display *dpy, Window w)
|
||||
{
|
||||
static const unsigned MWM_HINTS_DECORATIONS = (1 << 1);
|
||||
static const int PROP_MOTIF_WM_HINTS_ELEMENTS = 5;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long functions;
|
||||
unsigned long decorations;
|
||||
long inputMode;
|
||||
unsigned long status;
|
||||
} PropMotifWmHints;
|
||||
|
||||
PropMotifWmHints motif_hints;
|
||||
Atom prop, proptype;
|
||||
unsigned long flags = 0;
|
||||
|
||||
/* setup the property */
|
||||
motif_hints.flags = MWM_HINTS_DECORATIONS;
|
||||
motif_hints.decorations = flags;
|
||||
|
||||
/* get the atom for the property */
|
||||
prop = XInternAtom( dpy, "_MOTIF_WM_HINTS", True );
|
||||
if (!prop) {
|
||||
/* something went wrong! */
|
||||
return;
|
||||
}
|
||||
|
||||
/* not sure this is correct, seems to work, XA_WM_HINTS didn't work */
|
||||
proptype = prop;
|
||||
|
||||
XChangeProperty( dpy, w, /* display, window */
|
||||
prop, proptype, /* property, type */
|
||||
32, /* format: 32-bit datums */
|
||||
PropModeReplace, /* mode */
|
||||
(unsigned char *) &motif_hints, /* data */
|
||||
PROP_MOTIF_WM_HINTS_ELEMENTS /* nelements */
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create an RGB, double-buffered window.
|
||||
* Return the window and context handles.
|
||||
|
@ -479,13 +525,15 @@ make_window( Display *dpy, const char *name,
|
|||
attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
|
||||
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
|
||||
/* XXX this is a bad way to get a borderless window! */
|
||||
attr.override_redirect = fullscreen;
|
||||
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect;
|
||||
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
|
||||
|
||||
win = XCreateWindow( dpy, root, x, y, width, height,
|
||||
0, visinfo->depth, InputOutput,
|
||||
visinfo->visual, mask, &attr );
|
||||
|
||||
if (fullscreen)
|
||||
no_border(dpy, win);
|
||||
|
||||
/* set hints and properties */
|
||||
{
|
||||
XSizeHints sizehints;
|
||||
|
|
|
@ -121,7 +121,7 @@ static char ** extension_table = NULL;
|
|||
static unsigned num_extensions;
|
||||
|
||||
static GLboolean use_ztrick = GL_FALSE;
|
||||
static GLfloat aspect;
|
||||
static GLfloat aspectX = 1.0f, aspectY = 1.0f;
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -313,13 +313,13 @@ draw(void)
|
|||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -aspect, aspect, 5.0, 60.0);
|
||||
glFrustum(-aspectX, aspectX, -aspectY, aspectY, 5.0, 60.0);
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -40.0);
|
||||
glTranslatef(0.0, 0.0, -45.0);
|
||||
}
|
||||
else {
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
@ -356,17 +356,23 @@ draw(void)
|
|||
static void
|
||||
reshape(int width, int height)
|
||||
{
|
||||
aspect = (GLfloat) height / (GLfloat) width;
|
||||
|
||||
if (width > height) {
|
||||
aspectX = (GLfloat) width / (GLfloat) height;
|
||||
aspectY = 1.0;
|
||||
}
|
||||
else {
|
||||
aspectX = 1.0;
|
||||
aspectY = (GLfloat) height / (GLfloat) width;
|
||||
}
|
||||
|
||||
glViewport(0, 0, (GLint) width, (GLint) height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
||||
glFrustum(-1.0, 1.0, -aspect, aspect, 5.0, 60.0);
|
||||
glFrustum(-aspectX, aspectX, -aspectY, aspectY, 5.0, 60.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -40.0);
|
||||
glTranslatef(0.0, 0.0, -45.0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -407,13 +413,59 @@ init(void)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove window border/decorations.
|
||||
*/
|
||||
static void
|
||||
no_border( Display *dpy, Window w)
|
||||
{
|
||||
static const unsigned MWM_HINTS_DECORATIONS = (1 << 1);
|
||||
static const int PROP_MOTIF_WM_HINTS_ELEMENTS = 5;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long functions;
|
||||
unsigned long decorations;
|
||||
long inputMode;
|
||||
unsigned long status;
|
||||
} PropMotifWmHints;
|
||||
|
||||
PropMotifWmHints motif_hints;
|
||||
Atom prop, proptype;
|
||||
unsigned long flags = 0;
|
||||
|
||||
/* setup the property */
|
||||
motif_hints.flags = MWM_HINTS_DECORATIONS;
|
||||
motif_hints.decorations = flags;
|
||||
|
||||
/* get the atom for the property */
|
||||
prop = XInternAtom( dpy, "_MOTIF_WM_HINTS", True );
|
||||
if (!prop) {
|
||||
/* something went wrong! */
|
||||
return;
|
||||
}
|
||||
|
||||
/* not sure this is correct, seems to work, XA_WM_HINTS didn't work */
|
||||
proptype = prop;
|
||||
|
||||
XChangeProperty( dpy, w, /* display, window */
|
||||
prop, proptype, /* property, type */
|
||||
32, /* format: 32-bit datums */
|
||||
PropModeReplace, /* mode */
|
||||
(unsigned char *) &motif_hints, /* data */
|
||||
PROP_MOTIF_WM_HINTS_ELEMENTS /* nelements */
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create an RGB, double-buffered window.
|
||||
* Return the window and context handles.
|
||||
*/
|
||||
static void
|
||||
make_window( Display *dpy, const char *name,
|
||||
int x, int y, int width, int height,
|
||||
int x, int y, int width, int height, GLboolean fullscreen,
|
||||
Window *winRet, GLXContext *ctxRet)
|
||||
{
|
||||
int attrib[] = { GLX_RGBA,
|
||||
|
@ -434,6 +486,12 @@ make_window( Display *dpy, const char *name,
|
|||
scrnum = DefaultScreen( dpy );
|
||||
root = RootWindow( dpy, scrnum );
|
||||
|
||||
if (fullscreen) {
|
||||
x = y = 0;
|
||||
width = DisplayWidth( dpy, scrnum );
|
||||
height = DisplayHeight( dpy, scrnum );
|
||||
}
|
||||
|
||||
visinfo = glXChooseVisual( dpy, scrnum, attrib );
|
||||
if (!visinfo) {
|
||||
printf("Error: couldn't get an RGB, Double-buffered visual\n");
|
||||
|
@ -464,6 +522,9 @@ make_window( Display *dpy, const char *name,
|
|||
None, (char **)NULL, 0, &sizehints);
|
||||
}
|
||||
|
||||
if (fullscreen)
|
||||
no_border(dpy, win);
|
||||
|
||||
ctx = glXCreateContext( dpy, visinfo, NULL, True );
|
||||
if (!ctx) {
|
||||
printf("Error: glXCreateContext failed\n");
|
||||
|
@ -572,7 +633,6 @@ event_loop(Display *dpy, Window win)
|
|||
* Display the refresh rate of the display using the GLX_OML_sync_control
|
||||
* extension.
|
||||
*/
|
||||
|
||||
static void
|
||||
show_refresh_rate( Display * dpy )
|
||||
{
|
||||
|
@ -599,7 +659,6 @@ show_refresh_rate( Display * dpy )
|
|||
* \param string String of GLX extensions.
|
||||
* \sa is_extension_supported
|
||||
*/
|
||||
|
||||
static void
|
||||
make_extension_table( const char * string )
|
||||
{
|
||||
|
@ -679,7 +738,6 @@ make_extension_table( const char * string )
|
|||
* \return GL_TRUE of the extension is supported, GL_FALSE otherwise.
|
||||
* \sa make_extension_table
|
||||
*/
|
||||
|
||||
static GLboolean
|
||||
is_extension_supported( const char * ext )
|
||||
{
|
||||
|
@ -705,11 +763,12 @@ main(int argc, char *argv[])
|
|||
int swap_interval = 1;
|
||||
GLboolean do_swap_interval = GL_FALSE;
|
||||
GLboolean force_get_rate = GL_FALSE;
|
||||
GLboolean fullscreen = GL_FALSE;
|
||||
GLboolean printInfo = GL_FALSE;
|
||||
int i;
|
||||
PFNGLXSWAPINTERVALMESAPROC set_swap_interval = NULL;
|
||||
PFNGLXGETSWAPINTERVALMESAPROC get_swap_interval = NULL;
|
||||
|
||||
int width = 300, height = 300;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-display") == 0 && i + 1 < argc) {
|
||||
|
@ -731,6 +790,9 @@ main(int argc, char *argv[])
|
|||
*/
|
||||
force_get_rate = GL_TRUE;
|
||||
}
|
||||
else if (strcmp(argv[i], "-fullscreen") == 0) {
|
||||
fullscreen = GL_TRUE;
|
||||
}
|
||||
else if (strcmp(argv[i], "-ztrick") == 0) {
|
||||
use_ztrick = GL_TRUE;
|
||||
}
|
||||
|
@ -743,6 +805,7 @@ main(int argc, char *argv[])
|
|||
printf(" -info Display GL information\n");
|
||||
printf(" -swap N Swap no more than once per N vertical refreshes\n");
|
||||
printf(" -forcegetrate Try to use glXGetMscRateOML function\n");
|
||||
printf(" -fullscreen Full-screen window\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -753,7 +816,7 @@ main(int argc, char *argv[])
|
|||
return -1;
|
||||
}
|
||||
|
||||
make_window(dpy, "glxgears", 0, 0, 300, 300, &win, &ctx);
|
||||
make_window(dpy, "glxgears", 0, 0, width, height, fullscreen, &win, &ctx);
|
||||
XMapWindow(dpy, win);
|
||||
glXMakeCurrent(dpy, win, ctx);
|
||||
|
||||
|
@ -817,7 +880,7 @@ main(int argc, char *argv[])
|
|||
/* Set initial projection/viewing transformation.
|
||||
* same as glxgears.c
|
||||
*/
|
||||
reshape(300, 300);
|
||||
reshape(width, height);
|
||||
|
||||
event_loop(dpy, win);
|
||||
|
||||
|
|
|
@ -67,10 +67,10 @@
|
|||
|
||||
#define CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T))
|
||||
|
||||
static const EGLint all_apis = (EGL_OPENGL_ES_BIT |
|
||||
EGL_OPENGL_ES2_BIT |
|
||||
EGL_OPENVG_BIT |
|
||||
EGL_OPENGL_BIT);
|
||||
static const EGLint all_apis = (EGL_OPENGL_ES_BIT
|
||||
| EGL_OPENGL_ES2_BIT
|
||||
| EGL_OPENVG_BIT
|
||||
/* | EGL_OPENGL_BIT */); /* can't do */
|
||||
|
||||
struct visual_attribs
|
||||
{
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include "draw/draw_context.h"
|
||||
#include "draw/draw_private.h"
|
||||
#include "draw/draw_pt.h"
|
||||
#include "draw/draw_vs.h"
|
||||
#include "tgsi/tgsi_dump.h"
|
||||
|
||||
static unsigned trim( unsigned count, unsigned first, unsigned incr )
|
||||
{
|
||||
|
@ -176,6 +178,92 @@ void draw_pt_destroy( struct draw_context *draw )
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Debug- print the first 'count' vertices.
|
||||
*/
|
||||
static void
|
||||
draw_print_arrays(struct draw_context *draw, uint prim, int start, uint count)
|
||||
{
|
||||
uint i;
|
||||
|
||||
debug_printf("Draw arrays(prim = %u, start = %u, count = %u)\n",
|
||||
prim, start, count);
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
uint ii, j;
|
||||
|
||||
if (draw->pt.user.elts) {
|
||||
/* indexed arrays */
|
||||
switch (draw->pt.user.eltSize) {
|
||||
case 1:
|
||||
{
|
||||
const ubyte *elem = (const ubyte *) draw->pt.user.elts;
|
||||
ii = elem[start + i];
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
const ushort *elem = (const ushort *) draw->pt.user.elts;
|
||||
ii = elem[start + i];
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
const uint *elem = (const uint *) draw->pt.user.elts;
|
||||
ii = elem[start + i];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
debug_printf("Element[%u + %u] -> Vertex %u:\n", start, i, ii);
|
||||
}
|
||||
else {
|
||||
/* non-indexed arrays */
|
||||
ii = start + i;
|
||||
debug_printf("Vertex %u:\n", ii);
|
||||
}
|
||||
|
||||
for (j = 0; j < draw->pt.nr_vertex_elements; j++) {
|
||||
uint buf = draw->pt.vertex_element[j].vertex_buffer_index;
|
||||
ubyte *ptr = (ubyte *) draw->pt.user.vbuffer[buf];
|
||||
ptr += draw->pt.vertex_buffer[buf].pitch * ii;
|
||||
ptr += draw->pt.vertex_element[j].src_offset;
|
||||
|
||||
debug_printf(" Attr %u: ", j);
|
||||
switch (draw->pt.vertex_element[j].src_format) {
|
||||
case PIPE_FORMAT_R32_FLOAT:
|
||||
{
|
||||
float *v = (float *) ptr;
|
||||
debug_printf("%f @ %p\n", v[0], (void *) v);
|
||||
}
|
||||
break;
|
||||
case PIPE_FORMAT_R32G32_FLOAT:
|
||||
{
|
||||
float *v = (float *) ptr;
|
||||
debug_printf("%f %f @ %p\n", v[0], v[1], (void *) v);
|
||||
}
|
||||
break;
|
||||
case PIPE_FORMAT_R32G32B32_FLOAT:
|
||||
{
|
||||
float *v = (float *) ptr;
|
||||
debug_printf("%f %f %f @ %p\n", v[0], v[1], v[2], (void *) v);
|
||||
}
|
||||
break;
|
||||
case PIPE_FORMAT_R32G32B32A32_FLOAT:
|
||||
{
|
||||
float *v = (float *) ptr;
|
||||
debug_printf("%f %f %f %f @ %p\n", v[0], v[1], v[2], v[3],
|
||||
(void *) v);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
debug_printf("other format (fix me)\n");
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -195,6 +283,31 @@ draw_arrays(struct draw_context *draw, unsigned prim,
|
|||
draw->reduced_prim = reduced_prim;
|
||||
}
|
||||
|
||||
if (0)
|
||||
draw_print_arrays(draw, prim, start, MIN2(count, 20));
|
||||
|
||||
#if 0
|
||||
{
|
||||
int i;
|
||||
debug_printf("draw_arrays(prim=%u start=%u count=%u):\n",
|
||||
prim, start, count);
|
||||
tgsi_dump(draw->vs.vertex_shader->state.tokens, 0);
|
||||
debug_printf("Elements:\n");
|
||||
for (i = 0; i < draw->pt.nr_vertex_elements; i++) {
|
||||
debug_printf(" format=%s comps=%u\n",
|
||||
pf_name(draw->pt.vertex_element[i].src_format),
|
||||
draw->pt.vertex_element[i].nr_components);
|
||||
}
|
||||
debug_printf("Buffers:\n");
|
||||
for (i = 0; i < draw->pt.nr_vertex_buffers; i++) {
|
||||
debug_printf(" pitch=%u offset=%u ptr=%p\n",
|
||||
draw->pt.vertex_buffer[i].pitch,
|
||||
draw->pt.vertex_buffer[i].buffer_offset,
|
||||
draw->pt.user.vbuffer[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* drawing done here: */
|
||||
draw_pt_arrays(draw, prim, start, count);
|
||||
}
|
||||
|
|
|
@ -1632,6 +1632,17 @@ static boolean emit_SUB( struct aos_compilation *cp, const struct tgsi_full_inst
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean emit_TRUNC( struct aos_compilation *cp, const struct tgsi_full_instruction *op )
|
||||
{
|
||||
struct x86_reg arg0 = fetch_src(cp, &op->FullSrcRegisters[0]);
|
||||
struct x86_reg tmp0 = aos_get_xmm_reg(cp);
|
||||
|
||||
sse2_cvttps2dq(cp->func, tmp0, arg0);
|
||||
sse2_cvtdq2ps(cp->func, tmp0, tmp0);
|
||||
|
||||
store_dest(cp, &op->FullDstRegisters[0], tmp0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean emit_XPD( struct aos_compilation *cp, const struct tgsi_full_instruction *op )
|
||||
{
|
||||
|
@ -1770,6 +1781,9 @@ emit_instruction( struct aos_compilation *cp,
|
|||
case TGSI_OPCODE_SIN:
|
||||
return emit_SIN(cp, inst);
|
||||
|
||||
case TGSI_OPCODE_TRUNC:
|
||||
return emit_TRUNC(cp, inst);
|
||||
|
||||
case TGSI_OPCODE_END:
|
||||
return TRUE;
|
||||
|
||||
|
@ -2176,7 +2190,8 @@ static struct draw_vs_varient *varient_aos_sse( struct draw_vertex_shader *vs,
|
|||
if (!vaos->buffer)
|
||||
goto fail;
|
||||
|
||||
debug_printf("nr_vb: %d const: %x\n", vaos->nr_vb, vaos->base.key.const_vbuffers);
|
||||
if (0)
|
||||
debug_printf("nr_vb: %d const: %x\n", vaos->nr_vb, vaos->base.key.const_vbuffers);
|
||||
|
||||
#if 0
|
||||
tgsi_dump(vs->state.tokens, 0);
|
||||
|
|
|
@ -123,6 +123,12 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
|
|||
input = (const float (*)[4])((const char *)input + input_stride);
|
||||
}
|
||||
|
||||
tgsi_set_exec_mask(machine,
|
||||
1,
|
||||
max_vertices > 1,
|
||||
max_vertices > 2,
|
||||
max_vertices > 3);
|
||||
|
||||
/* run interpreter */
|
||||
tgsi_exec_machine_run( machine );
|
||||
|
||||
|
|
|
@ -54,31 +54,16 @@
|
|||
typedef void (PIPE_CDECL *codegen_function) (float (*inputs)[4][4],
|
||||
float (*outputs)[4][4],
|
||||
float (*temps)[4][4],
|
||||
float (*immeds)[4][4],
|
||||
float (*immeds)[4],
|
||||
float (*consts)[4],
|
||||
const float *builtins);
|
||||
|
||||
#if 0
|
||||
const struct tgsi_exec_vector *input,
|
||||
struct tgsi_exec_vector *output,
|
||||
float (*constant)[4], /* 3 */
|
||||
struct tgsi_exec_vector *temporary, /* 4 */
|
||||
float (*immediates)[4], /* 5 */
|
||||
const float (*aos_input)[4], /* 6 */
|
||||
uint num_inputs, /* 7 */
|
||||
uint input_stride, /* 8 */
|
||||
float (*aos_output)[4], /* 9 */
|
||||
uint num_outputs, /* 10 */
|
||||
uint output_stride ); /* 11 */
|
||||
#endif
|
||||
|
||||
struct draw_ppc_vertex_shader {
|
||||
struct draw_vertex_shader base;
|
||||
struct ppc_function ppc_program;
|
||||
|
||||
codegen_function func;
|
||||
|
||||
struct tgsi_exec_machine *machine;
|
||||
};
|
||||
|
||||
|
||||
|
@ -86,11 +71,12 @@ static void
|
|||
vs_ppc_prepare( struct draw_vertex_shader *base,
|
||||
struct draw_context *draw )
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Simplified vertex shader interface for the pt paths. Given the
|
||||
/**
|
||||
* Simplified vertex shader interface for the pt paths. Given the
|
||||
* complexity of code-generating all the above operations together,
|
||||
* it's time to try doing all the other stuff separately.
|
||||
*/
|
||||
|
@ -104,7 +90,6 @@ vs_ppc_run_linear( struct draw_vertex_shader *base,
|
|||
unsigned output_stride )
|
||||
{
|
||||
struct draw_ppc_vertex_shader *shader = (struct draw_ppc_vertex_shader *)base;
|
||||
struct tgsi_exec_machine *machine = shader->machine;
|
||||
unsigned int i;
|
||||
|
||||
#define MAX_VERTICES 4
|
||||
|
@ -137,27 +122,11 @@ vs_ppc_run_linear( struct draw_vertex_shader *base,
|
|||
|
||||
/* run compiled shader
|
||||
*/
|
||||
#if 0
|
||||
shader->func(machine->Inputs,
|
||||
machine->Outputs,
|
||||
(float (*)[4])constants,
|
||||
machine->Temps,
|
||||
(float (*)[4])shader->base.immediates,
|
||||
input,
|
||||
base->info.num_inputs,
|
||||
input_stride,
|
||||
output,
|
||||
base->info.num_outputs,
|
||||
output_stride );
|
||||
#else
|
||||
shader->func(inputs_soa, outputs_soa, temps_soa,
|
||||
(float (*)[4][4]) shader->base.immediates,
|
||||
(float (*)[4]) shader->base.immediates,
|
||||
(float (*)[4]) constants,
|
||||
ppc_builtin_constants);
|
||||
|
||||
/*output[0][0] = input[0][0] * 0.5;*/
|
||||
#endif
|
||||
|
||||
/* convert (up to) four output verts from SoA back to AoS format */
|
||||
for (attr = 0; attr < base->info.num_outputs; attr++) {
|
||||
float *vOut = (float *) output;
|
||||
|
@ -183,8 +152,6 @@ vs_ppc_run_linear( struct draw_vertex_shader *base,
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
vs_ppc_delete( struct draw_vertex_shader *base )
|
||||
{
|
||||
|
@ -201,7 +168,7 @@ vs_ppc_delete( struct draw_vertex_shader *base )
|
|||
|
||||
struct draw_vertex_shader *
|
||||
draw_create_vs_ppc(struct draw_context *draw,
|
||||
const struct pipe_shader_state *templ)
|
||||
const struct pipe_shader_state *templ)
|
||||
{
|
||||
struct draw_ppc_vertex_shader *vs;
|
||||
|
||||
|
@ -227,16 +194,14 @@ draw_create_vs_ppc(struct draw_context *draw,
|
|||
vs->base.run_linear = vs_ppc_run_linear;
|
||||
vs->base.delete = vs_ppc_delete;
|
||||
|
||||
vs->base.immediates = align_malloc(TGSI_EXEC_NUM_IMMEDIATES * 4 * 4 *
|
||||
vs->base.immediates = align_malloc(TGSI_EXEC_NUM_IMMEDIATES * 4 *
|
||||
sizeof(float), 16);
|
||||
|
||||
vs->machine = &draw->vs.machine;
|
||||
|
||||
ppc_init_func( &vs->ppc_program, 2000 ); /* XXX fix limit */
|
||||
ppc_init_func( &vs->ppc_program );
|
||||
|
||||
if (!tgsi_emit_ppc( (struct tgsi_token *) vs->base.state.tokens,
|
||||
&vs->ppc_program,
|
||||
(float (*)[4])vs->base.immediates,
|
||||
(float (*)[4]) vs->base.immediates,
|
||||
TRUE ))
|
||||
goto fail;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include "draw_vs.h"
|
||||
|
||||
#if defined(PIPE_ARCH_X86) && defined(PIPE_ARCH_SSE)
|
||||
#if defined(PIPE_ARCH_X86)
|
||||
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
|
||||
|
@ -99,9 +99,23 @@ vs_sse_run_linear( struct draw_vertex_shader *base,
|
|||
struct tgsi_exec_machine *machine = shader->machine;
|
||||
unsigned int i;
|
||||
|
||||
/* By default, execute all channels. XXX move this inside the loop
|
||||
* below when we support shader conditionals/loops.
|
||||
*/
|
||||
tgsi_set_exec_mask(machine, 1, 1, 1, 1);
|
||||
|
||||
for (i = 0; i < count; i += MAX_TGSI_VERTICES) {
|
||||
unsigned int max_vertices = MIN2(MAX_TGSI_VERTICES, count - i);
|
||||
|
||||
if (max_vertices < 4) {
|
||||
/* disable the unused execution channels */
|
||||
tgsi_set_exec_mask(machine,
|
||||
1,
|
||||
max_vertices > 1,
|
||||
max_vertices > 2,
|
||||
0);
|
||||
}
|
||||
|
||||
/* run compiled shader
|
||||
*/
|
||||
shader->func(machine->Inputs,
|
||||
|
|
|
@ -179,8 +179,7 @@ struct gallivm_cpu_engine * gallivm_global_cpu_engine()
|
|||
|
||||
typedef void (*vertex_shader_runner)(void *ainputs,
|
||||
void *dests,
|
||||
float (*aconsts)[4],
|
||||
void *temps);
|
||||
float (*aconsts)[4]);
|
||||
|
||||
#define MAX_TGSI_VERTICES 4
|
||||
/*!
|
||||
|
@ -223,8 +222,7 @@ int gallivm_cpu_vs_exec(struct gallivm_prog *prog,
|
|||
/* run shader */
|
||||
runner(machine->Inputs,
|
||||
machine->Outputs,
|
||||
(float (*)[4]) constants,
|
||||
machine->Temps);
|
||||
(float (*)[4]) constants);
|
||||
|
||||
/* Unswizzle all output results
|
||||
*/
|
||||
|
|
|
@ -48,13 +48,11 @@ using namespace llvm;
|
|||
StorageSoa::StorageSoa(llvm::BasicBlock *block,
|
||||
llvm::Value *input,
|
||||
llvm::Value *output,
|
||||
llvm::Value *consts,
|
||||
llvm::Value *temps)
|
||||
llvm::Value *consts)
|
||||
: m_block(block),
|
||||
m_input(input),
|
||||
m_output(output),
|
||||
m_consts(consts),
|
||||
m_temps(temps),
|
||||
m_immediates(0),
|
||||
m_idx(0)
|
||||
{
|
||||
|
@ -169,7 +167,7 @@ std::vector<llvm::Value*> StorageSoa::constElement(llvm::IRBuilder<>* m_builder,
|
|||
{
|
||||
llvm::Value* res;
|
||||
std::vector<llvm::Value*> res2(4);
|
||||
llvm::Value *xChannel, *yChannel, *zChannel, *wChannel;
|
||||
llvm::Value *xChannel;
|
||||
|
||||
xChannel = elementPointer(m_consts, idx, 0);
|
||||
|
||||
|
@ -195,14 +193,15 @@ std::vector<llvm::Value*> StorageSoa::outputElement(llvm::Value *idx)
|
|||
return res;
|
||||
}
|
||||
|
||||
std::vector<llvm::Value*> StorageSoa::tempElement(llvm::Value *idx)
|
||||
std::vector<llvm::Value*> StorageSoa::tempElement(llvm::IRBuilder<>* m_builder, int idx)
|
||||
{
|
||||
std::vector<llvm::Value*> res(4);
|
||||
llvm::Value *temp = m_temps[idx];
|
||||
|
||||
res[0] = element(m_temps, idx, 0);
|
||||
res[1] = element(m_temps, idx, 1);
|
||||
res[2] = element(m_temps, idx, 2);
|
||||
res[3] = element(m_temps, idx, 3);
|
||||
res[0] = element(temp, constantInt(0), 0);
|
||||
res[1] = element(temp, constantInt(0), 1);
|
||||
res[2] = element(temp, constantInt(0), 2);
|
||||
res[3] = element(temp, constantInt(0), 3);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -326,7 +325,7 @@ std::vector<llvm::Value*> StorageSoa::load(enum tgsi_file_type type, int idx, in
|
|||
val = outputElement(realIndex);
|
||||
break;
|
||||
case TGSI_FILE_TEMPORARY:
|
||||
val = tempElement(realIndex);
|
||||
val = tempElement(m_builder, idx);
|
||||
break;
|
||||
case TGSI_FILE_CONSTANT:
|
||||
val = constElement(m_builder, realIndex);
|
||||
|
@ -355,19 +354,39 @@ std::vector<llvm::Value*> StorageSoa::load(enum tgsi_file_type type, int idx, in
|
|||
return res;
|
||||
}
|
||||
|
||||
llvm::Value * StorageSoa::allocaTemp(llvm::IRBuilder<>* m_builder)
|
||||
{
|
||||
VectorType *vector = VectorType::get(Type::FloatTy, 4);
|
||||
ArrayType *vecArray = ArrayType::get(vector, 4);
|
||||
AllocaInst *alloca = new AllocaInst(vecArray, "temp",
|
||||
m_builder->GetInsertBlock());
|
||||
|
||||
return alloca;
|
||||
}
|
||||
|
||||
|
||||
void StorageSoa::store(enum tgsi_file_type type, int idx, const std::vector<llvm::Value*> &val,
|
||||
int mask)
|
||||
int mask, llvm::IRBuilder<>* m_builder)
|
||||
{
|
||||
llvm::Value *out = 0;
|
||||
llvm::Value *realIndex = 0;
|
||||
switch(type) {
|
||||
case TGSI_FILE_OUTPUT:
|
||||
out = m_output;
|
||||
realIndex = constantInt(idx);
|
||||
break;
|
||||
case TGSI_FILE_TEMPORARY:
|
||||
out = m_temps;
|
||||
// if that temp doesn't already exist, alloca it
|
||||
if (m_temps.find(idx) == m_temps.end())
|
||||
m_temps[idx] = allocaTemp(m_builder);
|
||||
|
||||
out = m_temps[idx];
|
||||
|
||||
realIndex = constantInt(0);
|
||||
break;
|
||||
case TGSI_FILE_INPUT:
|
||||
out = m_input;
|
||||
realIndex = constantInt(idx);
|
||||
break;
|
||||
case TGSI_FILE_ADDRESS: {
|
||||
llvm::Value *addr = m_addresses[idx];
|
||||
|
@ -385,7 +404,6 @@ void StorageSoa::store(enum tgsi_file_type type, int idx, const std::vector<llvm
|
|||
assert(0);
|
||||
break;
|
||||
}
|
||||
llvm::Value *realIndex = constantInt(idx);
|
||||
if ((mask & TGSI_WRITEMASK_X)) {
|
||||
llvm::Value *xChannel = elementPointer(out, realIndex, 0);
|
||||
new StoreInst(val[0], xChannel, false, m_block);
|
||||
|
|
|
@ -52,14 +52,13 @@ public:
|
|||
StorageSoa(llvm::BasicBlock *block,
|
||||
llvm::Value *input,
|
||||
llvm::Value *output,
|
||||
llvm::Value *consts,
|
||||
llvm::Value *temps);
|
||||
llvm::Value *consts);
|
||||
|
||||
|
||||
std::vector<llvm::Value*> load(enum tgsi_file_type type, int idx, int swizzle,
|
||||
llvm::IRBuilder<>* m_builder, llvm::Value *indIdx =0);
|
||||
void store(enum tgsi_file_type type, int idx, const std::vector<llvm::Value*> &val,
|
||||
int mask);
|
||||
int mask, llvm::IRBuilder<>* m_builder);
|
||||
|
||||
void addImmediate(float *vec);
|
||||
void declareImmediates();
|
||||
|
@ -84,7 +83,7 @@ private:
|
|||
llvm::Value* unpackConstElement(llvm::IRBuilder<>* m_builder, llvm::Value *indIdx, int cc);
|
||||
std::vector<llvm::Value*> constElement(llvm::IRBuilder<>* m_builder, llvm::Value *indIdx);
|
||||
std::vector<llvm::Value*> outputElement(llvm::Value *indIdx);
|
||||
std::vector<llvm::Value*> tempElement(llvm::Value *indIdx);
|
||||
std::vector<llvm::Value*> tempElement(llvm::IRBuilder<>* m_builder, int idx);
|
||||
std::vector<llvm::Value*> immediateElement(llvm::Value *indIdx);
|
||||
private:
|
||||
llvm::BasicBlock *m_block;
|
||||
|
@ -92,12 +91,13 @@ private:
|
|||
llvm::Value *m_input;
|
||||
llvm::Value *m_output;
|
||||
llvm::Value *m_consts;
|
||||
llvm::Value *m_temps;
|
||||
std::map<int, llvm::Value*> m_temps;
|
||||
llvm::GlobalVariable *m_immediates;
|
||||
|
||||
std::map<int, llvm::Value*> m_addresses;
|
||||
|
||||
std::vector<std::vector<float> > m_immediatesToFlush;
|
||||
llvm::Value * allocaTemp(llvm::IRBuilder<>* m_builder);
|
||||
|
||||
mutable std::map<int, llvm::ConstantInt*> m_constInts;
|
||||
mutable char m_name[32];
|
||||
|
|
|
@ -53,7 +53,6 @@ static inline FunctionType *vertexShaderFunctionType()
|
|||
// [4 x <4 x float>] inputs,
|
||||
// [4 x <4 x float>] output,
|
||||
// [4 x [1 x float]] consts,
|
||||
// [4 x <4 x float>] temps
|
||||
|
||||
std::vector<const Type*> funcArgs;
|
||||
VectorType *vectorType = VectorType::get(Type::FloatTy, 4);
|
||||
|
@ -67,7 +66,6 @@ static inline FunctionType *vertexShaderFunctionType()
|
|||
funcArgs.push_back(vectorArrayPtr);//inputs
|
||||
funcArgs.push_back(vectorArrayPtr);//output
|
||||
funcArgs.push_back(constsArrayPtr);//consts
|
||||
funcArgs.push_back(vectorArrayPtr);//temps
|
||||
|
||||
FunctionType *functionType = FunctionType::get(
|
||||
/*Result=*/Type::VoidTy,
|
||||
|
@ -246,7 +244,6 @@ translate_instruction(llvm::Module *module,
|
|||
val = storage->constElement(src->SrcRegister.Index, indIdx);
|
||||
} else if (src->SrcRegister.File == TGSI_FILE_INPUT) {
|
||||
val = storage->inputElement(src->SrcRegister.Index, indIdx);
|
||||
// FIXME we should not be generating elements for temporaries, this creates useless memory writes
|
||||
} else if (src->SrcRegister.File == TGSI_FILE_TEMPORARY) {
|
||||
val = storage->tempElement(src->SrcRegister.Index);
|
||||
} else if (src->SrcRegister.File == TGSI_FILE_OUTPUT) {
|
||||
|
@ -677,7 +674,6 @@ translate_instruction(llvm::Module *module,
|
|||
|
||||
if (dst->DstRegister.File == TGSI_FILE_OUTPUT) {
|
||||
storage->setOutputElement(dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
|
||||
// FIXME we should not be generating elements for temporaries, this creates useless memory writes
|
||||
} else if (dst->DstRegister.File == TGSI_FILE_TEMPORARY) {
|
||||
storage->setTempElement(dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
|
||||
} else if (dst->DstRegister.File == TGSI_FILE_ADDRESS) {
|
||||
|
@ -1027,7 +1023,8 @@ translate_instructionir(llvm::Module *module,
|
|||
for (int i = 0; i < inst->Instruction.NumDstRegs; ++i) {
|
||||
struct tgsi_full_dst_register *dst = &inst->FullDstRegisters[i];
|
||||
storage->store((enum tgsi_file_type)dst->DstRegister.File,
|
||||
dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
|
||||
dst->DstRegister.Index, out, dst->DstRegister.WriteMask,
|
||||
instr->getIRBuilder() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1122,8 +1119,6 @@ llvm::Module * tgsi_to_llvmir(struct gallivm_ir *ir,
|
|||
output->setName("outputs");
|
||||
Value *consts = args++;
|
||||
consts->setName("consts");
|
||||
Value *temps = args++;
|
||||
temps->setName("temps");
|
||||
|
||||
BasicBlock *label_entry = BasicBlock::Create("entry", shader, 0);
|
||||
|
||||
|
@ -1132,7 +1127,7 @@ llvm::Module * tgsi_to_llvmir(struct gallivm_ir *ir,
|
|||
fi = tgsi_default_full_instruction();
|
||||
fd = tgsi_default_full_declaration();
|
||||
|
||||
StorageSoa storage(label_entry, input, output, consts, temps);
|
||||
StorageSoa storage(label_entry, input, output, consts);
|
||||
InstructionsSoa instr(mod, shader, label_entry, &storage);
|
||||
|
||||
while(!tgsi_parse_end_of_tokens(&parse)) {
|
||||
|
|
|
@ -177,12 +177,16 @@ pb_get_base_buffer( struct pb_buffer *buf,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Don't call this directly. Use pb_reference instead.
|
||||
*/
|
||||
static INLINE void
|
||||
pb_destroy(struct pb_buffer *buf)
|
||||
{
|
||||
assert(buf);
|
||||
if(!buf)
|
||||
return;
|
||||
assert(buf->base.refcount == 0);
|
||||
buf->vtbl->destroy(buf);
|
||||
}
|
||||
|
||||
|
@ -193,11 +197,16 @@ static INLINE void
|
|||
pb_reference(struct pb_buffer **dst,
|
||||
struct pb_buffer *src)
|
||||
{
|
||||
if (src)
|
||||
if (src) {
|
||||
assert(src->base.refcount);
|
||||
src->base.refcount++;
|
||||
}
|
||||
|
||||
if (*dst && --(*dst)->base.refcount == 0)
|
||||
pb_destroy( *dst );
|
||||
if (*dst) {
|
||||
assert((*dst)->base.refcount);
|
||||
if(--(*dst)->base.refcount == 0)
|
||||
pb_destroy( *dst );
|
||||
}
|
||||
|
||||
*dst = src;
|
||||
}
|
||||
|
|
|
@ -86,8 +86,7 @@ fenced_bufmgr_create_buffer(struct pb_manager *mgr,
|
|||
|
||||
fenced_buf = fenced_buffer_create(fenced_mgr->fenced_list, buf);
|
||||
if(!fenced_buf) {
|
||||
assert(buf->base.refcount == 1);
|
||||
pb_destroy(buf);
|
||||
pb_reference(&buf, NULL);
|
||||
}
|
||||
|
||||
return fenced_buf;
|
||||
|
|
|
@ -100,7 +100,7 @@ mm_buffer_destroy(struct pb_buffer *buf)
|
|||
assert(buf->base.refcount == 0);
|
||||
|
||||
pipe_mutex_lock(mm->mutex);
|
||||
mmFreeMem(mm_buf->block);
|
||||
u_mmFreeMem(mm_buf->block);
|
||||
FREE(buf);
|
||||
pipe_mutex_unlock(mm->mutex);
|
||||
}
|
||||
|
@ -175,14 +175,14 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr,
|
|||
|
||||
mm_buf->mgr = mm;
|
||||
|
||||
mm_buf->block = mmAllocMem(mm->heap, size, mm->align2, 0);
|
||||
mm_buf->block = u_mmAllocMem(mm->heap, size, mm->align2, 0);
|
||||
if(!mm_buf->block) {
|
||||
debug_printf("warning: heap full\n");
|
||||
#if 0
|
||||
mmDumpMemInfo(mm->heap);
|
||||
#endif
|
||||
|
||||
mm_buf->block = mmAllocMem(mm->heap, size, mm->align2, 0);
|
||||
mm_buf->block = u_mmAllocMem(mm->heap, size, mm->align2, 0);
|
||||
if(!mm_buf->block) {
|
||||
FREE(mm_buf);
|
||||
pipe_mutex_unlock(mm->mutex);
|
||||
|
@ -213,7 +213,7 @@ mm_bufmgr_destroy(struct pb_manager *mgr)
|
|||
|
||||
pipe_mutex_lock(mm->mutex);
|
||||
|
||||
mmDestroy(mm->heap);
|
||||
u_mmDestroy(mm->heap);
|
||||
|
||||
pb_unmap(mm->buffer);
|
||||
pb_reference(&mm->buffer, NULL);
|
||||
|
@ -254,7 +254,7 @@ mm_bufmgr_create_from_buffer(struct pb_buffer *buffer,
|
|||
if(!mm->map)
|
||||
goto failure;
|
||||
|
||||
mm->heap = mmInit(0, size);
|
||||
mm->heap = u_mmInit(0, size);
|
||||
if (!mm->heap)
|
||||
goto failure;
|
||||
|
||||
|
@ -262,7 +262,7 @@ mm_bufmgr_create_from_buffer(struct pb_buffer *buffer,
|
|||
|
||||
failure:
|
||||
if(mm->heap)
|
||||
mmDestroy(mm->heap);
|
||||
u_mmDestroy(mm->heap);
|
||||
if(mm->map)
|
||||
pb_unmap(mm->buffer);
|
||||
if(mm)
|
||||
|
|
|
@ -38,12 +38,13 @@
|
|||
#include "rtasm_execmem.h"
|
||||
|
||||
|
||||
#if defined(__linux__)
|
||||
#if defined(PIPE_OS_LINUX)
|
||||
|
||||
|
||||
/*
|
||||
* Allocate a large block of memory which can hold code then dole it out
|
||||
* in pieces by means of the generic memory manager code.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
|
@ -62,7 +63,7 @@ static void
|
|||
init_heap(void)
|
||||
{
|
||||
if (!exec_heap)
|
||||
exec_heap = mmInit( 0, EXEC_HEAP_SIZE );
|
||||
exec_heap = u_mmInit( 0, EXEC_HEAP_SIZE );
|
||||
|
||||
if (!exec_mem)
|
||||
exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE,
|
||||
|
@ -82,8 +83,8 @@ rtasm_exec_malloc(size_t size)
|
|||
init_heap();
|
||||
|
||||
if (exec_heap) {
|
||||
size = (size + 31) & ~31;
|
||||
block = mmAllocMem( exec_heap, size, 32, 0 );
|
||||
size = (size + 31) & ~31; /* next multiple of 32 bytes */
|
||||
block = u_mmAllocMem( exec_heap, size, 5, 0 ); /* 5 -> 32-byte alignment */
|
||||
}
|
||||
|
||||
if (block)
|
||||
|
@ -103,17 +104,17 @@ rtasm_exec_free(void *addr)
|
|||
pipe_mutex_lock(exec_mutex);
|
||||
|
||||
if (exec_heap) {
|
||||
struct mem_block *block = mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem);
|
||||
struct mem_block *block = u_mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem);
|
||||
|
||||
if (block)
|
||||
mmFreeMem(block);
|
||||
u_mmFreeMem(block);
|
||||
}
|
||||
|
||||
pipe_mutex_unlock(exec_mutex);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
#else /* PIPE_OS_LINUX */
|
||||
|
||||
/*
|
||||
* Just use regular memory.
|
||||
|
@ -133,4 +134,4 @@ rtasm_exec_free(void *addr)
|
|||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif /* PIPE_OS_LINUX */
|
||||
|
|
|
@ -38,17 +38,18 @@
|
|||
#include <stdio.h>
|
||||
#include "util/u_memory.h"
|
||||
#include "pipe/p_debug.h"
|
||||
#include "rtasm_execmem.h"
|
||||
#include "rtasm_ppc.h"
|
||||
|
||||
|
||||
void
|
||||
ppc_init_func(struct ppc_function *p, unsigned max_inst)
|
||||
ppc_init_func(struct ppc_function *p)
|
||||
{
|
||||
uint i;
|
||||
|
||||
p->store = align_malloc(max_inst * PPC_INST_SIZE, 16);
|
||||
p->num_inst = 0;
|
||||
p->max_inst = max_inst;
|
||||
p->max_inst = 100; /* first guess at buffer size */
|
||||
p->store = rtasm_exec_malloc(p->max_inst * PPC_INST_SIZE);
|
||||
p->reg_used = 0x0;
|
||||
p->fp_used = 0x0;
|
||||
p->vec_used = 0x0;
|
||||
|
@ -66,12 +67,19 @@ ppc_release_func(struct ppc_function *p)
|
|||
{
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
if (p->store != NULL) {
|
||||
align_free(p->store);
|
||||
rtasm_exec_free(p->store);
|
||||
}
|
||||
p->store = NULL;
|
||||
}
|
||||
|
||||
|
||||
uint
|
||||
ppc_num_instructions(const struct ppc_function *p)
|
||||
{
|
||||
return p->num_inst;
|
||||
}
|
||||
|
||||
|
||||
void (*ppc_get_func(struct ppc_function *p))(void)
|
||||
{
|
||||
#if 0
|
||||
|
@ -202,6 +210,35 @@ ppc_release_vec_register(struct ppc_function *p, int reg)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Append instruction to instruction buffer. Grow buffer if out of room.
|
||||
*/
|
||||
static void
|
||||
emit_instruction(struct ppc_function *p, uint32_t inst_bits)
|
||||
{
|
||||
if (!p->store)
|
||||
return; /* out of memory, drop the instruction */
|
||||
|
||||
if (p->num_inst == p->max_inst) {
|
||||
/* allocate larger buffer */
|
||||
uint32_t *newbuf;
|
||||
p->max_inst *= 2; /* 2x larger */
|
||||
newbuf = rtasm_exec_malloc(p->max_inst * PPC_INST_SIZE);
|
||||
if (newbuf) {
|
||||
memcpy(newbuf, p->store, p->num_inst * PPC_INST_SIZE);
|
||||
}
|
||||
rtasm_exec_free(p->store);
|
||||
p->store = newbuf;
|
||||
if (!p->store) {
|
||||
/* out of memory */
|
||||
p->num_inst = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
p->store[p->num_inst++] = inst_bits;
|
||||
}
|
||||
|
||||
|
||||
union vx_inst {
|
||||
uint32_t bits;
|
||||
|
@ -223,8 +260,7 @@ emit_vx(struct ppc_function *p, uint op2, uint vD, uint vA, uint vB)
|
|||
inst.inst.vA = vA;
|
||||
inst.inst.vB = vB;
|
||||
inst.inst.op2 = op2;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
};
|
||||
|
||||
|
||||
|
@ -250,8 +286,7 @@ emit_vxr(struct ppc_function *p, uint op2, uint vD, uint vA, uint vB)
|
|||
inst.inst.vB = vB;
|
||||
inst.inst.rC = 0;
|
||||
inst.inst.op2 = op2;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
};
|
||||
|
||||
|
||||
|
@ -277,8 +312,7 @@ emit_va(struct ppc_function *p, uint op2, uint vD, uint vA, uint vB, uint vC)
|
|||
inst.inst.vB = vB;
|
||||
inst.inst.vC = vC;
|
||||
inst.inst.op2 = op2;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
};
|
||||
|
||||
|
||||
|
@ -300,8 +334,7 @@ emit_i(struct ppc_function *p, uint op, uint li, uint aa, uint lk)
|
|||
inst.inst.li = li;
|
||||
inst.inst.aa = aa;
|
||||
inst.inst.lk = lk;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
}
|
||||
|
||||
|
||||
|
@ -330,8 +363,7 @@ emit_xl(struct ppc_function *p, uint op, uint bo, uint bi, uint bh,
|
|||
inst.inst.bh = bh;
|
||||
inst.inst.op2 = op2;
|
||||
inst.inst.lk = lk;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
|
@ -373,8 +405,7 @@ emit_x(struct ppc_function *p, uint op, uint vrs, uint ra, uint rb, uint op2)
|
|||
inst.inst.rb = rb;
|
||||
inst.inst.op2 = op2;
|
||||
inst.inst.unused = 0x0;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
}
|
||||
|
||||
|
||||
|
@ -398,8 +429,7 @@ emit_d(struct ppc_function *p, uint op, uint rt, uint ra, int si)
|
|||
inst.inst.rt = rt;
|
||||
inst.inst.ra = ra;
|
||||
inst.inst.si = (unsigned) (si & 0xffff);
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
};
|
||||
|
||||
|
||||
|
@ -428,8 +458,7 @@ emit_a(struct ppc_function *p, uint op, uint frt, uint fra, uint frb, uint op2,
|
|||
inst.inst.unused = 0x0;
|
||||
inst.inst.op2 = op2;
|
||||
inst.inst.rc = rc;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
};
|
||||
|
||||
|
||||
|
@ -458,8 +487,7 @@ emit_xo(struct ppc_function *p, uint op, uint rt, uint ra, uint rb, uint oe,
|
|||
inst.inst.oe = oe;
|
||||
inst.inst.op2 = op2;
|
||||
inst.inst.rc = rc;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
}
|
||||
|
||||
|
||||
|
@ -505,6 +533,13 @@ ppc_vmaddfp(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC)
|
|||
emit_va(p, 46, vD, vA, vC, vB); /* note arg order */
|
||||
}
|
||||
|
||||
/** vector float negative mult subtract: vD = vA - vB * vC */
|
||||
void
|
||||
ppc_vnmsubfp(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC)
|
||||
{
|
||||
emit_va(p, 47, vD, vB, vA, vC); /* note arg order */
|
||||
}
|
||||
|
||||
/** vector float compare greater than */
|
||||
void
|
||||
ppc_vcmpgtfpx(struct ppc_function *p, uint vD, uint vA, uint vB)
|
||||
|
|
|
@ -62,8 +62,9 @@ struct ppc_function
|
|||
|
||||
|
||||
|
||||
extern void ppc_init_func(struct ppc_function *p, unsigned max_inst);
|
||||
extern void ppc_init_func(struct ppc_function *p);
|
||||
extern void ppc_release_func(struct ppc_function *p);
|
||||
extern uint ppc_num_instructions(const struct ppc_function *p);
|
||||
extern void (*ppc_get_func( struct ppc_function *p ))( void );
|
||||
extern void ppc_dump_func(const struct ppc_function *p);
|
||||
|
||||
|
@ -97,10 +98,14 @@ ppc_vminfp(struct ppc_function *p, uint vD, uint vA, uint vB);
|
|||
extern void
|
||||
ppc_vmaxfp(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector float mult add */
|
||||
/** vector float mult add: vD = vA * vB + vC */
|
||||
extern void
|
||||
ppc_vmaddfp(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC);
|
||||
|
||||
/** vector float negative mult subtract: vD = vA - vB * vC */
|
||||
extern void
|
||||
ppc_vnmsubfp(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC);
|
||||
|
||||
/** vector float compare greater than */
|
||||
extern void
|
||||
ppc_vcmpgtfpx(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
|
|
@ -185,6 +185,34 @@ reg_name(int reg)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
emit_instruction(struct spe_function *p, uint32_t inst_bits)
|
||||
{
|
||||
if (!p->store)
|
||||
return; /* out of memory, drop the instruction */
|
||||
|
||||
if (p->num_inst == p->max_inst) {
|
||||
/* allocate larger buffer */
|
||||
uint32_t *newbuf;
|
||||
p->max_inst *= 2; /* 2x larger */
|
||||
newbuf = align_malloc(p->max_inst * SPE_INST_SIZE, 16);
|
||||
if (newbuf) {
|
||||
memcpy(newbuf, p->store, p->num_inst * SPE_INST_SIZE);
|
||||
}
|
||||
align_free(p->store);
|
||||
p->store = newbuf;
|
||||
if (!p->store) {
|
||||
/* out of memory */
|
||||
p->num_inst = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
p->store[p->num_inst++] = inst_bits;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void emit_RR(struct spe_function *p, unsigned op, unsigned rT,
|
||||
unsigned rA, unsigned rB, const char *name)
|
||||
{
|
||||
|
@ -193,8 +221,7 @@ static void emit_RR(struct spe_function *p, unsigned op, unsigned rT,
|
|||
inst.inst.rB = rB;
|
||||
inst.inst.rA = rA;
|
||||
inst.inst.rT = rT;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
if (p->print) {
|
||||
indent(p);
|
||||
printf("%s\t%s, %s, %s\n",
|
||||
|
@ -212,8 +239,7 @@ static void emit_RRR(struct spe_function *p, unsigned op, unsigned rT,
|
|||
inst.inst.rB = rB;
|
||||
inst.inst.rA = rA;
|
||||
inst.inst.rC = rC;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
if (p->print) {
|
||||
indent(p);
|
||||
printf("%s\t%s, %s, %s, %s\n", rem_prefix(name), reg_name(rT),
|
||||
|
@ -230,8 +256,7 @@ static void emit_RI7(struct spe_function *p, unsigned op, unsigned rT,
|
|||
inst.inst.i7 = imm;
|
||||
inst.inst.rA = rA;
|
||||
inst.inst.rT = rT;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
if (p->print) {
|
||||
indent(p);
|
||||
printf("%s\t%s, %s, 0x%x\n",
|
||||
|
@ -249,8 +274,7 @@ static void emit_RI8(struct spe_function *p, unsigned op, unsigned rT,
|
|||
inst.inst.i8 = imm;
|
||||
inst.inst.rA = rA;
|
||||
inst.inst.rT = rT;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
if (p->print) {
|
||||
indent(p);
|
||||
printf("%s\t%s, %s, 0x%x\n",
|
||||
|
@ -268,8 +292,7 @@ static void emit_RI10(struct spe_function *p, unsigned op, unsigned rT,
|
|||
inst.inst.i10 = imm;
|
||||
inst.inst.rA = rA;
|
||||
inst.inst.rT = rT;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
if (p->print) {
|
||||
indent(p);
|
||||
printf("%s\t%s, %s, 0x%x\n",
|
||||
|
@ -295,8 +318,7 @@ static void emit_RI16(struct spe_function *p, unsigned op, unsigned rT,
|
|||
inst.inst.op = op;
|
||||
inst.inst.i16 = imm;
|
||||
inst.inst.rT = rT;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
if (p->print) {
|
||||
indent(p);
|
||||
printf("%s\t%s, 0x%x\n", rem_prefix(name), reg_name(rT), imm);
|
||||
|
@ -311,8 +333,7 @@ static void emit_RI18(struct spe_function *p, unsigned op, unsigned rT,
|
|||
inst.inst.op = op;
|
||||
inst.inst.i18 = imm;
|
||||
inst.inst.rT = rT;
|
||||
p->store[p->num_inst++] = inst.bits;
|
||||
assert(p->num_inst <= p->max_inst);
|
||||
emit_instruction(p, inst.bits);
|
||||
if (p->print) {
|
||||
indent(p);
|
||||
printf("%s\t%s, 0x%x\n", rem_prefix(name), reg_name(rT), imm);
|
||||
|
@ -394,15 +415,19 @@ void _name (struct spe_function *p, int imm) \
|
|||
|
||||
/**
|
||||
* Initialize an spe_function.
|
||||
* \param code_size size of instruction buffer to allocate, in bytes.
|
||||
* \param code_size initial size of instruction buffer to allocate, in bytes.
|
||||
* If zero, use a default.
|
||||
*/
|
||||
void spe_init_func(struct spe_function *p, unsigned code_size)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
p->store = align_malloc(code_size, 16);
|
||||
if (!code_size)
|
||||
code_size = 64;
|
||||
|
||||
p->num_inst = 0;
|
||||
p->max_inst = code_size / SPE_INST_SIZE;
|
||||
p->store = align_malloc(code_size, 16);
|
||||
|
||||
p->set_count = 0;
|
||||
memset(p->regs, 0, SPE_NUM_REGS * sizeof(p->regs[0]));
|
||||
|
|
|
@ -958,6 +958,10 @@ fetch_src_file_channel(
|
|||
switch( file ) {
|
||||
case TGSI_FILE_CONSTANT:
|
||||
assert(mach->Consts);
|
||||
assert(index->i[0] >= 0);
|
||||
assert(index->i[1] >= 0);
|
||||
assert(index->i[2] >= 0);
|
||||
assert(index->i[3] >= 0);
|
||||
chan->f[0] = mach->Consts[index->i[0]][swizzle];
|
||||
chan->f[1] = mach->Consts[index->i[1]][swizzle];
|
||||
chan->f[2] = mach->Consts[index->i[2]][swizzle];
|
||||
|
@ -1041,12 +1045,16 @@ fetch_source(
|
|||
if (reg->SrcRegister.Indirect) {
|
||||
union tgsi_exec_channel index2;
|
||||
union tgsi_exec_channel indir_index;
|
||||
const uint execmask = mach->ExecMask;
|
||||
uint i;
|
||||
|
||||
/* which address register (always zero now) */
|
||||
index2.i[0] =
|
||||
index2.i[1] =
|
||||
index2.i[2] =
|
||||
index2.i[3] = reg->SrcRegisterInd.Index;
|
||||
|
||||
/* get current value of address register[swizzle] */
|
||||
swizzle = tgsi_util_get_src_register_swizzle( ®->SrcRegisterInd, CHAN_X );
|
||||
fetch_src_file_channel(
|
||||
mach,
|
||||
|
@ -1055,10 +1063,19 @@ fetch_source(
|
|||
&index2,
|
||||
&indir_index );
|
||||
|
||||
/* add value of address register to the offset */
|
||||
index.i[0] += indir_index.i[0];
|
||||
index.i[1] += indir_index.i[1];
|
||||
index.i[2] += indir_index.i[2];
|
||||
index.i[3] += indir_index.i[3];
|
||||
|
||||
/* for disabled execution channels, zero-out the index to
|
||||
* avoid using a potential garbage value.
|
||||
*/
|
||||
for (i = 0; i < QUAD_SIZE; i++) {
|
||||
if ((execmask & (1 << i)) == 0)
|
||||
index.i[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if( reg->SrcRegister.Dimension ) {
|
||||
|
@ -1087,6 +1104,8 @@ fetch_source(
|
|||
if (reg->SrcRegisterDim.Indirect) {
|
||||
union tgsi_exec_channel index2;
|
||||
union tgsi_exec_channel indir_index;
|
||||
const uint execmask = mach->ExecMask;
|
||||
uint i;
|
||||
|
||||
index2.i[0] =
|
||||
index2.i[1] =
|
||||
|
@ -1105,6 +1124,14 @@ fetch_source(
|
|||
index.i[1] += indir_index.i[1];
|
||||
index.i[2] += indir_index.i[2];
|
||||
index.i[3] += indir_index.i[3];
|
||||
|
||||
/* for disabled execution channels, zero-out the index to
|
||||
* avoid using a potential garbage value.
|
||||
*/
|
||||
for (i = 0; i < QUAD_SIZE; i++) {
|
||||
if ((execmask & (1 << i)) == 0)
|
||||
index.i[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2007,7 +2034,21 @@ exec_instruction(
|
|||
|
||||
case TGSI_OPCODE_DOT2ADD:
|
||||
/* TGSI_OPCODE_DP2A */
|
||||
assert (0);
|
||||
FETCH( &r[0], 0, CHAN_X );
|
||||
FETCH( &r[1], 1, CHAN_X );
|
||||
micro_mul( &r[0], &r[0], &r[1] );
|
||||
|
||||
FETCH( &r[1], 0, CHAN_Y );
|
||||
FETCH( &r[2], 1, CHAN_Y );
|
||||
micro_mul( &r[1], &r[1], &r[2] );
|
||||
micro_add( &r[0], &r[0], &r[1] );
|
||||
|
||||
FETCH( &r[2], 2, CHAN_X );
|
||||
micro_add( &r[0], &r[0], &r[2] );
|
||||
|
||||
FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
|
||||
STORE( &r[0], 0, chan_index );
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_INDEX:
|
||||
|
@ -2436,7 +2477,66 @@ exec_instruction(
|
|||
break;
|
||||
|
||||
case TGSI_OPCODE_NRM:
|
||||
assert (0);
|
||||
/* 3-component vector normalize */
|
||||
{
|
||||
union tgsi_exec_channel tmp, dot;
|
||||
|
||||
/* tmp = dp3(src0, src0): */
|
||||
FETCH( &r[0], 0, CHAN_X );
|
||||
micro_mul( &tmp, &r[0], &r[0] );
|
||||
|
||||
FETCH( &r[1], 0, CHAN_Y );
|
||||
micro_mul( &dot, &r[1], &r[1] );
|
||||
micro_add( &tmp, &tmp, &dot );
|
||||
|
||||
FETCH( &r[2], 0, CHAN_Z );
|
||||
micro_mul( &dot, &r[2], &r[2] );
|
||||
micro_add( &tmp, &tmp, &dot );
|
||||
|
||||
/* tmp = 1 / sqrt(tmp) */
|
||||
micro_sqrt( &tmp, &tmp );
|
||||
micro_div( &tmp, &mach->Temps[TEMP_1_I].xyzw[TEMP_1_C], &tmp );
|
||||
|
||||
/* note: w channel is undefined */
|
||||
FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
|
||||
/* chan = chan * tmp */
|
||||
micro_mul( &r[chan_index], &tmp, &r[chan_index] );
|
||||
STORE( &r[chan_index], 0, chan_index );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_NRM4:
|
||||
/* 4-component vector normalize */
|
||||
{
|
||||
union tgsi_exec_channel tmp, dot;
|
||||
|
||||
/* tmp = dp4(src0, src0): */
|
||||
FETCH( &r[0], 0, CHAN_X );
|
||||
micro_mul( &tmp, &r[0], &r[0] );
|
||||
|
||||
FETCH( &r[1], 0, CHAN_Y );
|
||||
micro_mul( &dot, &r[1], &r[1] );
|
||||
micro_add( &tmp, &tmp, &dot );
|
||||
|
||||
FETCH( &r[2], 0, CHAN_Z );
|
||||
micro_mul( &dot, &r[2], &r[2] );
|
||||
micro_add( &tmp, &tmp, &dot );
|
||||
|
||||
FETCH( &r[3], 0, CHAN_W );
|
||||
micro_mul( &dot, &r[3], &r[3] );
|
||||
micro_add( &tmp, &tmp, &dot );
|
||||
|
||||
/* tmp = 1 / sqrt(tmp) */
|
||||
micro_sqrt( &tmp, &tmp );
|
||||
micro_div( &tmp, &mach->Temps[TEMP_1_I].xyzw[TEMP_1_C], &tmp );
|
||||
|
||||
FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
|
||||
/* chan = chan * tmp */
|
||||
micro_mul( &r[chan_index], &tmp, &r[chan_index] );
|
||||
STORE( &r[chan_index], 0, chan_index );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_DIV:
|
||||
|
|
|
@ -165,6 +165,10 @@ struct tgsi_exec_labels
|
|||
#define TGSI_EXEC_TEMP_HALF_I (TGSI_EXEC_NUM_TEMPS + 3)
|
||||
#define TGSI_EXEC_TEMP_HALF_C 1
|
||||
|
||||
/* execution mask, each value is either 0 or ~0 */
|
||||
#define TGSI_EXEC_MASK_I (TGSI_EXEC_NUM_TEMPS + 3)
|
||||
#define TGSI_EXEC_MASK_C 2
|
||||
|
||||
#define TGSI_EXEC_TEMP_R0 (TGSI_EXEC_NUM_TEMPS + 4)
|
||||
|
||||
#define TGSI_EXEC_TEMP_ADDR (TGSI_EXEC_NUM_TEMPS + 5)
|
||||
|
@ -265,6 +269,27 @@ void
|
|||
tgsi_exec_machine_free_data(struct tgsi_exec_machine *mach);
|
||||
|
||||
|
||||
static INLINE void
|
||||
tgsi_set_kill_mask(struct tgsi_exec_machine *mach, unsigned mask)
|
||||
{
|
||||
mach->Temps[TGSI_EXEC_TEMP_KILMASK_I].xyzw[TGSI_EXEC_TEMP_KILMASK_C].u[0] =
|
||||
mask;
|
||||
}
|
||||
|
||||
|
||||
/** Set execution mask values prior to executing the shader */
|
||||
static INLINE void
|
||||
tgsi_set_exec_mask(struct tgsi_exec_machine *mach,
|
||||
boolean ch0, boolean ch1, boolean ch2, boolean ch3)
|
||||
{
|
||||
int *mask = mach->Temps[TGSI_EXEC_MASK_I].xyzw[TGSI_EXEC_MASK_C].i;
|
||||
mask[0] = ch0 ? ~0 : 0;
|
||||
mask[1] = ch1 ? ~0 : 0;
|
||||
mask[2] = ch2 ? ~0 : 0;
|
||||
mask[3] = ch3 ? ~0 : 0;
|
||||
}
|
||||
|
||||
|
||||
#if defined __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -153,17 +153,21 @@ check_register_usage(
|
|||
if (!check_file_name( ctx, file ))
|
||||
return FALSE;
|
||||
|
||||
if (index < 0 || index > MAX_REGISTERS) {
|
||||
report_error( ctx, "%s[%i]: Invalid index %s", file_names[file], index, name );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (indirect_access) {
|
||||
/* Note that 'index' is an offset relative to the value of the
|
||||
* address register. No range checking done here.
|
||||
*/
|
||||
if (!is_any_register_declared( ctx, file ))
|
||||
report_error( ctx, "%s: Undeclared %s register", file_names[file], name );
|
||||
ctx->regs_ind_used[file] = TRUE;
|
||||
}
|
||||
else {
|
||||
if (index < 0 || index > MAX_REGISTERS) {
|
||||
report_error( ctx, "%s[%i]: Invalid index %s",
|
||||
file_names[file], index, name );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!is_register_declared( ctx, file, index ))
|
||||
report_error( ctx, "%s[%d]: Undeclared %s register", file_names[file], index, name );
|
||||
ctx->regs_used[file][index / BITS_IN_REG_FLAG] |= (1 << (index % BITS_IN_REG_FLAG));
|
||||
|
|
|
@ -27,12 +27,14 @@
|
|||
|
||||
#include "pipe/p_config.h"
|
||||
|
||||
#if defined(PIPE_ARCH_X86) && defined(PIPE_ARCH_SSE)
|
||||
#if defined(PIPE_ARCH_X86)
|
||||
|
||||
#include "pipe/p_debug.h"
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
#include "util/u_math.h"
|
||||
#if defined(PIPE_ARCH_SSE)
|
||||
#include "util/u_sse.h"
|
||||
#endif
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
#include "tgsi/tgsi_util.h"
|
||||
#include "tgsi_exec.h"
|
||||
|
@ -72,6 +74,9 @@
|
|||
|
||||
#define TEMP_R0 TGSI_EXEC_TEMP_R0
|
||||
#define TEMP_ADDR TGSI_EXEC_TEMP_ADDR
|
||||
#define TEMP_EXEC_MASK_I TGSI_EXEC_MASK_I
|
||||
#define TEMP_EXEC_MASK_C TGSI_EXEC_MASK_C
|
||||
|
||||
|
||||
/**
|
||||
* X86 utility functions.
|
||||
|
@ -233,6 +238,9 @@ emit_const(
|
|||
int indirectIndex )
|
||||
{
|
||||
if (indirect) {
|
||||
/* 'vec' is the offset from the address register's value.
|
||||
* We're loading CONST[ADDR+vec] into an xmm register.
|
||||
*/
|
||||
struct x86_reg r0 = get_input_base();
|
||||
struct x86_reg r1 = get_output_base();
|
||||
uint i;
|
||||
|
@ -243,18 +251,40 @@ emit_const(
|
|||
x86_push( func, r0 );
|
||||
x86_push( func, r1 );
|
||||
|
||||
/*
|
||||
* Loop over the four pixels or vertices in the quad.
|
||||
* Get the value of the address (offset) register for pixel/vertex[i],
|
||||
* add it to the src offset and index into the constant buffer.
|
||||
* Note that we're working on SOA data.
|
||||
* If any of the pixel/vertex execution channels are unused their
|
||||
* values will be garbage. It's very important that we don't use
|
||||
* those garbage values as indexes into the constant buffer since
|
||||
* that'll cause segfaults.
|
||||
* The solution is to bitwise-AND the offset with the execution mask
|
||||
* register whose values are either 0 or ~0.
|
||||
* The caller must setup the execution mask register to indicate
|
||||
* which channels are valid/alive before running the shader.
|
||||
* The execution mask will also figure into loops and conditionals
|
||||
* someday.
|
||||
*/
|
||||
for (i = 0; i < QUAD_SIZE; i++) {
|
||||
x86_lea( func, r0, get_const( vec, chan ) );
|
||||
/* r1 = address register[i] */
|
||||
x86_mov( func, r1, x86_make_disp( get_temp( TEMP_ADDR, CHAN_X ), i * 4 ) );
|
||||
/* r0 = execution mask[i] */
|
||||
x86_mov( func, r0, x86_make_disp( get_temp( TEMP_EXEC_MASK_I, TEMP_EXEC_MASK_C ), i * 4 ) );
|
||||
/* r1 = r1 & r0 */
|
||||
x86_and( func, r1, r0 );
|
||||
/* r0 = 'vec', the offset */
|
||||
x86_lea( func, r0, get_const( vec, chan ) );
|
||||
|
||||
/* Quick hack to multiply by 16 -- need to add SHL to rtasm.
|
||||
/* Quick hack to multiply r1 by 16 -- need to add SHL to rtasm.
|
||||
*/
|
||||
x86_add( func, r1, r1 );
|
||||
x86_add( func, r1, r1 );
|
||||
x86_add( func, r1, r1 );
|
||||
x86_add( func, r1, r1 );
|
||||
|
||||
x86_add( func, r0, r1 );
|
||||
x86_add( func, r0, r1 ); /* r0 = r0 + r1 */
|
||||
x86_mov( func, r1, x86_deref( r0 ) );
|
||||
x86_mov( func, x86_make_disp( get_temp( TEMP_R0, CHAN_X ), i * 4 ), r1 );
|
||||
}
|
||||
|
@ -268,6 +298,7 @@ emit_const(
|
|||
get_temp( TEMP_R0, CHAN_X ) );
|
||||
}
|
||||
else {
|
||||
/* 'vec' is the index into the src register file, such as TEMP[vec] */
|
||||
assert( vec >= 0 );
|
||||
|
||||
sse_movss(
|
||||
|
@ -598,6 +629,9 @@ emit_func_call_dst_src(
|
|||
code );
|
||||
}
|
||||
|
||||
|
||||
#if defined(PIPE_ARCH_SSE)
|
||||
|
||||
/*
|
||||
* Fast SSE2 implementation of special math functions.
|
||||
*/
|
||||
|
@ -649,6 +683,7 @@ exp2f4(__m128 x)
|
|||
return _mm_mul_ps(expipart, expfpart);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* See http://www.devmaster.net/forums/showthread.php?p=43580
|
||||
*/
|
||||
|
@ -691,12 +726,16 @@ log2f4(__m128 x)
|
|||
return _mm_add_ps(logmant, exp);
|
||||
}
|
||||
|
||||
|
||||
static INLINE __m128
|
||||
powf4(__m128 x, __m128 y)
|
||||
{
|
||||
return exp2f4(_mm_mul_ps(log2f4(x), y));
|
||||
}
|
||||
|
||||
#endif /* PIPE_ARCH_SSE */
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Low-level instruction translators.
|
||||
|
@ -751,13 +790,20 @@ emit_cos(
|
|||
}
|
||||
|
||||
static void PIPE_CDECL
|
||||
#if defined(PIPE_CC_GCC)
|
||||
#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_SSE)
|
||||
__attribute__((force_align_arg_pointer))
|
||||
#endif
|
||||
ex24f(
|
||||
float *store )
|
||||
{
|
||||
#if defined(PIPE_ARCH_SSE)
|
||||
_mm_store_ps(&store[0], exp2f4( _mm_load_ps(&store[0]) ));
|
||||
#else
|
||||
store[0] = util_fast_exp2( store[0] );
|
||||
store[1] = util_fast_exp2( store[1] );
|
||||
store[2] = util_fast_exp2( store[2] );
|
||||
store[3] = util_fast_exp2( store[3] );
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -784,6 +830,17 @@ emit_f2it(
|
|||
make_xmm( xmm ) );
|
||||
}
|
||||
|
||||
static void
|
||||
emit_i2f(
|
||||
struct x86_function *func,
|
||||
unsigned xmm )
|
||||
{
|
||||
sse2_cvtdq2ps(
|
||||
func,
|
||||
make_xmm( xmm ),
|
||||
make_xmm( xmm ) );
|
||||
}
|
||||
|
||||
static void PIPE_CDECL
|
||||
flr4f(
|
||||
float *store )
|
||||
|
@ -831,13 +888,20 @@ emit_frc(
|
|||
}
|
||||
|
||||
static void PIPE_CDECL
|
||||
#if defined(PIPE_CC_GCC)
|
||||
#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_SSE)
|
||||
__attribute__((force_align_arg_pointer))
|
||||
#endif
|
||||
lg24f(
|
||||
float *store )
|
||||
{
|
||||
#if defined(PIPE_ARCH_SSE)
|
||||
_mm_store_ps(&store[0], log2f4( _mm_load_ps(&store[0]) ));
|
||||
#else
|
||||
store[0] = util_fast_log2( store[0] );
|
||||
store[1] = util_fast_log2( store[1] );
|
||||
store[2] = util_fast_log2( store[2] );
|
||||
store[3] = util_fast_log2( store[3] );
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -890,19 +954,19 @@ emit_neg(
|
|||
}
|
||||
|
||||
static void PIPE_CDECL
|
||||
#if defined(PIPE_CC_GCC)
|
||||
#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_SSE)
|
||||
__attribute__((force_align_arg_pointer))
|
||||
#endif
|
||||
pow4f(
|
||||
float *store )
|
||||
{
|
||||
#if 1
|
||||
#if defined(PIPE_ARCH_SSE)
|
||||
_mm_store_ps(&store[0], powf4( _mm_load_ps(&store[0]), _mm_load_ps(&store[4]) ));
|
||||
#else
|
||||
store[0] = powf( store[0], store[4] );
|
||||
store[1] = powf( store[1], store[5] );
|
||||
store[2] = powf( store[2], store[6] );
|
||||
store[3] = powf( store[3], store[7] );
|
||||
store[0] = util_fast_pow( store[0], store[4] );
|
||||
store[1] = util_fast_pow( store[1], store[5] );
|
||||
store[2] = util_fast_pow( store[2], store[6] );
|
||||
store[3] = util_fast_pow( store[3], store[7] );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1702,7 +1766,18 @@ emit_instruction(
|
|||
|
||||
case TGSI_OPCODE_DOT2ADD:
|
||||
/* TGSI_OPCODE_DP2A */
|
||||
return 0;
|
||||
FETCH( func, *inst, 0, 0, CHAN_X ); /* xmm0 = src[0].x */
|
||||
FETCH( func, *inst, 1, 1, CHAN_X ); /* xmm1 = src[1].x */
|
||||
emit_mul( func, 0, 1 ); /* xmm0 = xmm0 * xmm1 */
|
||||
FETCH( func, *inst, 1, 0, CHAN_Y ); /* xmm1 = src[0].y */
|
||||
FETCH( func, *inst, 2, 1, CHAN_Y ); /* xmm2 = src[1].y */
|
||||
emit_mul( func, 1, 2 ); /* xmm1 = xmm1 * xmm2 */
|
||||
emit_add( func, 0, 1 ); /* xmm0 = xmm0 + xmm1 */
|
||||
FETCH( func, *inst, 1, 2, CHAN_X ); /* xmm1 = src[2].x */
|
||||
emit_add( func, 0, 1 ); /* xmm0 = xmm0 + xmm1 */
|
||||
FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) {
|
||||
STORE( func, *inst, 0, 0, chan_index ); /* dest[ch] = xmm0 */
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_INDEX:
|
||||
|
@ -2036,7 +2111,39 @@ emit_instruction(
|
|||
break;
|
||||
|
||||
case TGSI_OPCODE_NRM:
|
||||
return 0;
|
||||
/* fall-through */
|
||||
case TGSI_OPCODE_NRM4:
|
||||
/* 3 or 4-component normalization */
|
||||
{
|
||||
uint dims = (inst->Instruction.Opcode == TGSI_OPCODE_NRM) ? 3 : 4;
|
||||
/* note: cannot use xmm regs 2/3 here (see emit_rsqrt() above) */
|
||||
FETCH( func, *inst, 4, 0, CHAN_X ); /* xmm4 = src[0].x */
|
||||
FETCH( func, *inst, 5, 0, CHAN_Y ); /* xmm5 = src[0].y */
|
||||
FETCH( func, *inst, 6, 0, CHAN_Z ); /* xmm6 = src[0].z */
|
||||
if (dims == 4) {
|
||||
FETCH( func, *inst, 7, 0, CHAN_W ); /* xmm7 = src[0].w */
|
||||
}
|
||||
emit_MOV( func, 0, 4 ); /* xmm0 = xmm3 */
|
||||
emit_mul( func, 0, 4 ); /* xmm0 *= xmm3 */
|
||||
emit_MOV( func, 1, 5 ); /* xmm1 = xmm4 */
|
||||
emit_mul( func, 1, 5 ); /* xmm1 *= xmm4 */
|
||||
emit_add( func, 0, 1 ); /* xmm0 += xmm1 */
|
||||
emit_MOV( func, 1, 6 ); /* xmm1 = xmm5 */
|
||||
emit_mul( func, 1, 6 ); /* xmm1 *= xmm5 */
|
||||
emit_add( func, 0, 1 ); /* xmm0 += xmm1 */
|
||||
if (dims == 4) {
|
||||
emit_MOV( func, 1, 7 ); /* xmm1 = xmm7 */
|
||||
emit_mul( func, 1, 7 ); /* xmm1 *= xmm7 */
|
||||
emit_add( func, 0, 0 ); /* xmm0 += xmm1 */
|
||||
}
|
||||
emit_rsqrt( func, 1, 0 ); /* xmm1 = 1/sqrt(xmm0) */
|
||||
FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) {
|
||||
if (chan_index < dims) {
|
||||
emit_mul( func, 4+chan_index, 1); /* xmm[4+ch] *= xmm1 */
|
||||
STORE( func, *inst, 4+chan_index, 0, chan_index );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_DIV:
|
||||
|
@ -2044,7 +2151,16 @@ emit_instruction(
|
|||
break;
|
||||
|
||||
case TGSI_OPCODE_DP2:
|
||||
return 0;
|
||||
FETCH( func, *inst, 0, 0, CHAN_X ); /* xmm0 = src[0].x */
|
||||
FETCH( func, *inst, 1, 1, CHAN_X ); /* xmm1 = src[1].x */
|
||||
emit_mul( func, 0, 1 ); /* xmm0 = xmm0 * xmm1 */
|
||||
FETCH( func, *inst, 1, 0, CHAN_Y ); /* xmm1 = src[0].y */
|
||||
FETCH( func, *inst, 2, 1, CHAN_Y ); /* xmm2 = src[1].y */
|
||||
emit_mul( func, 1, 2 ); /* xmm1 = xmm1 * xmm2 */
|
||||
emit_add( func, 0, 1 ); /* xmm0 = xmm0 + xmm1 */
|
||||
FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) {
|
||||
STORE( func, *inst, 0, 0, chan_index ); /* dest[ch] = xmm0 */
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_TXL:
|
||||
|
@ -2104,7 +2220,12 @@ emit_instruction(
|
|||
break;
|
||||
|
||||
case TGSI_OPCODE_TRUNC:
|
||||
return 0;
|
||||
FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) {
|
||||
FETCH( func, *inst, 0, 0, chan_index );
|
||||
emit_f2it( func, 0 );
|
||||
emit_i2f( func, 0 );
|
||||
STORE( func, *inst, 0, 0, chan_index );
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_SHL:
|
||||
|
|
|
@ -36,6 +36,13 @@
|
|||
#include <windows.h>
|
||||
#include <winddi.h>
|
||||
|
||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_CE)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#include <types.h>
|
||||
|
||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
||||
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
|
@ -98,7 +105,35 @@ void _debug_vprintf(const char *format, va_list ap)
|
|||
OutputDebugStringA(buf);
|
||||
buf[0] = '\0';
|
||||
}
|
||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_CE) || defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
|
||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_CE)
|
||||
wchar_t *wide_format;
|
||||
long wide_str_len;
|
||||
char buf[512];
|
||||
int ret;
|
||||
#if (_WIN32_WCE < 600)
|
||||
ret = vsprintf(buf, format, ap);
|
||||
if(ret < 0){
|
||||
sprintf(buf, "Cant handle debug print!");
|
||||
ret = 25;
|
||||
}
|
||||
#else
|
||||
ret = vsprintf_s(buf, 512, format, ap);
|
||||
if(ret < 0){
|
||||
sprintf_s(buf, 512, "Cant handle debug print!");
|
||||
ret = 25;
|
||||
}
|
||||
#endif
|
||||
buf[ret] = '\0';
|
||||
/* Format is ascii - needs to be converted to wchar_t for printing */
|
||||
wide_str_len = MultiByteToWideChar(CP_ACP, 0, (const char *) buf, -1, NULL, 0);
|
||||
wide_format = (wchar_t *) malloc((wide_str_len+1) * sizeof(wchar_t));
|
||||
if (wide_format) {
|
||||
MultiByteToWideChar(CP_ACP, 0, (const char *) buf, -1,
|
||||
wide_format, wide_str_len);
|
||||
NKDbgPrintfW(wide_format, wide_format);
|
||||
free(wide_format);
|
||||
}
|
||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
|
||||
/* TODO */
|
||||
#else /* !PIPE_SUBSYSTEM_WINDOWS */
|
||||
vfprintf(stderr, format, ap);
|
||||
|
@ -637,6 +672,7 @@ void
|
|||
debug_dump_surface_bmp(const char *filename,
|
||||
struct pipe_surface *surface)
|
||||
{
|
||||
#ifndef PIPE_SUBSYSTEM_WINDOWS_MINIPORT
|
||||
struct util_stream *stream;
|
||||
unsigned surface_usage;
|
||||
struct bmp_file_header bmfh;
|
||||
|
@ -703,6 +739,7 @@ error2:
|
|||
FREE(rgba);
|
||||
error1:
|
||||
;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -68,7 +68,7 @@ __inline double ceil(double val)
|
|||
return ceil_val;
|
||||
}
|
||||
|
||||
#ifndef PIPE_SUBSYSTEM_WINDOWS_CE
|
||||
#ifndef PIPE_SUBSYSTEM_WINDOWS_CE_OGL
|
||||
__inline double floor(double val)
|
||||
{
|
||||
double floor_val;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
|
||||
void
|
||||
mmDumpMemInfo(const struct mem_block *heap)
|
||||
u_mmDumpMemInfo(const struct mem_block *heap)
|
||||
{
|
||||
debug_printf("Memory heap %p:\n", (void *)heap);
|
||||
if (heap == 0) {
|
||||
|
@ -58,7 +58,7 @@ mmDumpMemInfo(const struct mem_block *heap)
|
|||
}
|
||||
|
||||
struct mem_block *
|
||||
mmInit(int ofs, int size)
|
||||
u_mmInit(int ofs, int size)
|
||||
{
|
||||
struct mem_block *heap, *block;
|
||||
|
||||
|
@ -165,13 +165,17 @@ SliceBlock(struct mem_block *p,
|
|||
|
||||
|
||||
struct mem_block *
|
||||
mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch)
|
||||
u_mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch)
|
||||
{
|
||||
struct mem_block *p;
|
||||
const int mask = (1 << align2)-1;
|
||||
int startofs = 0;
|
||||
int endofs;
|
||||
|
||||
assert(size >= 0);
|
||||
assert(align2 >= 0);
|
||||
assert(align2 <= 12); /* sanity check, 2^12 (4KB) enough? */
|
||||
|
||||
if (!heap || align2 < 0 || size <= 0)
|
||||
return NULL;
|
||||
|
||||
|
@ -198,7 +202,7 @@ mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch)
|
|||
|
||||
|
||||
struct mem_block *
|
||||
mmFindBlock(struct mem_block *heap, int start)
|
||||
u_mmFindBlock(struct mem_block *heap, int start)
|
||||
{
|
||||
struct mem_block *p;
|
||||
|
||||
|
@ -237,7 +241,7 @@ Join2Blocks(struct mem_block *p)
|
|||
}
|
||||
|
||||
int
|
||||
mmFreeMem(struct mem_block *b)
|
||||
u_mmFreeMem(struct mem_block *b)
|
||||
{
|
||||
if (!b)
|
||||
return 0;
|
||||
|
@ -266,7 +270,7 @@ mmFreeMem(struct mem_block *b)
|
|||
|
||||
|
||||
void
|
||||
mmDestroy(struct mem_block *heap)
|
||||
u_mmDestroy(struct mem_block *heap)
|
||||
{
|
||||
struct mem_block *p;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ struct mem_block {
|
|||
* input: total size in bytes
|
||||
* return: a heap pointer if OK, NULL if error
|
||||
*/
|
||||
extern struct mem_block *mmInit(int ofs, int size);
|
||||
extern struct mem_block *u_mmInit(int ofs, int size);
|
||||
|
||||
/**
|
||||
* Allocate 'size' bytes with 2^align2 bytes alignment,
|
||||
|
@ -61,7 +61,7 @@ extern struct mem_block *mmInit(int ofs, int size);
|
|||
* startSearch = linear offset from start of heap to begin search
|
||||
* return: pointer to the allocated block, 0 if error
|
||||
*/
|
||||
extern struct mem_block *mmAllocMem(struct mem_block *heap, int size, int align2,
|
||||
extern struct mem_block *u_mmAllocMem(struct mem_block *heap, int size, int align2,
|
||||
int startSearch);
|
||||
|
||||
/**
|
||||
|
@ -69,23 +69,23 @@ extern struct mem_block *mmAllocMem(struct mem_block *heap, int size, int align2
|
|||
* input: pointer to a block
|
||||
* return: 0 if OK, -1 if error
|
||||
*/
|
||||
extern int mmFreeMem(struct mem_block *b);
|
||||
extern int u_mmFreeMem(struct mem_block *b);
|
||||
|
||||
/**
|
||||
* Free block starts at offset
|
||||
* input: pointer to a heap, start offset
|
||||
* return: pointer to a block
|
||||
*/
|
||||
extern struct mem_block *mmFindBlock(struct mem_block *heap, int start);
|
||||
extern struct mem_block *u_mmFindBlock(struct mem_block *heap, int start);
|
||||
|
||||
/**
|
||||
* destroy MM
|
||||
*/
|
||||
extern void mmDestroy(struct mem_block *mmInit);
|
||||
extern void u_mmDestroy(struct mem_block *mmInit);
|
||||
|
||||
/**
|
||||
* For debuging purpose.
|
||||
*/
|
||||
extern void mmDumpMemInfo(const struct mem_block *mmInit);
|
||||
extern void u_mmDumpMemInfo(const struct mem_block *mmInit);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -222,7 +222,8 @@ util_surface_copy(struct pipe_context *pipe,
|
|||
w, h,
|
||||
src_map,
|
||||
do_flip ? -(int) src->stride : src->stride,
|
||||
src_x, src_y);
|
||||
src_x,
|
||||
do_flip ? w - src_y : src_y);
|
||||
}
|
||||
|
||||
pipe->screen->surface_unmap(pipe->screen, src);
|
||||
|
|
|
@ -460,7 +460,7 @@ l8_put_tile_rgba(ubyte *dst,
|
|||
for (j = 0; j < w; j++, pRow += 4) {
|
||||
unsigned r;
|
||||
r = float_to_ubyte(pRow[0]);
|
||||
*dst++ = r;
|
||||
*dst++ = (ubyte) r;
|
||||
}
|
||||
p += src_stride;
|
||||
}
|
||||
|
@ -504,7 +504,7 @@ a8_put_tile_rgba(ubyte *dst,
|
|||
for (j = 0; j < w; j++, pRow += 4) {
|
||||
unsigned a;
|
||||
a = float_to_ubyte(pRow[3]);
|
||||
*dst++ = a;
|
||||
*dst++ = (ubyte) a;
|
||||
}
|
||||
p += src_stride;
|
||||
}
|
||||
|
@ -634,7 +634,7 @@ i8_put_tile_rgba(ubyte *dst,
|
|||
for (j = 0; j < w; j++, pRow += 4) {
|
||||
unsigned r;
|
||||
r = float_to_ubyte(pRow[0]);
|
||||
*dst++ = r;
|
||||
*dst++ = (ubyte) r;
|
||||
}
|
||||
p += src_stride;
|
||||
}
|
||||
|
@ -769,6 +769,32 @@ z24s8_get_tile_rgba(const unsigned *src,
|
|||
}
|
||||
|
||||
|
||||
/*** PIPE_FORMAT_Z32_FLOAT ***/
|
||||
|
||||
/**
|
||||
* Return each Z value as four floats in [0,1].
|
||||
*/
|
||||
static void
|
||||
z32f_get_tile_rgba(const float *src,
|
||||
unsigned w, unsigned h,
|
||||
float *p,
|
||||
unsigned dst_stride)
|
||||
{
|
||||
unsigned i, j;
|
||||
|
||||
for (i = 0; i < h; i++) {
|
||||
float *pRow = p;
|
||||
for (j = 0; j < w; j++, pRow += 4) {
|
||||
pRow[0] =
|
||||
pRow[1] =
|
||||
pRow[2] =
|
||||
pRow[3] = *src++;
|
||||
}
|
||||
p += dst_stride;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*** PIPE_FORMAT_YCBCR / PIPE_FORMAT_YCBCR_REV ***/
|
||||
|
||||
/**
|
||||
|
@ -913,6 +939,9 @@ pipe_tile_raw_to_rgba(enum pipe_format format,
|
|||
case PIPE_FORMAT_Z24S8_UNORM:
|
||||
z24s8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride);
|
||||
break;
|
||||
case PIPE_FORMAT_Z32_FLOAT:
|
||||
z32f_get_tile_rgba((float *) src, w, h, dst, dst_stride);
|
||||
break;
|
||||
case PIPE_FORMAT_YCBCR:
|
||||
ycbcr_get_tile_rgba((ushort *) src, w, h, dst, dst_stride, FALSE);
|
||||
break;
|
||||
|
|
|
@ -200,7 +200,7 @@ util_time_timeout(const struct util_time *start,
|
|||
}
|
||||
|
||||
|
||||
#if defined(PIPE_SUBSYSYEM_WINDOWS_DISPLAY)
|
||||
#if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
|
||||
void util_time_sleep(unsigned usecs)
|
||||
{
|
||||
LONGLONG start, curr, end;
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
#define CELL_DEBUG_CACHE (1 << 6)
|
||||
|
||||
/** Max instructions for doing per-fragment operations */
|
||||
#define SPU_MAX_FRAGMENT_OPS_INSTS 64
|
||||
#define SPU_MAX_FRAGMENT_OPS_INSTS 128
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -100,12 +100,23 @@ emit_fence(struct cell_context *cell)
|
|||
const uint batch = cell->cur_batch;
|
||||
const uint size = cell->buffer_size[batch];
|
||||
struct cell_command_fence *fence_cmd;
|
||||
struct cell_fence *fence = &cell->fenced_buffers[batch].fence;
|
||||
uint i;
|
||||
|
||||
/* set fence status to emitted, not yet signalled */
|
||||
for (i = 0; i < cell->num_spus; i++) {
|
||||
fence->status[i][0] = CELL_FENCE_EMITTED;
|
||||
}
|
||||
|
||||
ASSERT(size + sizeof(struct cell_command_fence) <= CELL_BUFFER_SIZE);
|
||||
|
||||
fence_cmd = (struct cell_command_fence *) (cell->buffer[batch] + size);
|
||||
fence_cmd->opcode = CELL_CMD_FENCE;
|
||||
fence_cmd->fence = &cell->fenced_buffers[batch].fence;
|
||||
fence_cmd->fence = fence;
|
||||
|
||||
/* update batch buffer size */
|
||||
cell->buffer_size[batch] = size + sizeof(struct cell_command_fence);
|
||||
assert(sizeof(struct cell_command_fence) % 8 == 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -119,7 +130,7 @@ cell_batch_flush(struct cell_context *cell)
|
|||
{
|
||||
static boolean flushing = FALSE;
|
||||
uint batch = cell->cur_batch;
|
||||
const uint size = cell->buffer_size[batch];
|
||||
uint size = cell->buffer_size[batch];
|
||||
uint spu, cmd_word;
|
||||
|
||||
assert(!flushing);
|
||||
|
@ -130,8 +141,10 @@ cell_batch_flush(struct cell_context *cell)
|
|||
/* Before we use this batch buffer, make sure any fenced texture buffers
|
||||
* are released.
|
||||
*/
|
||||
if (cell->fenced_buffers[batch].head)
|
||||
if (cell->fenced_buffers[batch].head) {
|
||||
emit_fence(cell);
|
||||
size = cell->buffer_size[batch];
|
||||
}
|
||||
|
||||
flushing = TRUE;
|
||||
|
||||
|
|
|
@ -106,4 +106,17 @@ cell_clear_surface(struct pipe_context *pipe, struct pipe_surface *ps,
|
|||
clr->surface = surfIndex;
|
||||
clr->value = clearValue;
|
||||
}
|
||||
|
||||
/* Technically, the surface's contents are now known and cleared,
|
||||
* so we could set the status to PIPE_SURFACE_STATUS_CLEAR. But
|
||||
* it turns out it's quite painful to recognize when any particular
|
||||
* surface goes from PIPE_SURFACE_STATUS_CLEAR to
|
||||
* PIPE_SURFACE_STATUS_DEFINED (i.e. with known contents), because
|
||||
* the drawing commands could be operating on numerous draw buffers,
|
||||
* which we'd have to iterate through to set all their stati...
|
||||
* For now, we cheat a bit and set the surface's status to DEFINED
|
||||
* right here. Later we should revisit this and set the status to
|
||||
* CLEAR here, and find a better place to set the status to DEFINED.
|
||||
*/
|
||||
ps->status = PIPE_SURFACE_STATUS_DEFINED;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ struct cell_buffer_node;
|
|||
*/
|
||||
struct cell_buffer_list
|
||||
{
|
||||
struct cell_fence fence;
|
||||
struct cell_fence fence ALIGN16_ATTRIB;
|
||||
struct cell_buffer_node *head;
|
||||
};
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ void
|
|||
cell_fence_init(struct cell_fence *fence)
|
||||
{
|
||||
uint i;
|
||||
ASSERT_ALIGN16(fence->status);
|
||||
for (i = 0; i < CELL_MAX_SPUS; i++) {
|
||||
fence->status[i][0] = CELL_FENCE_IDLE;
|
||||
}
|
||||
|
@ -50,9 +51,9 @@ cell_fence_signalled(const struct cell_context *cell,
|
|||
{
|
||||
uint i;
|
||||
for (i = 0; i < cell->num_spus; i++) {
|
||||
//ASSERT(fence->status[i][0] != CELL_FENCE_IDLE);
|
||||
if (fence->status[i][0] == CELL_FENCE_EMITTED)
|
||||
if (fence->status[i][0] != CELL_FENCE_SIGNALLED)
|
||||
return FALSE;
|
||||
/*assert(fence->status[i][0] == CELL_FENCE_EMITTED);*/
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -65,6 +66,15 @@ cell_fence_finish(const struct cell_context *cell,
|
|||
while (!cell_fence_signalled(cell, fence)) {
|
||||
usleep(10);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
uint i;
|
||||
for (i = 0; i < cell->num_spus; i++) {
|
||||
assert(fence->status[i][0] == CELL_FENCE_SIGNALLED);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ cell_flush(struct pipe_context *pipe, unsigned flags,
|
|||
flags |= CELL_FLUSH_WAIT;
|
||||
}
|
||||
|
||||
if (flags & PIPE_FLUSH_SWAPBUFFERS)
|
||||
if (flags & (PIPE_FLUSH_SWAPBUFFERS | PIPE_FLUSH_RENDER_CACHE))
|
||||
flags |= CELL_FLUSH_WAIT;
|
||||
|
||||
draw_flush( cell->draw );
|
||||
|
|
|
@ -1303,60 +1303,91 @@ lookup_function(struct cell_context *cell, const char *funcname)
|
|||
/**
|
||||
* Emit code to call a SPU function.
|
||||
* Used to implement instructions like SIN/COS/POW/TEX/etc.
|
||||
* If scalar, only the X components of the src regs are used, and the
|
||||
* result is replicated across the dest register's XYZW components.
|
||||
*/
|
||||
static boolean
|
||||
emit_function_call(struct codegen *gen,
|
||||
const struct tgsi_full_instruction *inst,
|
||||
char *funcname, uint num_args)
|
||||
char *funcname, uint num_args, boolean scalar)
|
||||
{
|
||||
const uint addr = lookup_function(gen->cell, funcname);
|
||||
char comment[100];
|
||||
int ch;
|
||||
int s_regs[3];
|
||||
int func_called = FALSE;
|
||||
uint a, ch;
|
||||
int retval_reg = -1;
|
||||
|
||||
assert(num_args <= 3);
|
||||
|
||||
snprintf(comment, sizeof(comment), "CALL %s:", funcname);
|
||||
spe_comment(gen->f, -4, comment);
|
||||
|
||||
if (scalar) {
|
||||
for (a = 0; a < num_args; a++) {
|
||||
s_regs[a] = get_src_reg(gen, CHAN_X, &inst->FullSrcRegisters[a]);
|
||||
}
|
||||
/* we'll call the function, put the return value in this register,
|
||||
* then replicate it across all write-enabled components in d_reg.
|
||||
*/
|
||||
retval_reg = spe_allocate_available_register(gen->f);
|
||||
}
|
||||
|
||||
for (ch = 0; ch < 4; ch++) {
|
||||
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
|
||||
int s_regs[3], d_reg;
|
||||
int d_reg;
|
||||
ubyte usedRegs[SPE_NUM_REGS];
|
||||
uint a, i, numUsed;
|
||||
uint i, numUsed;
|
||||
|
||||
for (a = 0; a < num_args; a++) {
|
||||
s_regs[a] = get_src_reg(gen, ch, &inst->FullSrcRegisters[a]);
|
||||
if (!scalar) {
|
||||
for (a = 0; a < num_args; a++) {
|
||||
s_regs[a] = get_src_reg(gen, ch, &inst->FullSrcRegisters[a]);
|
||||
}
|
||||
}
|
||||
|
||||
d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
|
||||
|
||||
numUsed = spe_get_registers_used(gen->f, usedRegs);
|
||||
assert(numUsed < gen->frame_size / 16 - 2);
|
||||
if (!scalar || !func_called) {
|
||||
/* for a scalar function, we'll really only call the function once */
|
||||
|
||||
/* save registers to stack */
|
||||
for (i = 0; i < numUsed; i++) {
|
||||
uint reg = usedRegs[i];
|
||||
int offset = 2 + i;
|
||||
spe_stqd(gen->f, reg, SPE_REG_SP, 16 * offset);
|
||||
}
|
||||
numUsed = spe_get_registers_used(gen->f, usedRegs);
|
||||
assert(numUsed < gen->frame_size / 16 - 2);
|
||||
|
||||
/* setup function arguments */
|
||||
for (a = 0; a < num_args; a++) {
|
||||
spe_move(gen->f, 3 + a, s_regs[a]);
|
||||
}
|
||||
|
||||
/* branch to function, save return addr */
|
||||
spe_brasl(gen->f, SPE_REG_RA, addr);
|
||||
|
||||
/* save function's return value */
|
||||
spe_move(gen->f, d_reg, 3);
|
||||
|
||||
/* restore registers from stack */
|
||||
for (i = 0; i < numUsed; i++) {
|
||||
uint reg = usedRegs[i];
|
||||
if (reg != d_reg) {
|
||||
/* save registers to stack */
|
||||
for (i = 0; i < numUsed; i++) {
|
||||
uint reg = usedRegs[i];
|
||||
int offset = 2 + i;
|
||||
spe_lqd(gen->f, reg, SPE_REG_SP, 16 * offset);
|
||||
spe_stqd(gen->f, reg, SPE_REG_SP, 16 * offset);
|
||||
}
|
||||
|
||||
/* setup function arguments */
|
||||
for (a = 0; a < num_args; a++) {
|
||||
spe_move(gen->f, 3 + a, s_regs[a]);
|
||||
}
|
||||
|
||||
/* branch to function, save return addr */
|
||||
spe_brasl(gen->f, SPE_REG_RA, addr);
|
||||
|
||||
/* save function's return value */
|
||||
if (scalar)
|
||||
spe_move(gen->f, retval_reg, 3);
|
||||
else
|
||||
spe_move(gen->f, d_reg, 3);
|
||||
|
||||
/* restore registers from stack */
|
||||
for (i = 0; i < numUsed; i++) {
|
||||
uint reg = usedRegs[i];
|
||||
if (reg != d_reg && reg != retval_reg) {
|
||||
int offset = 2 + i;
|
||||
spe_lqd(gen->f, reg, SPE_REG_SP, 16 * offset);
|
||||
}
|
||||
}
|
||||
|
||||
func_called = TRUE;
|
||||
}
|
||||
|
||||
if (scalar) {
|
||||
spe_move(gen->f, d_reg, retval_reg);
|
||||
}
|
||||
|
||||
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
|
||||
|
@ -1364,6 +1395,10 @@ emit_function_call(struct codegen *gen,
|
|||
}
|
||||
}
|
||||
|
||||
if (scalar) {
|
||||
spe_release_register(gen->f, retval_reg);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1770,15 +1805,15 @@ emit_instruction(struct codegen *gen,
|
|||
return emit_END(gen);
|
||||
|
||||
case TGSI_OPCODE_COS:
|
||||
return emit_function_call(gen, inst, "spu_cos", 1);
|
||||
return emit_function_call(gen, inst, "spu_cos", 1, TRUE);
|
||||
case TGSI_OPCODE_SIN:
|
||||
return emit_function_call(gen, inst, "spu_sin", 1);
|
||||
return emit_function_call(gen, inst, "spu_sin", 1, TRUE);
|
||||
case TGSI_OPCODE_POW:
|
||||
return emit_function_call(gen, inst, "spu_pow", 2);
|
||||
return emit_function_call(gen, inst, "spu_pow", 2, TRUE);
|
||||
case TGSI_OPCODE_EXPBASE2:
|
||||
return emit_function_call(gen, inst, "spu_exp2", 1);
|
||||
return emit_function_call(gen, inst, "spu_exp2", 1, TRUE);
|
||||
case TGSI_OPCODE_LOGBASE2:
|
||||
return emit_function_call(gen, inst, "spu_log2", 1);
|
||||
return emit_function_call(gen, inst, "spu_log2", 1, TRUE);
|
||||
case TGSI_OPCODE_TEX:
|
||||
/* fall-through for now */
|
||||
case TGSI_OPCODE_TXD:
|
||||
|
|
|
@ -1141,13 +1141,17 @@ gen_colormask(struct spe_function *f,
|
|||
* access to the Compare Immediate instructions where we don't in
|
||||
* gen_depth_test(), which is what makes us very different.
|
||||
*
|
||||
* There's some added complexity if there's a non-trivial state->mask
|
||||
* value; then stencil and reference both must be masked
|
||||
*
|
||||
* The return value in the stencil_pass_reg is a bitmask of valid
|
||||
* fragments that also passed the stencil test. The bitmask of valid
|
||||
* fragments that failed would be found in (mask_reg & ~stencil_pass_reg).
|
||||
* fragments that failed would be found in (fragment_mask_reg & ~stencil_pass_reg).
|
||||
*/
|
||||
static void
|
||||
gen_stencil_test(struct spe_function *f, const struct pipe_stencil_state *state,
|
||||
unsigned int mask_reg, unsigned int fbS_reg,
|
||||
unsigned int stencil_max_value,
|
||||
unsigned int fragment_mask_reg, unsigned int fbS_reg,
|
||||
unsigned int stencil_pass_reg)
|
||||
{
|
||||
/* Generate code that puts the set of passing fragments into the stencil_pass_reg
|
||||
|
@ -1155,68 +1159,134 @@ gen_stencil_test(struct spe_function *f, const struct pipe_stencil_state *state,
|
|||
*/
|
||||
switch (state->func) {
|
||||
case PIPE_FUNC_EQUAL:
|
||||
/* stencil_pass = mask & (s == reference) */
|
||||
spe_compare_equal_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
|
||||
spe_and(f, stencil_pass_reg, mask_reg, stencil_pass_reg);
|
||||
if (state->value_mask == stencil_max_value) {
|
||||
/* stencil_pass = fragment_mask & (s == reference) */
|
||||
spe_compare_equal_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
|
||||
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
}
|
||||
else {
|
||||
/* stencil_pass = fragment_mask & ((s&mask) == (reference&mask)) */
|
||||
unsigned int tmp_masked_stencil = spe_allocate_available_register(f);
|
||||
spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
|
||||
spe_compare_equal_uint(f, stencil_pass_reg, tmp_masked_stencil, state->value_mask & state->ref_value);
|
||||
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
spe_release_register(f, tmp_masked_stencil);
|
||||
}
|
||||
break;
|
||||
|
||||
case PIPE_FUNC_NOTEQUAL:
|
||||
/* stencil_pass = mask & ~(s == reference) */
|
||||
spe_compare_equal_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
|
||||
spe_andc(f, stencil_pass_reg, mask_reg, stencil_pass_reg);
|
||||
if (state->value_mask == stencil_max_value) {
|
||||
/* stencil_pass = fragment_mask & ~(s == reference) */
|
||||
spe_compare_equal_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
|
||||
spe_andc(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
}
|
||||
else {
|
||||
/* stencil_pass = fragment_mask & ~((s&mask) == (reference&mask)) */
|
||||
unsigned int tmp_masked_stencil = spe_allocate_available_register(f);
|
||||
spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
|
||||
spe_compare_equal_uint(f, stencil_pass_reg, tmp_masked_stencil, state->value_mask & state->ref_value);
|
||||
spe_andc(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
spe_release_register(f, tmp_masked_stencil);
|
||||
}
|
||||
break;
|
||||
|
||||
case PIPE_FUNC_GREATER:
|
||||
/* stencil_pass = mask & (s > reference) */
|
||||
spe_compare_greater_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
|
||||
spe_and(f, stencil_pass_reg, mask_reg, stencil_pass_reg);
|
||||
if (state->value_mask == stencil_max_value) {
|
||||
/* stencil_pass = fragment_mask & (s > reference) */
|
||||
spe_compare_greater_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
|
||||
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
}
|
||||
else {
|
||||
/* stencil_pass = fragment_mask & ((s&mask) > (reference&mask)) */
|
||||
unsigned int tmp_masked_stencil = spe_allocate_available_register(f);
|
||||
spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
|
||||
spe_compare_greater_uint(f, stencil_pass_reg, tmp_masked_stencil, state->value_mask & state->ref_value);
|
||||
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
spe_release_register(f, tmp_masked_stencil);
|
||||
}
|
||||
break;
|
||||
|
||||
case PIPE_FUNC_LESS: {
|
||||
/* stencil_pass = mask & (reference > s) */
|
||||
/* There's no convenient Compare Less Than Immediate instruction, so
|
||||
* we'll have to do this one the harder way, by loading a register and
|
||||
* comparing directly. Compare Logical Greater Than Word (clgt)
|
||||
* treats its operands as unsigned - no sign extension.
|
||||
*/
|
||||
unsigned int tmp_reg = spe_allocate_available_register(f);
|
||||
spe_load_uint(f, tmp_reg, state->ref_value);
|
||||
spe_clgt(f, stencil_pass_reg, tmp_reg, fbS_reg);
|
||||
spe_and(f, stencil_pass_reg, mask_reg, stencil_pass_reg);
|
||||
spe_release_register(f, tmp_reg);
|
||||
case PIPE_FUNC_LESS:
|
||||
if (state->value_mask == stencil_max_value) {
|
||||
/* stencil_pass = fragment_mask & (reference > s) */
|
||||
/* There's no convenient Compare Less Than Immediate instruction, so
|
||||
* we'll have to do this one the harder way, by loading a register and
|
||||
* comparing directly. Compare Logical Greater Than Word (clgt)
|
||||
* treats its operands as unsigned - no sign extension.
|
||||
*/
|
||||
unsigned int tmp_reg = spe_allocate_available_register(f);
|
||||
spe_load_uint(f, tmp_reg, state->ref_value);
|
||||
spe_clgt(f, stencil_pass_reg, tmp_reg, fbS_reg);
|
||||
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
spe_release_register(f, tmp_reg);
|
||||
}
|
||||
else {
|
||||
/* stencil_pass = fragment_mask & ((reference&mask) > (s&mask)) */
|
||||
unsigned int tmp_reg = spe_allocate_available_register(f);
|
||||
unsigned int tmp_masked_stencil = spe_allocate_available_register(f);
|
||||
spe_load_uint(f, tmp_reg, state->value_mask & state->ref_value);
|
||||
spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
|
||||
spe_clgt(f, stencil_pass_reg, tmp_reg, tmp_masked_stencil);
|
||||
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
spe_release_register(f, tmp_reg);
|
||||
spe_release_register(f, tmp_masked_stencil);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case PIPE_FUNC_LEQUAL:
|
||||
/* stencil_pass = mask & (s <= reference) = mask & ~(s > reference) */
|
||||
spe_compare_greater_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
|
||||
spe_andc(f, stencil_pass_reg, mask_reg, stencil_pass_reg);
|
||||
if (state->value_mask == stencil_max_value) {
|
||||
/* stencil_pass = fragment_mask & (s <= reference)
|
||||
* = fragment_mask & ~(s > reference) */
|
||||
spe_compare_greater_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
|
||||
spe_andc(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
}
|
||||
else {
|
||||
/* stencil_pass = fragment_mask & ~((s&mask) > (reference&mask)) */
|
||||
unsigned int tmp_masked_stencil = spe_allocate_available_register(f);
|
||||
spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
|
||||
spe_compare_greater_uint(f, stencil_pass_reg, tmp_masked_stencil, state->value_mask & state->ref_value);
|
||||
spe_andc(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
spe_release_register(f, tmp_masked_stencil);
|
||||
}
|
||||
break;
|
||||
|
||||
case PIPE_FUNC_GEQUAL: {
|
||||
/* stencil_pass = mask & (s >= reference) = mask & ~(reference > s) */
|
||||
/* As above, we have to do this by loading a register */
|
||||
unsigned int tmp_reg = spe_allocate_available_register(f);
|
||||
spe_load_uint(f, tmp_reg, state->ref_value);
|
||||
spe_clgt(f, stencil_pass_reg, tmp_reg, fbS_reg);
|
||||
spe_andc(f, stencil_pass_reg, mask_reg, stencil_pass_reg);
|
||||
spe_release_register(f, tmp_reg);
|
||||
case PIPE_FUNC_GEQUAL:
|
||||
if (state->value_mask == stencil_max_value) {
|
||||
/* stencil_pass = fragment_mask & (s >= reference) ]
|
||||
* = fragment_mask & ~(reference > s) */
|
||||
/* As above, we have to do this by loading a register */
|
||||
unsigned int tmp_reg = spe_allocate_available_register(f);
|
||||
spe_load_uint(f, tmp_reg, state->ref_value);
|
||||
spe_clgt(f, stencil_pass_reg, tmp_reg, fbS_reg);
|
||||
spe_andc(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
spe_release_register(f, tmp_reg);
|
||||
}
|
||||
else {
|
||||
/* stencil_pass = fragment_mask & ~((reference&mask) > (s&mask)) */
|
||||
unsigned int tmp_reg = spe_allocate_available_register(f);
|
||||
unsigned int tmp_masked_stencil = spe_allocate_available_register(f);
|
||||
spe_load_uint(f, tmp_reg, state->ref_value & state->value_mask);
|
||||
spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
|
||||
spe_clgt(f, stencil_pass_reg, tmp_reg, tmp_masked_stencil);
|
||||
spe_andc(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
|
||||
spe_release_register(f, tmp_reg);
|
||||
spe_release_register(f, tmp_masked_stencil);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case PIPE_FUNC_NEVER:
|
||||
/* stencil_pass = mask & 0 = 0 */
|
||||
/* stencil_pass = fragment_mask & 0 = 0 */
|
||||
spe_load_uint(f, stencil_pass_reg, 0);
|
||||
break;
|
||||
|
||||
case PIPE_FUNC_ALWAYS:
|
||||
/* stencil_pass = mask & 1 = mask */
|
||||
spe_move(f, stencil_pass_reg, mask_reg);
|
||||
/* stencil_pass = fragment_mask & 1 = fragment_mask */
|
||||
spe_move(f, stencil_pass_reg, fragment_mask_reg);
|
||||
break;
|
||||
}
|
||||
|
||||
/* The fragments that passed the stencil test are now in stencil_pass_reg.
|
||||
* The fragments that failed would be (mask_reg & ~stencil_pass_reg).
|
||||
* The fragments that failed would be (fragment_mask_reg & ~stencil_pass_reg).
|
||||
*/
|
||||
}
|
||||
|
||||
|
@ -1282,7 +1352,7 @@ gen_stencil_values(struct spe_function *f, unsigned int stencil_op,
|
|||
/* Add Word Immediate computes rT = rA + 10-bit signed immediate */
|
||||
spe_ai(f, newS_reg, fbS_reg, 1);
|
||||
/* Select from the current value or the new value based on the equality test */
|
||||
spe_selb(f, newS_reg, fbS_reg, newS_reg, equals_reg);
|
||||
spe_selb(f, newS_reg, newS_reg, fbS_reg, equals_reg);
|
||||
|
||||
spe_release_register(f, equals_reg);
|
||||
break;
|
||||
|
@ -1295,7 +1365,7 @@ gen_stencil_values(struct spe_function *f, unsigned int stencil_op,
|
|||
/* Add Word Immediate with a (-1) value works */
|
||||
spe_ai(f, newS_reg, fbS_reg, -1);
|
||||
/* Select from the current value or the new value based on the equality test */
|
||||
spe_selb(f, newS_reg, fbS_reg, newS_reg, equals_reg);
|
||||
spe_selb(f, newS_reg, newS_reg, fbS_reg, equals_reg);
|
||||
|
||||
spe_release_register(f, equals_reg);
|
||||
break;
|
||||
|
@ -1534,15 +1604,28 @@ gen_stencil_depth_test(struct spe_function *f,
|
|||
* meaning that we have to calculate the stencil values but do not
|
||||
* need to mask them), we can avoid generating code. Don't forget
|
||||
* that we need to consider backfacing stencil, if enabled.
|
||||
*
|
||||
* Note that if the backface stencil is *not* enabled, the backface
|
||||
* stencil will have the same values as the frontface stencil.
|
||||
*/
|
||||
if (dsa->stencil[0].write_mask == 0x0 && (!dsa->stencil[1].enabled || dsa->stencil[1].write_mask == 0x00)) {
|
||||
/* Trivial: don't need to calculate stencil values, and don't need to
|
||||
* write them back to the framebuffer.
|
||||
if (dsa->stencil[0].fail_op == PIPE_STENCIL_OP_KEEP &&
|
||||
dsa->stencil[0].zfail_op == PIPE_STENCIL_OP_KEEP &&
|
||||
dsa->stencil[0].zpass_op == PIPE_STENCIL_OP_KEEP &&
|
||||
dsa->stencil[1].fail_op == PIPE_STENCIL_OP_KEEP &&
|
||||
dsa->stencil[1].zfail_op == PIPE_STENCIL_OP_KEEP &&
|
||||
dsa->stencil[1].zpass_op == PIPE_STENCIL_OP_KEEP) {
|
||||
/* No changes to any stencil values */
|
||||
need_to_calculate_stencil_values = false;
|
||||
need_to_writemask_stencil_values = false;
|
||||
}
|
||||
else if (dsa->stencil[0].write_mask == 0x0 && dsa->stencil[1].write_mask == 0x0) {
|
||||
/* All changes are writemasked out, so no need to calculate
|
||||
* what those changes might be, and no need to write anything back.
|
||||
*/
|
||||
need_to_calculate_stencil_values = false;
|
||||
need_to_writemask_stencil_values = false;
|
||||
}
|
||||
else if (dsa->stencil[0].write_mask == 0xff && (!dsa->stencil[1].enabled || dsa->stencil[1].write_mask == 0xff)) {
|
||||
else if (dsa->stencil[0].write_mask == 0xff && dsa->stencil[1].write_mask == 0xff) {
|
||||
/* Still trivial, but a little less so. We need to write the stencil
|
||||
* values, but we don't need to mask them.
|
||||
*/
|
||||
|
@ -1583,7 +1666,7 @@ gen_stencil_depth_test(struct spe_function *f,
|
|||
*/
|
||||
spe_comment(f, 0, "Running basic stencil test");
|
||||
stencil_pass_reg = spe_allocate_available_register(f);
|
||||
gen_stencil_test(f, &dsa->stencil[0], mask_reg, fbS_reg, stencil_pass_reg);
|
||||
gen_stencil_test(f, &dsa->stencil[0], 0xff, mask_reg, fbS_reg, stencil_pass_reg);
|
||||
|
||||
/* If two-sided stenciling is on, generate code to run the stencil
|
||||
* test on the backfacing stencil as well, and combine the two results
|
||||
|
@ -1592,7 +1675,7 @@ gen_stencil_depth_test(struct spe_function *f,
|
|||
if (dsa->stencil[1].enabled) {
|
||||
unsigned int temp_reg = spe_allocate_available_register(f);
|
||||
spe_comment(f, 0, "Running backface stencil test");
|
||||
gen_stencil_test(f, &dsa->stencil[1], mask_reg, fbS_reg, temp_reg);
|
||||
gen_stencil_test(f, &dsa->stencil[1], 0xff, mask_reg, fbS_reg, temp_reg);
|
||||
spe_selb(f, stencil_pass_reg, stencil_pass_reg, temp_reg, facing_reg);
|
||||
spe_release_register(f, temp_reg);
|
||||
}
|
||||
|
@ -1914,81 +1997,79 @@ cell_gen_fragment_function(struct cell_context *cell, struct spe_function *f)
|
|||
* Z and/or stencil. We'll also convert the incoming fragment Z
|
||||
* value in fragZ_reg from a floating point value in [0.0..1.0] to
|
||||
* an unsigned integer value with the appropriate resolution.
|
||||
* Note that even if depth or stencil is *not* enabled, if it's
|
||||
* present in the buffer, we pull it out and put it back later;
|
||||
* otherwise, we can inadvertently destroy the contents of
|
||||
* buffers we're not supposed to touch (e.g., if the user is
|
||||
* clearing the depth buffer but not the stencil buffer, a
|
||||
* quad of constant depth is drawn over the surface; the stencil
|
||||
* buffer must be maintained).
|
||||
*/
|
||||
switch(zs_format) {
|
||||
|
||||
case PIPE_FORMAT_S8Z24_UNORM: /* fall through */
|
||||
case PIPE_FORMAT_X8Z24_UNORM:
|
||||
if (dsa->depth.enabled) {
|
||||
/* We need the Z part at least */
|
||||
setup_optional_register(f, &fbZ_reg_set, &fbZ_reg);
|
||||
/* four 24-bit Z values in the low-order bits */
|
||||
spe_and_uint(f, fbZ_reg, fbZS_reg, 0x00ffffff);
|
||||
/* Pull out both Z and stencil */
|
||||
setup_optional_register(f, &fbZ_reg_set, &fbZ_reg);
|
||||
setup_optional_register(f, &fbS_reg_set, &fbS_reg);
|
||||
|
||||
/* Incoming fragZ_reg value is a float in 0.0...1.0; convert
|
||||
* to a 24-bit unsigned integer
|
||||
*/
|
||||
spe_cfltu(f, fragZ_reg, fragZ_reg, 32);
|
||||
spe_rotmi(f, fragZ_reg, fragZ_reg, -8);
|
||||
}
|
||||
if (dsa->stencil[0].enabled) {
|
||||
setup_optional_register(f, &fbS_reg_set, &fbS_reg);
|
||||
/* four 8-bit Z values in the high-order bits */
|
||||
spe_rotmi(f, fbS_reg, fbZS_reg, -24);
|
||||
}
|
||||
break;
|
||||
/* four 24-bit Z values in the low-order bits */
|
||||
spe_and_uint(f, fbZ_reg, fbZS_reg, 0x00ffffff);
|
||||
|
||||
/* Incoming fragZ_reg value is a float in 0.0...1.0; convert
|
||||
* to a 24-bit unsigned integer
|
||||
*/
|
||||
spe_cfltu(f, fragZ_reg, fragZ_reg, 32);
|
||||
spe_rotmi(f, fragZ_reg, fragZ_reg, -8);
|
||||
|
||||
/* four 8-bit stencil values in the high-order bits */
|
||||
spe_rotmi(f, fbS_reg, fbZS_reg, -24);
|
||||
break;
|
||||
|
||||
case PIPE_FORMAT_Z24S8_UNORM: /* fall through */
|
||||
case PIPE_FORMAT_Z24X8_UNORM:
|
||||
if (dsa->depth.enabled) {
|
||||
setup_optional_register(f, &fbZ_reg_set, &fbZ_reg);
|
||||
/* shift by 8 to get the upper 24-bit values */
|
||||
spe_rotmi(f, fbS_reg, fbZS_reg, -8);
|
||||
setup_optional_register(f, &fbZ_reg_set, &fbZ_reg);
|
||||
setup_optional_register(f, &fbS_reg_set, &fbS_reg);
|
||||
|
||||
/* Incoming fragZ_reg value is a float in 0.0...1.0; convert
|
||||
* to a 24-bit unsigned integer
|
||||
*/
|
||||
spe_cfltu(f, fragZ_reg, fragZ_reg, 32);
|
||||
spe_rotmi(f, fragZ_reg, fragZ_reg, -8);
|
||||
}
|
||||
if (dsa->stencil[0].enabled) {
|
||||
setup_optional_register(f, &fbS_reg_set, &fbS_reg);
|
||||
/* 8-bit stencil in the low-order bits - mask them out */
|
||||
spe_and_uint(f, fbS_reg, fbZS_reg, 0x000000ff);
|
||||
}
|
||||
break;
|
||||
/* shift by 8 to get the upper 24-bit values */
|
||||
spe_rotmi(f, fbS_reg, fbZS_reg, -8);
|
||||
|
||||
/* Incoming fragZ_reg value is a float in 0.0...1.0; convert
|
||||
* to a 24-bit unsigned integer
|
||||
*/
|
||||
spe_cfltu(f, fragZ_reg, fragZ_reg, 32);
|
||||
spe_rotmi(f, fragZ_reg, fragZ_reg, -8);
|
||||
|
||||
/* 8-bit stencil in the low-order bits - mask them out */
|
||||
spe_and_uint(f, fbS_reg, fbZS_reg, 0x000000ff);
|
||||
break;
|
||||
|
||||
case PIPE_FORMAT_Z32_UNORM:
|
||||
if (dsa->depth.enabled) {
|
||||
setup_optional_register(f, &fbZ_reg_set, &fbZ_reg);
|
||||
/* Copy over 4 32-bit values */
|
||||
spe_move(f, fbZ_reg, fbZS_reg);
|
||||
setup_optional_register(f, &fbZ_reg_set, &fbZ_reg);
|
||||
/* Copy over 4 32-bit values */
|
||||
spe_move(f, fbZ_reg, fbZS_reg);
|
||||
|
||||
/* Incoming fragZ_reg value is a float in 0.0...1.0; convert
|
||||
* to a 32-bit unsigned integer
|
||||
*/
|
||||
spe_cfltu(f, fragZ_reg, fragZ_reg, 32);
|
||||
}
|
||||
/* Incoming fragZ_reg value is a float in 0.0...1.0; convert
|
||||
* to a 32-bit unsigned integer
|
||||
*/
|
||||
spe_cfltu(f, fragZ_reg, fragZ_reg, 32);
|
||||
/* No stencil, so can't do anything there */
|
||||
break;
|
||||
break;
|
||||
|
||||
case PIPE_FORMAT_Z16_UNORM:
|
||||
if (dsa->depth.enabled) {
|
||||
/* XXX Not sure this is correct, but it was here before, so we're
|
||||
* going with it for now
|
||||
*/
|
||||
setup_optional_register(f, &fbZ_reg_set, &fbZ_reg);
|
||||
/* Copy over 4 32-bit values */
|
||||
spe_move(f, fbZ_reg, fbZS_reg);
|
||||
/* XXX Not sure this is correct, but it was here before, so we're
|
||||
* going with it for now
|
||||
*/
|
||||
setup_optional_register(f, &fbZ_reg_set, &fbZ_reg);
|
||||
/* Copy over 4 32-bit values */
|
||||
spe_move(f, fbZ_reg, fbZS_reg);
|
||||
|
||||
/* Incoming fragZ_reg value is a float in 0.0...1.0; convert
|
||||
* to a 16-bit unsigned integer
|
||||
*/
|
||||
spe_cfltu(f, fragZ_reg, fragZ_reg, 32);
|
||||
spe_rotmi(f, fragZ_reg, fragZ_reg, -16);
|
||||
}
|
||||
/* Incoming fragZ_reg value is a float in 0.0...1.0; convert
|
||||
* to a 16-bit unsigned integer
|
||||
*/
|
||||
spe_cfltu(f, fragZ_reg, fragZ_reg, 32);
|
||||
spe_rotmi(f, fragZ_reg, fragZ_reg, -16);
|
||||
/* No stencil */
|
||||
break;
|
||||
|
||||
default:
|
||||
ASSERT(0); /* invalid format */
|
||||
|
@ -2035,39 +2116,19 @@ cell_gen_fragment_function(struct cell_context *cell, struct spe_function *f)
|
|||
spe_comment(f, 0, "Store quad's depth/stencil values in tile");
|
||||
if (zs_format == PIPE_FORMAT_S8Z24_UNORM ||
|
||||
zs_format == PIPE_FORMAT_X8Z24_UNORM) {
|
||||
if (fbS_reg_set && fbZ_reg_set) {
|
||||
spe_shli(f, fbS_reg, fbS_reg, 24); /* fbS = fbS << 24 */
|
||||
spe_or(f, fbZS_reg, fbS_reg, fbZ_reg); /* fbZS = fbS | fbZ */
|
||||
}
|
||||
else if (fbS_reg_set) {
|
||||
spe_shli(f, fbZS_reg, fbS_reg, 24); /* fbS = fbS << 24 */
|
||||
}
|
||||
else {
|
||||
spe_move(f, fbZS_reg, fbZ_reg);
|
||||
}
|
||||
spe_shli(f, fbS_reg, fbS_reg, 24); /* fbS = fbS << 24 */
|
||||
spe_or(f, fbZS_reg, fbS_reg, fbZ_reg); /* fbZS = fbS | fbZ */
|
||||
}
|
||||
else if (zs_format == PIPE_FORMAT_Z24S8_UNORM ||
|
||||
zs_format == PIPE_FORMAT_Z24X8_UNORM) {
|
||||
if (fbS_reg_set && fbZ_reg_set) {
|
||||
spe_shli(f, fbZ_reg, fbZ_reg, 8); /* fbZ = fbZ << 8 */
|
||||
spe_or(f, fbZS_reg, fbS_reg, fbZ_reg); /* fbZS = fbS | fbZ */
|
||||
}
|
||||
else if (fbS_reg_set) {
|
||||
spe_move(f, fbZS_reg, fbS_reg);
|
||||
}
|
||||
else {
|
||||
spe_shli(f, fbZ_reg, fbZ_reg, 8); /* fbZ = fbZ << 8 */
|
||||
}
|
||||
spe_shli(f, fbZ_reg, fbZ_reg, 8); /* fbZ = fbZ << 8 */
|
||||
spe_or(f, fbZS_reg, fbS_reg, fbZ_reg); /* fbZS = fbS | fbZ */
|
||||
}
|
||||
else if (zs_format == PIPE_FORMAT_Z32_UNORM) {
|
||||
if (fbZ_reg_set) {
|
||||
spe_move(f, fbZS_reg, fbZ_reg); /* fbZS = fbZ */
|
||||
}
|
||||
spe_move(f, fbZS_reg, fbZ_reg); /* fbZS = fbZ */
|
||||
}
|
||||
else if (zs_format == PIPE_FORMAT_Z16_UNORM) {
|
||||
if (fbZ_reg_set) {
|
||||
spe_move(f, fbZS_reg, fbZ_reg); /* fbZS = fbZ */
|
||||
}
|
||||
spe_move(f, fbZS_reg, fbZ_reg); /* fbZS = fbZ */
|
||||
}
|
||||
else if (zs_format == PIPE_FORMAT_S8_UNORM) {
|
||||
ASSERT(0); /* XXX to do */
|
||||
|
@ -2080,6 +2141,7 @@ cell_gen_fragment_function(struct cell_context *cell, struct spe_function *f)
|
|||
spe_stqx(f, fbZS_reg, depth_tile_reg, quad_offset_reg);
|
||||
}
|
||||
|
||||
/* Don't need these any more */
|
||||
release_optional_register(f, &fbZ_reg_set, fbZ_reg);
|
||||
release_optional_register(f, &fbS_reg_set, fbS_reg);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
|
||||
#include <libspe2.h>
|
||||
#include <libmisc.h>
|
||||
#include <pthread.h>
|
||||
#include "cell/common.h"
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
* Authors:
|
||||
* Keith Whitwell <keith@tungstengraphics.com>
|
||||
* Michel Dänzer <michel@tungstengraphics.com>
|
||||
* Brian Paul
|
||||
*/
|
||||
|
||||
#include "pipe/p_context.h"
|
||||
|
@ -42,10 +43,9 @@
|
|||
#include "cell_texture.h"
|
||||
|
||||
|
||||
/* Simple, maximally packed layout.
|
||||
*/
|
||||
|
||||
static unsigned minify( unsigned d )
|
||||
static unsigned
|
||||
minify(unsigned d)
|
||||
{
|
||||
return MAX2(1, d>>1);
|
||||
}
|
||||
|
@ -211,6 +211,89 @@ twiddle_image_uint(uint w, uint h, uint tile_size, uint *dst,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* For Cell. Basically, rearrange the pixels/quads from this layout:
|
||||
* +--+--+--+--+
|
||||
* |p0|p1|p2|p3|....
|
||||
* +--+--+--+--+
|
||||
*
|
||||
* to this layout:
|
||||
* +--+--+
|
||||
* |p0|p1|....
|
||||
* +--+--+
|
||||
* |p2|p3|
|
||||
* +--+--+
|
||||
*/
|
||||
static void
|
||||
twiddle_tile(const uint *tileIn, uint *tileOut)
|
||||
{
|
||||
int y, x;
|
||||
|
||||
for (y = 0; y < TILE_SIZE; y+=2) {
|
||||
for (x = 0; x < TILE_SIZE; x+=2) {
|
||||
int k = 4 * (y/2 * TILE_SIZE/2 + x/2);
|
||||
tileOut[y * TILE_SIZE + (x + 0)] = tileIn[k];
|
||||
tileOut[y * TILE_SIZE + (x + 1)] = tileIn[k+1];
|
||||
tileOut[(y + 1) * TILE_SIZE + (x + 0)] = tileIn[k+2];
|
||||
tileOut[(y + 1) * TILE_SIZE + (x + 1)] = tileIn[k+3];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert image from tiled layout to linear layout. 4-byte pixels.
|
||||
*/
|
||||
static void
|
||||
untwiddle_image_uint(uint w, uint h, uint tile_size, uint *dst,
|
||||
uint dst_stride, const uint *src)
|
||||
{
|
||||
const uint tile_size2 = tile_size * tile_size;
|
||||
const uint h_t = (h + tile_size - 1) / tile_size;
|
||||
const uint w_t = (w + tile_size - 1) / tile_size;
|
||||
uint *tile_buf;
|
||||
uint it, jt; /* tile counters */
|
||||
uint i, j; /* intra-tile counters */
|
||||
|
||||
dst_stride /= 4; /* convert from bytes to pixels */
|
||||
|
||||
tile_buf = align_malloc(tile_size * tile_size * 4, 16);
|
||||
|
||||
/* loop over src tiles */
|
||||
for (it = 0; it < h_t; it++) {
|
||||
for (jt = 0; jt < w_t; jt++) {
|
||||
/* start of src tile: */
|
||||
const uint *tsrc = src + (it * w_t + jt) * tile_size2;
|
||||
|
||||
twiddle_tile(tsrc, tile_buf);
|
||||
tsrc = tile_buf;
|
||||
|
||||
/* compute size of this tile (may be smaller than tile_size) */
|
||||
/* XXX note: a compiler bug was found here. That's why the code
|
||||
* looks as it does.
|
||||
*/
|
||||
uint tile_width = w - jt * tile_size;
|
||||
tile_width = MIN2(tile_width, tile_size);
|
||||
uint tile_height = h - it * tile_size;
|
||||
tile_height = MIN2(tile_height, tile_size);
|
||||
|
||||
/* loop over texels in the tile */
|
||||
for (i = 0; i < tile_height; i++) {
|
||||
for (j = 0; j < tile_width; j++) {
|
||||
uint dsti = it * tile_size + i;
|
||||
uint dstj = jt * tile_size + j;
|
||||
ASSERT(dsti < h);
|
||||
ASSERT(dstj < w);
|
||||
dst[dsti * dst_stride + dstj] = tsrc[i * tile_size + j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
align_free(tile_buf);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert linear texture image data to tiled format for SPU usage.
|
||||
*/
|
||||
|
@ -230,6 +313,7 @@ cell_twiddle_texture(struct pipe_screen *screen,
|
|||
|
||||
switch (ct->base.format) {
|
||||
case PIPE_FORMAT_A8R8G8B8_UNORM:
|
||||
case PIPE_FORMAT_B8G8R8A8_UNORM:
|
||||
{
|
||||
int numFaces = ct->base.target == PIPE_TEXTURE_CUBE ? 6 : 1;
|
||||
int offset = bufWidth * bufHeight * 4 * surface->face;
|
||||
|
@ -261,6 +345,51 @@ cell_twiddle_texture(struct pipe_screen *screen,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert SPU tiled texture image data to linear format for app usage.
|
||||
*/
|
||||
static void
|
||||
cell_untwiddle_texture(struct pipe_screen *screen,
|
||||
struct pipe_surface *surface)
|
||||
{
|
||||
struct cell_texture *ct = cell_texture(surface->texture);
|
||||
const uint level = surface->level;
|
||||
const uint texWidth = ct->base.width[level];
|
||||
const uint texHeight = ct->base.height[level];
|
||||
const void *map = pipe_buffer_map(screen, surface->buffer,
|
||||
PIPE_BUFFER_USAGE_CPU_READ);
|
||||
const uint *src = (const uint *) ((const ubyte *) map + surface->offset);
|
||||
|
||||
switch (ct->base.format) {
|
||||
case PIPE_FORMAT_A8R8G8B8_UNORM:
|
||||
case PIPE_FORMAT_B8G8R8A8_UNORM:
|
||||
{
|
||||
int numFaces = ct->base.target == PIPE_TEXTURE_CUBE ? 6 : 1;
|
||||
int offset = surface->stride * texHeight * 4 * surface->face;
|
||||
uint *dst;
|
||||
|
||||
if (!ct->untiled_data[level]) {
|
||||
ct->untiled_data[level] =
|
||||
align_malloc(surface->stride * texHeight * 4 * numFaces, 16);
|
||||
}
|
||||
|
||||
dst = (uint *) ((ubyte *) ct->untiled_data[level] + offset);
|
||||
|
||||
untwiddle_image_uint(texWidth, texHeight, TILE_SIZE, dst,
|
||||
surface->stride, src);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
ct->untiled_data[level] = NULL;
|
||||
printf("Cell: untwiddle unsupported texture format\n");
|
||||
}
|
||||
}
|
||||
|
||||
pipe_buffer_unmap(screen, surface->buffer);
|
||||
}
|
||||
|
||||
|
||||
static struct pipe_surface *
|
||||
cell_get_tex_surface(struct pipe_screen *screen,
|
||||
struct pipe_texture *pt,
|
||||
|
@ -294,13 +423,18 @@ cell_get_tex_surface(struct pipe_screen *screen,
|
|||
ps->zslice = zslice;
|
||||
|
||||
if (pt->target == PIPE_TEXTURE_CUBE || pt->target == PIPE_TEXTURE_3D) {
|
||||
ps->offset += ((pt->target == PIPE_TEXTURE_CUBE) ? face : zslice) *
|
||||
ps->nblocksy *
|
||||
ps->stride;
|
||||
ps->offset += ((pt->target == PIPE_TEXTURE_CUBE) ? face : zslice) *
|
||||
ps->nblocksy *
|
||||
ps->stride;
|
||||
}
|
||||
else {
|
||||
assert(face == 0);
|
||||
assert(zslice == 0);
|
||||
assert(face == 0);
|
||||
assert(zslice == 0);
|
||||
}
|
||||
|
||||
if (ps->usage & PIPE_BUFFER_USAGE_CPU_READ) {
|
||||
/* convert from tiled to linear layout */
|
||||
cell_untwiddle_texture(screen, ps);
|
||||
}
|
||||
}
|
||||
return ps;
|
||||
|
@ -311,6 +445,15 @@ static void
|
|||
cell_tex_surface_release(struct pipe_screen *screen,
|
||||
struct pipe_surface **s)
|
||||
{
|
||||
struct cell_texture *ct = cell_texture((*s)->texture);
|
||||
const uint level = (*s)->level;
|
||||
|
||||
if (((*s)->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level]))
|
||||
{
|
||||
align_free(ct->untiled_data[level]);
|
||||
ct->untiled_data[level] = NULL;
|
||||
}
|
||||
|
||||
/* XXX if done rendering to teximage, re-tile */
|
||||
|
||||
pipe_texture_reference(&(*s)->texture, NULL);
|
||||
|
@ -325,6 +468,10 @@ cell_surface_map(struct pipe_screen *screen,
|
|||
unsigned flags)
|
||||
{
|
||||
ubyte *map;
|
||||
struct cell_texture *ct = cell_texture(surface->texture);
|
||||
const uint level = surface->level;
|
||||
|
||||
assert(ct);
|
||||
|
||||
if (flags & ~surface->usage) {
|
||||
assert(0);
|
||||
|
@ -335,7 +482,14 @@ cell_surface_map(struct pipe_screen *screen,
|
|||
if (map == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return (void *) (map + surface->offset);
|
||||
{
|
||||
if ((surface->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level])) {
|
||||
return (void *) ((ubyte *) ct->untiled_data[level] + surface->offset);
|
||||
}
|
||||
else {
|
||||
return (void *) (map + surface->offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ struct cell_texture
|
|||
struct pipe_buffer *tiled_buffer[CELL_MAX_TEXTURE_LEVELS];
|
||||
/** Mapped, tiled texture data */
|
||||
void *tiled_mapped[CELL_MAX_TEXTURE_LEVELS];
|
||||
void *untiled_data[CELL_MAX_TEXTURE_LEVELS];
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ cmd_fence(struct cell_command_fence *fence_cmd)
|
|||
CELL_FENCE_SIGNALLED};
|
||||
uint *dst = (uint *) fence_cmd->fence;
|
||||
dst += 4 * spu.init.id; /* main store/memory address, not local store */
|
||||
|
||||
ASSERT_ALIGN16(dst);
|
||||
mfc_put((void *) &status, /* src in local memory */
|
||||
(unsigned int) dst, /* dst in main memory */
|
||||
sizeof(status), /* size */
|
||||
|
@ -244,8 +244,7 @@ cmd_state_fragment_ops(const struct cell_command_fragment_ops *fops)
|
|||
}
|
||||
}
|
||||
|
||||
spu.read_depth = spu.depth_stencil_alpha.depth.enabled;
|
||||
spu.read_stencil = spu.depth_stencil_alpha.stencil[0].enabled;
|
||||
spu.read_depth_stencil = (spu.depth_stencil_alpha.depth.enabled || spu.depth_stencil_alpha.stencil[0].enabled);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -38,7 +38,9 @@
|
|||
#include <math.h>
|
||||
#include <cos14_v.h>
|
||||
#include <sin14_v.h>
|
||||
#include <transpose_matrix4x4.h>
|
||||
#include <simdmath/exp2f4.h>
|
||||
#include <simdmath/log2f4.h>
|
||||
#include <simdmath/powf4.h>
|
||||
|
||||
#include "cell/common.h"
|
||||
#include "spu_main.h"
|
||||
|
@ -68,37 +70,19 @@ spu_sin(vector float x)
|
|||
static vector float
|
||||
spu_pow(vector float x, vector float y)
|
||||
{
|
||||
float z0 = powf(spu_extract(x,0), spu_extract(y,0));
|
||||
float z1 = powf(spu_extract(x,1), spu_extract(y,1));
|
||||
float z2 = powf(spu_extract(x,2), spu_extract(y,2));
|
||||
float z3 = powf(spu_extract(x,3), spu_extract(y,3));
|
||||
return (vector float) {z0, z1, z2, z3};
|
||||
return _powf4(x, y);
|
||||
}
|
||||
|
||||
static vector float
|
||||
spu_exp2(vector float x)
|
||||
{
|
||||
float z0 = powf(2.0f, spu_extract(x,0));
|
||||
float z1 = powf(2.0f, spu_extract(x,1));
|
||||
float z2 = powf(2.0f, spu_extract(x,2));
|
||||
float z3 = powf(2.0f, spu_extract(x,3));
|
||||
return (vector float) {z0, z1, z2, z3};
|
||||
return _exp2f4(x);
|
||||
}
|
||||
|
||||
static vector float
|
||||
spu_log2(vector float x)
|
||||
{
|
||||
/*
|
||||
* log_base_2(x) = log(x) / log(2)
|
||||
* 1.442695 = 1/log(2).
|
||||
*/
|
||||
static const vector float k = {1.442695F, 1.442695F, 1.442695F, 1.442695F};
|
||||
float z0 = logf(spu_extract(x,0));
|
||||
float z1 = logf(spu_extract(x,1));
|
||||
float z2 = logf(spu_extract(x,2));
|
||||
float z3 = logf(spu_extract(x,3));
|
||||
vector float v = (vector float) {z0, z1, z2, z3};
|
||||
return spu_mul(v, k);
|
||||
return _log2f4(x);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -160,8 +160,7 @@ struct spu_global
|
|||
tile_t ztile ALIGN16_ATTRIB;
|
||||
|
||||
/** Read depth/stencil tiles? */
|
||||
boolean read_depth;
|
||||
boolean read_stencil;
|
||||
boolean read_depth_stencil;
|
||||
|
||||
/** Current tiles' status */
|
||||
ubyte cur_ctile_status, cur_ztile_status;
|
||||
|
|
|
@ -98,7 +98,7 @@ my_tile(uint tx, uint ty)
|
|||
static INLINE void
|
||||
get_cz_tiles(uint tx, uint ty)
|
||||
{
|
||||
if (spu.read_depth) {
|
||||
if (spu.read_depth_stencil) {
|
||||
if (spu.cur_ztile_status != TILE_STATUS_CLEAR) {
|
||||
//printf("SPU %u: getting Z tile %u, %u\n", spu.init.id, tx, ty);
|
||||
get_tile(tx, ty, &spu.ztile, TAG_READ_TILE_Z, 1);
|
||||
|
@ -153,7 +153,7 @@ static INLINE void
|
|||
wait_put_cz_tiles(void)
|
||||
{
|
||||
wait_on_mask(1 << TAG_WRITE_TILE_COLOR);
|
||||
if (spu.read_depth) {
|
||||
if (spu.read_depth_stencil) {
|
||||
wait_on_mask(1 << TAG_WRITE_TILE_Z);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -369,7 +369,7 @@ flush_spans(void)
|
|||
}
|
||||
ASSERT(spu.cur_ctile_status != TILE_STATUS_DEFINED);
|
||||
|
||||
if (spu.read_depth) {
|
||||
if (spu.read_depth_stencil) {
|
||||
if (spu.cur_ztile_status == TILE_STATUS_GETTING) {
|
||||
/* wait for mfc_get() to complete */
|
||||
//printf("SPU: %u: waiting for ztile\n", spu.init.id);
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include "tgsi/tgsi_sse2.h"
|
||||
|
||||
|
||||
#if defined(PIPE_ARCH_X86) && defined(PIPE_ARCH_SSE)
|
||||
#if defined(PIPE_ARCH_X86)
|
||||
|
||||
#include "rtasm/rtasm_x86sse.h"
|
||||
|
||||
|
@ -92,7 +92,8 @@ fs_sse_run( const struct sp_fragment_shader *base,
|
|||
machine->Temps);
|
||||
|
||||
/* init kill mask */
|
||||
machine->Temps[TGSI_EXEC_TEMP_KILMASK_I].xyzw[TGSI_EXEC_TEMP_KILMASK_C].u[0] = 0x0;
|
||||
tgsi_set_kill_mask(machine, 0x0);
|
||||
tgsi_set_exec_mask(machine, 1, 1, 1, 1);
|
||||
|
||||
shader->func( machine->Inputs,
|
||||
machine->Outputs,
|
||||
|
|
|
@ -64,6 +64,14 @@ output_quad(struct quad_stage *qs, struct quad_header *quad)
|
|||
for (i = 0; i < 4; i++) { /* loop over color chans */
|
||||
tile->data.color[y][x][i] = quadColor[i][j];
|
||||
}
|
||||
if (0) {
|
||||
debug_printf("sp write pixel %d,%d: %g, %g, %g\n",
|
||||
quad->input.x0 + x,
|
||||
quad->input.y0 + y,
|
||||
quadColor[0][j],
|
||||
quadColor[1][j],
|
||||
quadColor[2][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef DBG
|
||||
#if defined(DBG) || defined(DEBUG)
|
||||
#ifndef DEBUG
|
||||
#define DEBUG 1
|
||||
#endif
|
||||
|
|
|
@ -82,10 +82,13 @@ static INLINE void
|
|||
pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
|
||||
{
|
||||
/* bump the refcount first */
|
||||
if (surf)
|
||||
if (surf) {
|
||||
assert(surf->refcount);
|
||||
surf->refcount++;
|
||||
}
|
||||
|
||||
if (*ptr) {
|
||||
assert((*ptr)->refcount);
|
||||
|
||||
/* There are currently two sorts of surfaces... This needs to be
|
||||
* fixed so that all surfaces are views into a texture.
|
||||
|
@ -113,11 +116,16 @@ winsys_buffer_reference(struct pipe_winsys *winsys,
|
|||
struct pipe_buffer **ptr,
|
||||
struct pipe_buffer *buf)
|
||||
{
|
||||
if (buf)
|
||||
if (buf) {
|
||||
assert(buf->refcount);
|
||||
buf->refcount++;
|
||||
}
|
||||
|
||||
if (*ptr && --(*ptr)->refcount == 0)
|
||||
winsys->buffer_destroy( winsys, *ptr );
|
||||
if (*ptr) {
|
||||
assert((*ptr)->refcount);
|
||||
if(--(*ptr)->refcount == 0)
|
||||
winsys->buffer_destroy( winsys, *ptr );
|
||||
}
|
||||
|
||||
*ptr = buf;
|
||||
}
|
||||
|
@ -133,12 +141,15 @@ pipe_texture_reference(struct pipe_texture **ptr,
|
|||
{
|
||||
assert(ptr);
|
||||
|
||||
if (pt)
|
||||
if (pt) {
|
||||
assert(pt->refcount);
|
||||
pt->refcount++;
|
||||
}
|
||||
|
||||
if (*ptr) {
|
||||
struct pipe_screen *screen = (*ptr)->screen;
|
||||
assert(screen);
|
||||
assert((*ptr)->refcount);
|
||||
screen->texture_release(screen, ptr);
|
||||
|
||||
assert(!*ptr);
|
||||
|
@ -154,6 +165,7 @@ pipe_texture_release(struct pipe_texture **ptr)
|
|||
struct pipe_screen *screen;
|
||||
assert(ptr);
|
||||
screen = (*ptr)->screen;
|
||||
assert((*ptr)->refcount);
|
||||
screen->texture_release(screen, ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
|
@ -176,12 +188,6 @@ pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size )
|
|||
return screen->winsys->user_buffer_create(screen->winsys, ptr, size);
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
pipe_buffer_destroy( struct pipe_screen *screen, struct pipe_buffer *buf )
|
||||
{
|
||||
screen->winsys->buffer_destroy(screen->winsys, buf);
|
||||
}
|
||||
|
||||
static INLINE void *
|
||||
pipe_buffer_map(struct pipe_screen *screen,
|
||||
struct pipe_buffer *buf,
|
||||
|
|
|
@ -55,7 +55,7 @@ typedef struct GLXGenericGetString
|
|||
#define X_GLXGenericGetString 0
|
||||
|
||||
/**
|
||||
* Query the Server GLX string and cache it in the display private.
|
||||
* Query the Server GLX string.
|
||||
* This routine will allocate the necessay space for the string.
|
||||
*/
|
||||
char *
|
||||
|
|
|
@ -57,7 +57,13 @@
|
|||
#define I830_DESTREG_SR0 7
|
||||
#define I830_DESTREG_SR1 8
|
||||
#define I830_DESTREG_SR2 9
|
||||
#define I830_DEST_SETUP_SIZE 10
|
||||
#define I830_DESTREG_DRAWRECT0 10
|
||||
#define I830_DESTREG_DRAWRECT1 11
|
||||
#define I830_DESTREG_DRAWRECT2 12
|
||||
#define I830_DESTREG_DRAWRECT3 13
|
||||
#define I830_DESTREG_DRAWRECT4 14
|
||||
#define I830_DESTREG_DRAWRECT5 15
|
||||
#define I830_DEST_SETUP_SIZE 16
|
||||
|
||||
#define I830_CTXREG_STATE1 0
|
||||
#define I830_CTXREG_STATE2 1
|
||||
|
|
|
@ -449,7 +449,8 @@ i830_emit_state(struct intel_context *intel)
|
|||
aper_array[aper_count++] = intel->batch->buf;
|
||||
if (dirty & I830_UPLOAD_BUFFERS) {
|
||||
aper_array[aper_count++] = state->draw_region->buffer;
|
||||
aper_array[aper_count++] = state->depth_region->buffer;
|
||||
if (state->depth_region)
|
||||
aper_array[aper_count++] = state->depth_region->buffer;
|
||||
}
|
||||
|
||||
for (i = 0; i < I830_TEX_UNITS; i++)
|
||||
|
@ -512,6 +513,16 @@ i830_emit_state(struct intel_context *intel)
|
|||
OUT_BATCH(state->Buffer[I830_DESTREG_SR0]);
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_SR1]);
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_SR2]);
|
||||
|
||||
if (intel->constant_cliprect) {
|
||||
assert(state->Buffer[I830_DESTREG_DRAWRECT0] != MI_NOOP);
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT0]);
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT1]);
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT2]);
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT3]);
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT4]);
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT5]);
|
||||
}
|
||||
ADVANCE_BATCH();
|
||||
}
|
||||
|
||||
|
@ -591,6 +602,7 @@ i830_state_draw_region(struct intel_context *intel,
|
|||
struct intel_region *depth_region)
|
||||
{
|
||||
struct i830_context *i830 = i830_context(&intel->ctx);
|
||||
GLcontext *ctx = &intel->ctx;
|
||||
GLuint value;
|
||||
|
||||
ASSERT(state == &i830->state || state == &i830->meta);
|
||||
|
@ -643,6 +655,24 @@ i830_state_draw_region(struct intel_context *intel,
|
|||
}
|
||||
state->Buffer[I830_DESTREG_DV1] = value;
|
||||
|
||||
if (intel->constant_cliprect) {
|
||||
state->Buffer[I830_DESTREG_DRAWRECT0] = _3DSTATE_DRAWRECT_INFO;
|
||||
state->Buffer[I830_DESTREG_DRAWRECT1] = 0;
|
||||
state->Buffer[I830_DESTREG_DRAWRECT2] = 0; /* xmin, ymin */
|
||||
state->Buffer[I830_DESTREG_DRAWRECT3] =
|
||||
(ctx->DrawBuffer->Width & 0xffff) |
|
||||
(ctx->DrawBuffer->Height << 16);
|
||||
state->Buffer[I830_DESTREG_DRAWRECT4] = 0; /* xoff, yoff */
|
||||
state->Buffer[I830_DESTREG_DRAWRECT5] = 0;
|
||||
} else {
|
||||
state->Buffer[I830_DESTREG_DRAWRECT0] = MI_NOOP;
|
||||
state->Buffer[I830_DESTREG_DRAWRECT1] = MI_NOOP;
|
||||
state->Buffer[I830_DESTREG_DRAWRECT2] = MI_NOOP;
|
||||
state->Buffer[I830_DESTREG_DRAWRECT3] = MI_NOOP;
|
||||
state->Buffer[I830_DESTREG_DRAWRECT4] = MI_NOOP;
|
||||
state->Buffer[I830_DESTREG_DRAWRECT5] = MI_NOOP;
|
||||
}
|
||||
|
||||
I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS);
|
||||
|
||||
|
||||
|
|
|
@ -65,7 +65,13 @@
|
|||
#define I915_DESTREG_SR0 9
|
||||
#define I915_DESTREG_SR1 10
|
||||
#define I915_DESTREG_SR2 11
|
||||
#define I915_DEST_SETUP_SIZE 12
|
||||
#define I915_DESTREG_DRAWRECT0 12
|
||||
#define I915_DESTREG_DRAWRECT1 13
|
||||
#define I915_DESTREG_DRAWRECT2 14
|
||||
#define I915_DESTREG_DRAWRECT3 15
|
||||
#define I915_DESTREG_DRAWRECT4 16
|
||||
#define I915_DESTREG_DRAWRECT5 17
|
||||
#define I915_DEST_SETUP_SIZE 18
|
||||
|
||||
#define I915_CTXREG_STATE4 0
|
||||
#define I915_CTXREG_LI 1
|
||||
|
|
|
@ -399,6 +399,17 @@ i915_emit_state(struct intel_context *intel)
|
|||
OUT_BATCH(state->Buffer[I915_DESTREG_SR0]);
|
||||
OUT_BATCH(state->Buffer[I915_DESTREG_SR1]);
|
||||
OUT_BATCH(state->Buffer[I915_DESTREG_SR2]);
|
||||
|
||||
if (intel->constant_cliprect) {
|
||||
assert(state->Buffer[I915_DESTREG_DRAWRECT0] != MI_NOOP);
|
||||
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT0]);
|
||||
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT1]);
|
||||
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT2]);
|
||||
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT3]);
|
||||
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT4]);
|
||||
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT5]);
|
||||
}
|
||||
|
||||
ADVANCE_BATCH();
|
||||
}
|
||||
|
||||
|
@ -521,6 +532,7 @@ i915_state_draw_region(struct intel_context *intel,
|
|||
struct intel_region *depth_region)
|
||||
{
|
||||
struct i915_context *i915 = i915_context(&intel->ctx);
|
||||
GLcontext *ctx = &intel->ctx;
|
||||
GLuint value;
|
||||
|
||||
ASSERT(state == &i915->state || state == &i915->meta);
|
||||
|
@ -573,6 +585,24 @@ i915_state_draw_region(struct intel_context *intel,
|
|||
}
|
||||
state->Buffer[I915_DESTREG_DV1] = value;
|
||||
|
||||
if (intel->constant_cliprect) {
|
||||
state->Buffer[I915_DESTREG_DRAWRECT0] = _3DSTATE_DRAWRECT_INFO;
|
||||
state->Buffer[I915_DESTREG_DRAWRECT1] = 0;
|
||||
state->Buffer[I915_DESTREG_DRAWRECT2] = 0; /* xmin, ymin */
|
||||
state->Buffer[I915_DESTREG_DRAWRECT3] =
|
||||
(ctx->DrawBuffer->Width & 0xffff) |
|
||||
(ctx->DrawBuffer->Height << 16);
|
||||
state->Buffer[I915_DESTREG_DRAWRECT4] = 0; /* xoff, yoff */
|
||||
state->Buffer[I915_DESTREG_DRAWRECT5] = 0;
|
||||
} else {
|
||||
state->Buffer[I915_DESTREG_DRAWRECT0] = MI_NOOP;
|
||||
state->Buffer[I915_DESTREG_DRAWRECT1] = MI_NOOP;
|
||||
state->Buffer[I915_DESTREG_DRAWRECT2] = MI_NOOP;
|
||||
state->Buffer[I915_DESTREG_DRAWRECT3] = MI_NOOP;
|
||||
state->Buffer[I915_DESTREG_DRAWRECT4] = MI_NOOP;
|
||||
state->Buffer[I915_DESTREG_DRAWRECT5] = MI_NOOP;
|
||||
}
|
||||
|
||||
I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS);
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ static void clip_and_emit_line( struct brw_clip_compile *c )
|
|||
brw_clip_init_clipmask(c);
|
||||
|
||||
/* -ve rhw workaround */
|
||||
if (!(BRW_IS_GM45(p->brw) || BRW_IS_G4X(p->brw))) {
|
||||
if (!BRW_IS_G4X(p->brw)) {
|
||||
brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ);
|
||||
brw_AND(p, brw_null_reg(), get_element_ud(c->reg.R0, 2),
|
||||
brw_imm_ud(1<<20));
|
||||
|
|
|
@ -102,7 +102,7 @@ clip_unit_create_from_key(struct brw_context *brw,
|
|||
clip.clip5.api_mode = BRW_CLIP_API_OGL;
|
||||
clip.clip5.clip_mode = key->clip_mode;
|
||||
|
||||
if (BRW_IS_GM45(brw) || BRW_IS_G4X(brw))
|
||||
if (BRW_IS_G4X(brw))
|
||||
clip.clip5.negative_w_clip_test = 1;
|
||||
|
||||
clip.clip6.clipper_viewport_state_ptr = 0;
|
||||
|
|
|
@ -526,7 +526,7 @@ void brw_emit_tri_clip( struct brw_clip_compile *c )
|
|||
|
||||
/* if -ve rhw workaround bit is set,
|
||||
do cliptest */
|
||||
if (!(BRW_IS_GM45(p->brw) || BRW_IS_G4X(p->brw))) {
|
||||
if (!BRW_IS_G4X(p->brw)) {
|
||||
brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ);
|
||||
brw_AND(p, brw_null_reg(), get_element_ud(c->reg.R0, 2),
|
||||
brw_imm_ud(1<<20));
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "brw_context.h"
|
||||
#include "brw_defines.h"
|
||||
#include "brw_draw.h"
|
||||
#include "brw_state.h"
|
||||
#include "brw_vs.h"
|
||||
#include "intel_tex.h"
|
||||
#include "intel_blit.h"
|
||||
|
|
|
@ -433,7 +433,6 @@ struct brw_context
|
|||
GLuint primitive;
|
||||
|
||||
GLboolean emit_state_always;
|
||||
GLboolean wrap;
|
||||
GLboolean tmp_fallback;
|
||||
GLboolean no_batch_wrap;
|
||||
|
||||
|
@ -445,6 +444,19 @@ struct brw_context
|
|||
GLuint nr_draw_regions;
|
||||
struct intel_region *draw_regions[MAX_DRAW_BUFFERS];
|
||||
struct intel_region *depth_region;
|
||||
|
||||
/**
|
||||
* List of buffers accumulated in brw_validate_state to receive
|
||||
* dri_bo_check_aperture treatment before exec, so we can know if we
|
||||
* should flush the batch and try again before emitting primitives.
|
||||
*
|
||||
* This can be a fixed number as we only have a limited number of
|
||||
* objects referenced from the batchbuffer in a primitive emit,
|
||||
* consisting of the vertex buffers, pipelined state pointers,
|
||||
* the CURBE, the depth buffer, and a query BO.
|
||||
*/
|
||||
dri_bo *validated_bos[VERT_ATTRIB_MAX + 16];
|
||||
int validated_bo_count;
|
||||
} state;
|
||||
|
||||
struct brw_state_pointers attribs;
|
||||
|
@ -679,14 +691,6 @@ void brw_prepare_query_begin(struct brw_context *brw);
|
|||
void brw_emit_query_begin(struct brw_context *brw);
|
||||
void brw_emit_query_end(struct brw_context *brw);
|
||||
|
||||
/*======================================================================
|
||||
* brw_state.c
|
||||
*/
|
||||
void brw_validate_state( struct brw_context *brw );
|
||||
void brw_init_state( struct brw_context *brw );
|
||||
void brw_destroy_state( struct brw_context *brw );
|
||||
|
||||
|
||||
/*======================================================================
|
||||
* brw_state_dump.c
|
||||
*/
|
||||
|
|
|
@ -307,6 +307,7 @@ static void prepare_constant_buffer(struct brw_context *brw)
|
|||
dri_bo_subdata(brw->curbe.curbe_bo, brw->curbe.curbe_offset, bufsz, buf);
|
||||
}
|
||||
|
||||
brw_add_validated_bo(brw, brw->curbe.curbe_bo);
|
||||
|
||||
/* Because this provokes an action (ie copy the constants into the
|
||||
* URB), it shouldn't be shortcircuited if identical to the
|
||||
|
@ -328,13 +329,6 @@ static void emit_constant_buffer(struct brw_context *brw)
|
|||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
GLuint sz = brw->curbe.total_size;
|
||||
dri_bo *aper_array[] = {
|
||||
brw->intel.batch->buf,
|
||||
brw->curbe.curbe_bo,
|
||||
};
|
||||
|
||||
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array)))
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
BEGIN_BATCH(2, IGNORE_CLIPRECTS);
|
||||
if (sz == 0) {
|
||||
|
|
|
@ -798,10 +798,9 @@
|
|||
|
||||
#include "intel_chipset.h"
|
||||
|
||||
#define BRW_IS_GM45(brw) (IS_GM45_GM((brw)->intel.intelScreen->deviceID))
|
||||
#define BRW_IS_G4X(brw) (IS_G4X((brw)->intel.intelScreen->deviceID))
|
||||
#define CMD_PIPELINE_SELECT(brw) ((BRW_IS_GM45(brw) || BRW_IS_G4X(brw)) ? CMD_PIPELINE_SELECT_GM45 : CMD_PIPELINE_SELECT_965)
|
||||
#define CMD_VF_STATISTICS(brw) ((BRW_IS_GM45(brw) || BRW_IS_G4X(brw)) ? CMD_VF_STATISTICS_GM45 : CMD_VF_STATISTICS_965)
|
||||
#define URB_SIZES(brw) ((BRW_IS_GM45(brw) || BRW_IS_G4X(brw)) ? 384 : 256) /* 512 bit unit */
|
||||
#define CMD_PIPELINE_SELECT(brw) (BRW_IS_G4X(brw) ? CMD_PIPELINE_SELECT_GM45 : CMD_PIPELINE_SELECT_965)
|
||||
#define CMD_VF_STATISTICS(brw) (BRW_IS_G4X(brw) ? CMD_VF_STATISTICS_GM45 : CMD_VF_STATISTICS_965)
|
||||
#define URB_SIZES(brw) (BRW_IS_G4X(brw) ? 384 : 256) /* 512 bit units */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -256,6 +256,7 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
|
|||
struct intel_context *intel = intel_context(ctx);
|
||||
struct brw_context *brw = brw_context(ctx);
|
||||
GLboolean retval = GL_FALSE;
|
||||
GLboolean warn = GL_FALSE;
|
||||
GLuint i;
|
||||
|
||||
if (ctx->NewState)
|
||||
|
@ -282,30 +283,25 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
|
|||
|
||||
LOCK_HARDWARE(intel);
|
||||
|
||||
if (brw->intel.numClipRects == 0) {
|
||||
if (!intel->constant_cliprect && intel->driDrawable->numClipRects == 0) {
|
||||
UNLOCK_HARDWARE(intel);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
/* Flush the batch if it's approaching full, so that we don't wrap while
|
||||
* we've got validated state that needs to be in the same batch as the
|
||||
* primitives. This fraction is just a guess (minimal full state plus
|
||||
* a primitive is around 512 bytes), and would be better if we had
|
||||
* an upper bound of how much we might emit in a single
|
||||
* brw_try_draw_prims().
|
||||
*/
|
||||
intel_batchbuffer_require_space(intel->batch, intel->batch->size / 4,
|
||||
LOOP_CLIPRECTS);
|
||||
{
|
||||
/* Flush the batch if it's approaching full, so that we don't wrap while
|
||||
* we've got validated state that needs to be in the same batch as the
|
||||
* primitives. This fraction is just a guess (minimal full state plus
|
||||
* a primitive is around 512 bytes), and would be better if we had
|
||||
* an upper bound of how much we might emit in a single
|
||||
* brw_try_draw_prims().
|
||||
*/
|
||||
if (intel->batch->ptr - intel->batch->map > intel->batch->size * 3 / 4
|
||||
/* brw_emit_prim may change the cliprect_mode to LOOP_CLIPRECTS */
|
||||
|| intel->batch->cliprect_mode != LOOP_CLIPRECTS)
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
/* Set the first primitive early, ahead of validate_state:
|
||||
*/
|
||||
brw_set_prim(brw, prim[0].mode);
|
||||
|
||||
/* XXX: Need to separate validate and upload of state.
|
||||
*/
|
||||
brw_validate_state( brw );
|
||||
|
||||
/* Various fallback checks:
|
||||
|
@ -316,6 +312,31 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
|
|||
if (check_fallbacks( brw, prim, nr_prims ))
|
||||
goto out;
|
||||
|
||||
/* Check that we can fit our state in with our existing batchbuffer, or
|
||||
* flush otherwise.
|
||||
*/
|
||||
if (dri_bufmgr_check_aperture_space(brw->state.validated_bos,
|
||||
brw->state.validated_bo_count)) {
|
||||
static GLboolean warned;
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
/* Validate the state after we flushed the batch (which would have
|
||||
* changed the set of dirty state). If we still fail to
|
||||
* check_aperture, warn of what's happening, but attempt to continue
|
||||
* on since it may succeed anyway, and the user would probably rather
|
||||
* see a failure and a warning than a fallback.
|
||||
*/
|
||||
brw_validate_state(brw);
|
||||
if (!warned &&
|
||||
dri_bufmgr_check_aperture_space(brw->state.validated_bos,
|
||||
brw->state.validated_bo_count)) {
|
||||
warn = GL_TRUE;
|
||||
warned = GL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
brw_upload_state(brw);
|
||||
|
||||
for (i = 0; i < nr_prims; i++) {
|
||||
brw_emit_prim(brw, &prim[i]);
|
||||
}
|
||||
|
@ -326,6 +347,10 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
|
|||
out:
|
||||
UNLOCK_HARDWARE(intel);
|
||||
|
||||
if (warn)
|
||||
fprintf(stderr, "i965: Single primitive emit potentially exceeded "
|
||||
"available aperture space\n");
|
||||
|
||||
if (!retval)
|
||||
DBG("%s failed\n", __FUNCTION__);
|
||||
|
||||
|
|
|
@ -250,10 +250,10 @@ static void get_space( struct brw_context *brw,
|
|||
wrap_buffers(brw, size);
|
||||
}
|
||||
|
||||
assert(*bo_return == NULL);
|
||||
dri_bo_reference(brw->vb.upload.bo);
|
||||
*bo_return = brw->vb.upload.bo;
|
||||
*offset_return = brw->vb.upload.offset;
|
||||
|
||||
brw->vb.upload.offset += size;
|
||||
}
|
||||
|
||||
|
@ -359,6 +359,14 @@ static void brw_prepare_vertices(struct brw_context *brw)
|
|||
input->offset = (unsigned long)input->glarray->Ptr;
|
||||
input->stride = input->glarray->StrideB;
|
||||
} else {
|
||||
if (input->bo != NULL) {
|
||||
/* Already-uploaded vertex data is present from a previous
|
||||
* prepare_vertices, but we had to re-validate state due to
|
||||
* check_aperture failing and a new batch being produced.
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Queue the buffer object up to be uploaded in the next pass,
|
||||
* when we've decided if we're doing interleaved or not.
|
||||
*/
|
||||
|
@ -417,6 +425,12 @@ static void brw_prepare_vertices(struct brw_context *brw)
|
|||
}
|
||||
|
||||
brw_prepare_query_begin(brw);
|
||||
|
||||
for (i = 0; i < nr_enabled; i++) {
|
||||
struct brw_vertex_element *input = enabled[i];
|
||||
|
||||
brw_add_validated_bo(brw, input->bo);
|
||||
}
|
||||
}
|
||||
|
||||
static void brw_emit_vertices(struct brw_context *brw)
|
||||
|
@ -512,7 +526,7 @@ static void brw_prepare_indices(struct brw_context *brw)
|
|||
struct intel_context *intel = &brw->intel;
|
||||
const struct _mesa_index_buffer *index_buffer = brw->ib.ib;
|
||||
GLuint ib_size;
|
||||
dri_bo *bo;
|
||||
dri_bo *bo = NULL;
|
||||
struct gl_buffer_object *bufferobj;
|
||||
GLuint offset;
|
||||
|
||||
|
@ -561,6 +575,8 @@ static void brw_prepare_indices(struct brw_context *brw)
|
|||
dri_bo_unreference(brw->ib.bo);
|
||||
brw->ib.bo = bo;
|
||||
brw->ib.offset = offset;
|
||||
|
||||
brw_add_validated_bo(brw, brw->ib.bo);
|
||||
}
|
||||
|
||||
static void brw_emit_indices(struct brw_context *brw)
|
||||
|
|
|
@ -65,7 +65,7 @@ struct brw_reg
|
|||
GLuint abs:1; /* source only */
|
||||
GLuint vstride:4; /* source only */
|
||||
GLuint width:3; /* src only, align1 only */
|
||||
GLuint hstride:2; /* src only, align1 only */
|
||||
GLuint hstride:2; /* align1 only */
|
||||
GLuint address_mode:1; /* relative addressing, hopefully! */
|
||||
GLuint pad0:1;
|
||||
|
||||
|
@ -432,6 +432,12 @@ static INLINE struct brw_reg brw_uw8_grf( GLuint nr,
|
|||
return brw_uw8_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr);
|
||||
}
|
||||
|
||||
static INLINE struct brw_reg brw_uw16_grf( GLuint nr,
|
||||
GLuint subnr )
|
||||
{
|
||||
return brw_uw16_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr);
|
||||
}
|
||||
|
||||
static INLINE struct brw_reg brw_null_reg( void )
|
||||
{
|
||||
return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE,
|
||||
|
|
|
@ -64,7 +64,9 @@ static void brw_set_dest( struct brw_instruction *insn,
|
|||
|
||||
if (insn->header.access_mode == BRW_ALIGN_1) {
|
||||
insn->bits1.da1.dest_subreg_nr = dest.subnr;
|
||||
insn->bits1.da1.dest_horiz_stride = BRW_HORIZONTAL_STRIDE_1;
|
||||
if (dest.hstride == BRW_HORIZONTAL_STRIDE_0)
|
||||
dest.hstride = BRW_HORIZONTAL_STRIDE_1;
|
||||
insn->bits1.da1.dest_horiz_stride = dest.hstride;
|
||||
}
|
||||
else {
|
||||
insn->bits1.da16.dest_subreg_nr = dest.subnr / 16;
|
||||
|
@ -78,7 +80,9 @@ static void brw_set_dest( struct brw_instruction *insn,
|
|||
*/
|
||||
if (insn->header.access_mode == BRW_ALIGN_1) {
|
||||
insn->bits1.ia1.dest_indirect_offset = dest.dw1.bits.indirect_offset;
|
||||
insn->bits1.ia1.dest_horiz_stride = BRW_HORIZONTAL_STRIDE_1;
|
||||
if (dest.hstride == BRW_HORIZONTAL_STRIDE_0)
|
||||
dest.hstride = BRW_HORIZONTAL_STRIDE_1;
|
||||
insn->bits1.ia1.dest_horiz_stride = dest.hstride;
|
||||
}
|
||||
else {
|
||||
insn->bits1.ia16.dest_indirect_offset = dest.dw1.bits.indirect_offset;
|
||||
|
@ -329,14 +333,14 @@ static void brw_set_sampler_message(struct brw_context *brw,
|
|||
{
|
||||
brw_set_src1(insn, brw_imm_d(0));
|
||||
|
||||
if (BRW_IS_GM45(brw) || BRW_IS_G4X(brw)) {
|
||||
insn->bits3.sampler_gm45_g4x.binding_table_index = binding_table_index;
|
||||
insn->bits3.sampler_gm45_g4x.sampler = sampler;
|
||||
insn->bits3.sampler_gm45_g4x.msg_type = msg_type;
|
||||
insn->bits3.sampler_gm45_g4x.response_length = response_length;
|
||||
insn->bits3.sampler_gm45_g4x.msg_length = msg_length;
|
||||
insn->bits3.sampler_gm45_g4x.end_of_thread = eot;
|
||||
insn->bits3.sampler_gm45_g4x.msg_target = BRW_MESSAGE_TARGET_SAMPLER;
|
||||
if (BRW_IS_G4X(brw)) {
|
||||
insn->bits3.sampler_g4x.binding_table_index = binding_table_index;
|
||||
insn->bits3.sampler_g4x.sampler = sampler;
|
||||
insn->bits3.sampler_g4x.msg_type = msg_type;
|
||||
insn->bits3.sampler_g4x.response_length = response_length;
|
||||
insn->bits3.sampler_g4x.msg_length = msg_length;
|
||||
insn->bits3.sampler_g4x.end_of_thread = eot;
|
||||
insn->bits3.sampler_g4x.msg_target = BRW_MESSAGE_TARGET_SAMPLER;
|
||||
} else {
|
||||
insn->bits3.sampler.binding_table_index = binding_table_index;
|
||||
insn->bits3.sampler.sampler = sampler;
|
||||
|
|
|
@ -71,6 +71,38 @@ const struct brw_tracked_state brw_blend_constant_color = {
|
|||
.emit = upload_blend_constant_color
|
||||
};
|
||||
|
||||
/* Constant single cliprect for framebuffer object or DRI2 drawing */
|
||||
static void upload_drawing_rect(struct brw_context *brw)
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
GLcontext *ctx = &intel->ctx;
|
||||
|
||||
if (!intel->constant_cliprect)
|
||||
return;
|
||||
|
||||
BEGIN_BATCH(4, NO_LOOP_CLIPRECTS);
|
||||
OUT_BATCH(_3DSTATE_DRAWRECT_INFO_I965);
|
||||
OUT_BATCH(0); /* xmin, ymin */
|
||||
OUT_BATCH(((ctx->DrawBuffer->Width - 1) & 0xffff) |
|
||||
((ctx->DrawBuffer->Height - 1) << 16));
|
||||
OUT_BATCH(0);
|
||||
ADVANCE_BATCH();
|
||||
}
|
||||
|
||||
const struct brw_tracked_state brw_drawing_rect = {
|
||||
.dirty = {
|
||||
.mesa = _NEW_BUFFERS,
|
||||
.brw = 0,
|
||||
.cache = 0
|
||||
},
|
||||
.emit = upload_drawing_rect
|
||||
};
|
||||
|
||||
static void prepare_binding_table_pointers(struct brw_context *brw)
|
||||
{
|
||||
brw_add_validated_bo(brw, brw->wm.bind_bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload the binding table pointers, which point each stage's array of surface
|
||||
* state pointers.
|
||||
|
@ -81,13 +113,6 @@ const struct brw_tracked_state brw_blend_constant_color = {
|
|||
static void upload_binding_table_pointers(struct brw_context *brw)
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
dri_bo *aper_array[] = {
|
||||
intel->batch->buf,
|
||||
brw->wm.bind_bo,
|
||||
};
|
||||
|
||||
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array)))
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
BEGIN_BATCH(6, IGNORE_CLIPRECTS);
|
||||
OUT_BATCH(CMD_BINDING_TABLE_PTRS << 16 | (6 - 2));
|
||||
|
@ -107,6 +132,7 @@ const struct brw_tracked_state brw_binding_table_pointers = {
|
|||
.brw = BRW_NEW_BATCH,
|
||||
.cache = CACHE_NEW_SURF_BIND,
|
||||
},
|
||||
.prepare = prepare_binding_table_pointers,
|
||||
.emit = upload_binding_table_pointers,
|
||||
};
|
||||
|
||||
|
@ -140,21 +166,18 @@ static void upload_pipelined_state_pointers(struct brw_context *brw )
|
|||
brw->state.dirty.brw |= BRW_NEW_PSP;
|
||||
}
|
||||
|
||||
|
||||
static void prepare_psp_urb_cbs(struct brw_context *brw)
|
||||
{
|
||||
brw_add_validated_bo(brw, brw->vs.state_bo);
|
||||
brw_add_validated_bo(brw, brw->gs.state_bo);
|
||||
brw_add_validated_bo(brw, brw->clip.state_bo);
|
||||
brw_add_validated_bo(brw, brw->wm.state_bo);
|
||||
brw_add_validated_bo(brw, brw->cc.state_bo);
|
||||
}
|
||||
|
||||
static void upload_psp_urb_cbs(struct brw_context *brw )
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
dri_bo *aper_array[] = {
|
||||
intel->batch->buf,
|
||||
brw->vs.state_bo,
|
||||
brw->gs.state_bo,
|
||||
brw->clip.state_bo,
|
||||
brw->wm.state_bo,
|
||||
brw->cc.state_bo,
|
||||
};
|
||||
|
||||
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array)))
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
upload_pipelined_state_pointers(brw);
|
||||
brw_upload_urb_fence(brw);
|
||||
brw_upload_constant_buffer_state(brw);
|
||||
|
@ -172,14 +195,23 @@ const struct brw_tracked_state brw_psp_urb_cbs = {
|
|||
CACHE_NEW_WM_UNIT |
|
||||
CACHE_NEW_CC_UNIT)
|
||||
},
|
||||
.prepare = prepare_psp_urb_cbs,
|
||||
.emit = upload_psp_urb_cbs,
|
||||
};
|
||||
|
||||
static void prepare_depthbuffer(struct brw_context *brw)
|
||||
{
|
||||
struct intel_region *region = brw->state.depth_region;
|
||||
|
||||
if (region != NULL)
|
||||
brw_add_validated_bo(brw, region->buffer);
|
||||
}
|
||||
|
||||
static void emit_depthbuffer(struct brw_context *brw)
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
struct intel_region *region = brw->state.depth_region;
|
||||
unsigned int len = (BRW_IS_GM45(brw) || BRW_IS_G4X(brw)) ? sizeof(struct brw_depthbuffer_gm45_g4x) / 4 : sizeof(struct brw_depthbuffer) / 4;
|
||||
unsigned int len = BRW_IS_G4X(brw) ? 6 : 5;
|
||||
|
||||
if (region == NULL) {
|
||||
BEGIN_BATCH(len, IGNORE_CLIPRECTS);
|
||||
|
@ -190,16 +222,12 @@ static void emit_depthbuffer(struct brw_context *brw)
|
|||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
|
||||
if (BRW_IS_GM45(brw) || BRW_IS_G4X(brw))
|
||||
if (BRW_IS_G4X(brw))
|
||||
OUT_BATCH(0);
|
||||
|
||||
ADVANCE_BATCH();
|
||||
} else {
|
||||
unsigned int format;
|
||||
dri_bo *aper_array[] = {
|
||||
intel->batch->buf,
|
||||
region->buffer
|
||||
};
|
||||
|
||||
switch (region->cpp) {
|
||||
case 2:
|
||||
|
@ -216,9 +244,6 @@ static void emit_depthbuffer(struct brw_context *brw)
|
|||
return;
|
||||
}
|
||||
|
||||
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array)))
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
BEGIN_BATCH(len, IGNORE_CLIPRECTS);
|
||||
OUT_BATCH(CMD_DEPTH_BUFFER << 16 | (len - 2));
|
||||
OUT_BATCH(((region->pitch * region->cpp) - 1) |
|
||||
|
@ -234,7 +259,7 @@ static void emit_depthbuffer(struct brw_context *brw)
|
|||
((region->height - 1) << 19));
|
||||
OUT_BATCH(0);
|
||||
|
||||
if (BRW_IS_GM45(brw) || BRW_IS_G4X(brw))
|
||||
if (BRW_IS_G4X(brw))
|
||||
OUT_BATCH(0);
|
||||
|
||||
ADVANCE_BATCH();
|
||||
|
@ -247,6 +272,7 @@ const struct brw_tracked_state brw_depthbuffer = {
|
|||
.brw = BRW_NEW_DEPTH_BUFFER | BRW_NEW_BATCH,
|
||||
.cache = 0,
|
||||
},
|
||||
.prepare = prepare_depthbuffer,
|
||||
.emit = emit_depthbuffer,
|
||||
};
|
||||
|
||||
|
@ -318,7 +344,7 @@ static void upload_aa_line_parameters(struct brw_context *brw)
|
|||
{
|
||||
struct brw_aa_line_parameters balp;
|
||||
|
||||
if (!(BRW_IS_GM45(brw) || BRW_IS_G4X(brw)))
|
||||
if (!BRW_IS_G4X(brw))
|
||||
return;
|
||||
|
||||
/* use legacy aa line coverage computation */
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "main/imports.h"
|
||||
|
||||
#include "brw_context.h"
|
||||
#include "brw_state.h"
|
||||
#include "intel_batchbuffer.h"
|
||||
#include "intel_reg.h"
|
||||
|
||||
|
@ -163,10 +164,6 @@ void
|
|||
brw_prepare_query_begin(struct brw_context *brw)
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
dri_bo *aper_array[] = {
|
||||
intel->batch->buf,
|
||||
brw->query.bo,
|
||||
};
|
||||
|
||||
/* Skip if we're not doing any queries. */
|
||||
if (is_empty_list(&brw->query.active_head))
|
||||
|
@ -182,8 +179,7 @@ brw_prepare_query_begin(struct brw_context *brw)
|
|||
brw->query.index = 0;
|
||||
}
|
||||
|
||||
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array)))
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
brw_add_validated_bo(brw, brw->query.bo);
|
||||
}
|
||||
|
||||
/** Called just before primitive drawing to get a beginning PS_DEPTH_COUNT. */
|
||||
|
|
|
@ -35,6 +35,16 @@
|
|||
|
||||
#include "brw_context.h"
|
||||
|
||||
static inline void
|
||||
brw_add_validated_bo(struct brw_context *brw, dri_bo *bo)
|
||||
{
|
||||
assert(brw->state.validated_bo_count < ARRAY_SIZE(brw->state.validated_bos));
|
||||
|
||||
if (bo != NULL) {
|
||||
dri_bo_reference(bo);
|
||||
brw->state.validated_bos[brw->state.validated_bo_count++] = bo;
|
||||
}
|
||||
};
|
||||
|
||||
const struct brw_tracked_state brw_blend_constant_color;
|
||||
const struct brw_tracked_state brw_cc_unit;
|
||||
|
@ -79,9 +89,18 @@ const struct brw_tracked_state brw_pipe_control;
|
|||
const struct brw_tracked_state brw_clear_surface_cache;
|
||||
const struct brw_tracked_state brw_clear_batch_cache;
|
||||
|
||||
const struct brw_tracked_state brw_drawing_rect;
|
||||
const struct brw_tracked_state brw_indices;
|
||||
const struct brw_tracked_state brw_vertices;
|
||||
|
||||
/***********************************************************************
|
||||
* brw_state.c
|
||||
*/
|
||||
void brw_validate_state(struct brw_context *brw);
|
||||
void brw_upload_state(struct brw_context *brw);
|
||||
void brw_init_state(struct brw_context *brw);
|
||||
void brw_destroy_state(struct brw_context *brw);
|
||||
|
||||
/***********************************************************************
|
||||
* brw_state_cache.c
|
||||
*/
|
||||
|
|
|
@ -97,8 +97,6 @@ void brw_clear_batch_cache_flush( struct brw_context *brw )
|
|||
{
|
||||
clear_batch_cache(brw);
|
||||
|
||||
brw->wrap = 0;
|
||||
|
||||
/* brw_do_flush(brw, BRW_FLUSH_STATE_CACHE|BRW_FLUSH_READ_CACHE); */
|
||||
|
||||
brw->state.dirty.mesa |= ~0;
|
||||
|
|
|
@ -45,7 +45,6 @@ const struct brw_tracked_state *atoms[] =
|
|||
{
|
||||
&brw_check_fallback,
|
||||
|
||||
&brw_active_vertprog,
|
||||
&brw_wm_input_sizes,
|
||||
&brw_vs_prog,
|
||||
&brw_gs_prog,
|
||||
|
@ -99,6 +98,7 @@ const struct brw_tracked_state *atoms[] =
|
|||
&brw_psp_urb_cbs,
|
||||
#endif
|
||||
|
||||
&brw_drawing_rect,
|
||||
&brw_indices,
|
||||
&brw_vertices,
|
||||
|
||||
|
@ -168,6 +168,18 @@ static void xor_states( struct brw_state_flags *result,
|
|||
result->cache = a->cache ^ b->cache;
|
||||
}
|
||||
|
||||
static void
|
||||
brw_clear_validated_bos(struct brw_context *brw)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Clear the last round of validated bos */
|
||||
for (i = 0; i < brw->state.validated_bo_count; i++) {
|
||||
dri_bo_unreference(brw->state.validated_bos[i]);
|
||||
brw->state.validated_bos[i] = NULL;
|
||||
}
|
||||
brw->state.validated_bo_count = 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Emit all state:
|
||||
|
@ -176,14 +188,14 @@ void brw_validate_state( struct brw_context *brw )
|
|||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
struct brw_state_flags *state = &brw->state.dirty;
|
||||
GLuint i, count, pass = 0;
|
||||
dri_bo *last_batch_bo = NULL;
|
||||
GLuint i;
|
||||
|
||||
brw_clear_validated_bos(brw);
|
||||
|
||||
state->mesa |= brw->intel.NewGLState;
|
||||
brw->intel.NewGLState = 0;
|
||||
|
||||
if (brw->wrap)
|
||||
state->brw |= BRW_NEW_CONTEXT;
|
||||
brw_add_validated_bo(brw, intel->batch->buf);
|
||||
|
||||
if (brw->emit_state_always) {
|
||||
state->mesa |= ~0;
|
||||
|
@ -199,6 +211,10 @@ void brw_validate_state( struct brw_context *brw )
|
|||
brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM;
|
||||
}
|
||||
|
||||
if (brw->vertex_program != brw->attribs.VertexProgram->_Current) {
|
||||
brw->vertex_program = brw->attribs.VertexProgram->_Current;
|
||||
brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM;
|
||||
}
|
||||
|
||||
if (state->mesa == 0 &&
|
||||
state->cache == 0 &&
|
||||
|
@ -210,8 +226,6 @@ void brw_validate_state( struct brw_context *brw )
|
|||
|
||||
brw->intel.Fallback = 0;
|
||||
|
||||
count = 0;
|
||||
|
||||
/* do prepare stage for all atoms */
|
||||
for (i = 0; i < Elements(atoms); i++) {
|
||||
const struct brw_tracked_state *atom = brw->state.atoms[i];
|
||||
|
@ -225,19 +239,15 @@ void brw_validate_state( struct brw_context *brw )
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (brw->intel.Fallback)
|
||||
return;
|
||||
|
||||
/* We're about to try to set up a coherent state in the batchbuffer for
|
||||
* the emission of primitives. If we exceed the aperture size in any of the
|
||||
* emit() calls, we need to go back to square 1 and try setting up again.
|
||||
*/
|
||||
got_flushed:
|
||||
dri_bo_unreference(last_batch_bo);
|
||||
last_batch_bo = intel->batch->buf;
|
||||
dri_bo_reference(last_batch_bo);
|
||||
assert(pass++ <= 2);
|
||||
void brw_upload_state(struct brw_context *brw)
|
||||
{
|
||||
struct brw_state_flags *state = &brw->state.dirty;
|
||||
int i;
|
||||
|
||||
brw_clear_validated_bos(brw);
|
||||
|
||||
if (INTEL_DEBUG) {
|
||||
/* Debug version which enforces various sanity checks on the
|
||||
|
@ -262,8 +272,6 @@ got_flushed:
|
|||
if (check_state(state, &atom->dirty)) {
|
||||
if (atom->emit) {
|
||||
atom->emit( brw );
|
||||
if (intel->batch->buf != last_batch_bo)
|
||||
goto got_flushed;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -288,15 +296,11 @@ got_flushed:
|
|||
if (check_state(state, &atom->dirty)) {
|
||||
if (atom->emit) {
|
||||
atom->emit( brw );
|
||||
if (intel->batch->buf != last_batch_bo)
|
||||
goto got_flushed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dri_bo_unreference(last_batch_bo);
|
||||
|
||||
if (!brw->intel.Fallback)
|
||||
memset(state, 0, sizeof(*state));
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ struct brw_depthbuffer
|
|||
} dword4;
|
||||
};
|
||||
|
||||
struct brw_depthbuffer_gm45_g4x
|
||||
struct brw_depthbuffer_g4x
|
||||
{
|
||||
union header_union header;
|
||||
|
||||
|
@ -1405,7 +1405,7 @@ struct brw_instruction
|
|||
GLuint msg_target:4;
|
||||
GLuint pad1:3;
|
||||
GLuint end_of_thread:1;
|
||||
} sampler_gm45_g4x;
|
||||
} sampler_g4x;
|
||||
|
||||
struct brw_urb_immediate urb;
|
||||
|
||||
|
|
|
@ -92,9 +92,9 @@ static void recalculate_urb_fence( struct brw_context *brw )
|
|||
if (brw->urb.vsize < vsize ||
|
||||
brw->urb.sfsize < sfsize ||
|
||||
brw->urb.csize < csize ||
|
||||
(brw->urb.constrained && (brw->urb.vsize > brw->urb.vsize ||
|
||||
brw->urb.sfsize > brw->urb.sfsize ||
|
||||
brw->urb.csize > brw->urb.csize))) {
|
||||
(brw->urb.constrained && (brw->urb.vsize > vsize ||
|
||||
brw->urb.sfsize > sfsize ||
|
||||
brw->urb.csize > csize))) {
|
||||
|
||||
|
||||
brw->urb.csize = csize;
|
||||
|
@ -114,6 +114,10 @@ static void recalculate_urb_fence( struct brw_context *brw )
|
|||
brw->urb.nr_sf_entries = limits[SF].min_nr_entries;
|
||||
brw->urb.nr_cs_entries = limits[CS].min_nr_entries;
|
||||
|
||||
/* Mark us as operating with constrained nr_entries, so that next
|
||||
* time we recalculate we'll resize the fences in the hope of
|
||||
* escaping constrained mode and getting back to normal performance.
|
||||
*/
|
||||
brw->urb.constrained = 1;
|
||||
|
||||
if (!check_urb_layout(brw)) {
|
||||
|
|
|
@ -818,8 +818,7 @@ static void emit_vertex_write( struct brw_vs_compile *c)
|
|||
}
|
||||
|
||||
|
||||
/* Build ndc coords? TODO: Shortcircuit when w is known to be one.
|
||||
*/
|
||||
/* Build ndc coords */
|
||||
if (!c->key.know_w_is_one) {
|
||||
ndc = get_tmp(c);
|
||||
emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL);
|
||||
|
@ -829,12 +828,12 @@ static void emit_vertex_write( struct brw_vs_compile *c)
|
|||
ndc = pos;
|
||||
}
|
||||
|
||||
/* This includes the workaround for -ve rhw, so is no longer an
|
||||
* optional step:
|
||||
/* Update the header for point size, user clipping flags, and -ve rhw
|
||||
* workaround.
|
||||
*/
|
||||
if ((c->prog_data.outputs_written & (1<<VERT_RESULT_PSIZ)) ||
|
||||
c->key.nr_userclip ||
|
||||
!c->key.know_w_is_one)
|
||||
(!BRW_IS_G4X(p->brw) && !c->key.know_w_is_one))
|
||||
{
|
||||
struct brw_reg header1 = retype(get_tmp(c), BRW_REGISTER_TYPE_UD);
|
||||
GLuint i;
|
||||
|
@ -867,7 +866,7 @@ static void emit_vertex_write( struct brw_vs_compile *c)
|
|||
* Later, clipping will detect ucp[6] and ensure the primitive is
|
||||
* clipped against all fixed planes.
|
||||
*/
|
||||
if (!(BRW_IS_GM45(p->brw) || BRW_IS_G4X(p->brw)) && !c->key.know_w_is_one) {
|
||||
if (!BRW_IS_G4X(p->brw) && !c->key.know_w_is_one) {
|
||||
brw_CMP(p,
|
||||
vec8(brw_null_reg()),
|
||||
BRW_CONDITIONAL_L,
|
||||
|
|
|
@ -62,7 +62,6 @@ dri_bo_release(dri_bo **bo)
|
|||
*/
|
||||
static void brw_destroy_context( struct intel_context *intel )
|
||||
{
|
||||
GLcontext *ctx = &intel->ctx;
|
||||
struct brw_context *brw = brw_context(&intel->ctx);
|
||||
int i;
|
||||
|
||||
|
|
|
@ -157,6 +157,7 @@ struct brw_wm_instruction {
|
|||
#define BRW_WM_MAX_PARAM 256
|
||||
#define BRW_WM_MAX_CONST 256
|
||||
#define BRW_WM_MAX_KILLS MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS
|
||||
#define BRW_WM_MAX_SUBROUTINE 16
|
||||
|
||||
|
||||
|
||||
|
@ -246,7 +247,10 @@ struct brw_wm_compile {
|
|||
struct brw_reg stack;
|
||||
struct brw_reg emit_mask_reg;
|
||||
GLuint reg_index;
|
||||
GLuint tmp_regs[BRW_WM_MAX_GRF];
|
||||
GLuint tmp_index;
|
||||
GLuint tmp_max;
|
||||
GLuint subroutines[BRW_WM_MAX_SUBROUTINE];
|
||||
};
|
||||
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue