Merge commit 'origin/master' into gallium-0.2
Conflicts: src/mesa/glapi/descrip.mms src/mesa/shader/grammar/descrip.mms
This commit is contained in:
commit
3a3801c143
24
bin/mklib
24
bin/mklib
|
@ -260,9 +260,31 @@ case $ARCH in
|
|||
OPTS=${ALTOPTS}
|
||||
fi
|
||||
rm -f ${LIBNAME}
|
||||
|
||||
# expand any .a objects into constituent .o files.
|
||||
NEWOBJECTS=""
|
||||
DELETIA=""
|
||||
for OBJ in ${OBJECTS} ; do
|
||||
if [ `expr match $OBJ '.*\.a'` -gt 0 ] ; then
|
||||
# extract the .o files from this .a archive
|
||||
FILES=`ar t $OBJ`
|
||||
ar x $OBJ
|
||||
NEWOBJECTS="$NEWOBJECTS $FILES"
|
||||
# keep track of temporary .o files and delete them below
|
||||
DELETIA="$DELETIA $FILES"
|
||||
else
|
||||
# ordinary .o file
|
||||
NEWOBJECTS="$NEWOBJECTS $OBJ"
|
||||
fi
|
||||
done
|
||||
|
||||
# make lib
|
||||
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
|
||||
${LINK} ${OPTS} ${LIBNAME} ${NEWOBJECTS}
|
||||
ranlib ${LIBNAME}
|
||||
|
||||
# remove temporary extracted .o files
|
||||
rm -f ${DELETIA}
|
||||
|
||||
# finish up
|
||||
FINAL_LIBS=${LIBNAME}
|
||||
else
|
||||
|
|
|
@ -12,10 +12,10 @@ CXX = gcc
|
|||
PIC_FLAGS = -fPIC
|
||||
DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
|
||||
-D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS \
|
||||
-DGLX_INDIRECT_RENDERING \
|
||||
-DGLX_ALIAS_UNSUPPORTED
|
||||
-DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING
|
||||
|
||||
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx/x11
|
||||
# -DGLX_USE_APPLEGL - supposed to be used with GLX_DIRECT_RENDERING to use AGL rather than DRM, but doesn't compile
|
||||
# -DIN_DRI_DRIVER
|
||||
|
||||
ARCH_FLAGS += $(RC_CFLAGS)
|
||||
|
@ -47,7 +47,7 @@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11
|
|||
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
|
||||
|
||||
# omit glw lib for now:
|
||||
SRC_DIRS = glx/x11 mesa glu glw glut/glx
|
||||
SRC_DIRS = glx/x11 mesa glu glut/glx
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = osmesa
|
||||
#DRIVER_DIRS = dri
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Makefile for core library for VMS
|
||||
# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
|
||||
# Last revision : 3 October 2007
|
||||
# Last revision : 29 September 2008
|
||||
|
||||
.first
|
||||
define gl [----.include.gl]
|
||||
|
@ -19,7 +19,8 @@ VPATH = RCS
|
|||
|
||||
INCDIR = [----.include],[--.main],[--.glapi],[--.shader]
|
||||
LIBDIR = [----.lib]
|
||||
CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
|
||||
CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)\
|
||||
/float=ieee/ieee=denorm/warn=disable=(PTRMISMATCH)
|
||||
|
||||
SOURCES = driverfuncs.c
|
||||
|
||||
|
|
|
@ -566,6 +566,13 @@ i830_destroy_context(struct intel_context *intel)
|
|||
GLuint i;
|
||||
struct i830_context *i830 = i830_context(&intel->ctx);
|
||||
|
||||
intel_region_release(&i830->state.draw_region);
|
||||
intel_region_release(&i830->state.depth_region);
|
||||
intel_region_release(&i830->meta.draw_region);
|
||||
intel_region_release(&i830->meta.depth_region);
|
||||
intel_region_release(&i830->initial.draw_region);
|
||||
intel_region_release(&i830->initial.depth_region);
|
||||
|
||||
for (i = 0; i < I830_TEX_UNITS; i++) {
|
||||
if (i830->state.tex_buffer[i] != NULL) {
|
||||
dri_bo_unreference(i830->state.tex_buffer[i]);
|
||||
|
|
|
@ -56,8 +56,6 @@ static const struct dri_extension i915_extensions[] = {
|
|||
{"GL_ARB_shadow", NULL},
|
||||
{"GL_ARB_texture_non_power_of_two", NULL},
|
||||
{"GL_EXT_shadow_funcs", NULL},
|
||||
/* ARB extn won't work if not enabled */
|
||||
{"GL_SGIX_depth_texture", NULL},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
|
@ -125,6 +125,9 @@ struct i915_fragment_program
|
|||
GLboolean on_hardware;
|
||||
GLboolean error; /* If program is malformed for any reason. */
|
||||
|
||||
/** Record of which phases R registers were last written in. */
|
||||
GLuint register_phases[16];
|
||||
GLuint indirections;
|
||||
GLuint nr_tex_indirect;
|
||||
GLuint nr_tex_insn;
|
||||
GLuint nr_alu_insn;
|
||||
|
|
|
@ -190,6 +190,9 @@ i915_emit_arith(struct i915_fragment_program * p,
|
|||
*(p->csr++) = (A1_SRC0(src0) | A1_SRC1(src1));
|
||||
*(p->csr++) = (A2_SRC1(src1) | A2_SRC2(src2));
|
||||
|
||||
if (GET_UREG_TYPE(dest) == REG_TYPE_R)
|
||||
p->register_phases[GET_UREG_NR(dest)] = p->nr_tex_indirect;
|
||||
|
||||
p->nr_alu_insn++;
|
||||
return dest;
|
||||
}
|
||||
|
@ -237,10 +240,22 @@ GLuint i915_emit_texld( struct i915_fragment_program *p,
|
|||
else {
|
||||
assert(GET_UREG_TYPE(dest) != REG_TYPE_CONST);
|
||||
assert(dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest)));
|
||||
/* Can't use unsaved temps for coords, as the phase boundary would result
|
||||
* in the contents becoming undefined.
|
||||
*/
|
||||
assert(GET_UREG_TYPE(coord) != REG_TYPE_U);
|
||||
|
||||
if (GET_UREG_TYPE(coord) != REG_TYPE_T) {
|
||||
/* Output register being oC or oD defines a phase boundary */
|
||||
if (GET_UREG_TYPE(dest) == REG_TYPE_OC ||
|
||||
GET_UREG_TYPE(dest) == REG_TYPE_OD)
|
||||
p->nr_tex_indirect++;
|
||||
|
||||
/* Reading from an r# register whose contents depend on output of the
|
||||
* current phase defines a phase boundary.
|
||||
*/
|
||||
if (GET_UREG_TYPE(coord) == REG_TYPE_R &&
|
||||
p->register_phases[GET_UREG_NR(coord)] == p->nr_tex_indirect)
|
||||
p->nr_tex_indirect++;
|
||||
}
|
||||
|
||||
*(p->csr++) = (op |
|
||||
T0_DEST( dest ) |
|
||||
|
@ -249,6 +264,9 @@ GLuint i915_emit_texld( struct i915_fragment_program *p,
|
|||
*(p->csr++) = T1_ADDRESS_REG( coord );
|
||||
*(p->csr++) = T2_MBZ;
|
||||
|
||||
if (GET_UREG_TYPE(dest) == REG_TYPE_R)
|
||||
p->register_phases[GET_UREG_NR(dest)] = p->nr_tex_indirect;
|
||||
|
||||
p->nr_tex_insn++;
|
||||
return dest;
|
||||
}
|
||||
|
@ -413,7 +431,8 @@ i915_init_program(struct i915_context *i915, struct i915_fragment_program *p)
|
|||
p->on_hardware = 0;
|
||||
p->error = 0;
|
||||
|
||||
p->nr_tex_indirect = 1; /* correct? */
|
||||
memset(&p->register_phases, 0, sizeof(p->register_phases));
|
||||
p->nr_tex_indirect = 1;
|
||||
p->nr_tex_insn = 0;
|
||||
p->nr_alu_insn = 0;
|
||||
p->nr_decl_insn = 0;
|
||||
|
|
|
@ -307,10 +307,21 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
|
|||
}
|
||||
|
||||
|
||||
state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0],
|
||||
tObj->_BorderChan[1],
|
||||
tObj->_BorderChan[2],
|
||||
tObj->_BorderChan[3]);
|
||||
if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) {
|
||||
/* GL specs that border color for depth textures is taken from the
|
||||
* R channel, while the hardware uses A. Spam R into all the channels
|
||||
* for safety.
|
||||
*/
|
||||
state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0],
|
||||
tObj->_BorderChan[0],
|
||||
tObj->_BorderChan[0],
|
||||
tObj->_BorderChan[0]);
|
||||
} else {
|
||||
state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0],
|
||||
tObj->_BorderChan[1],
|
||||
tObj->_BorderChan[2],
|
||||
tObj->_BorderChan[3]);
|
||||
}
|
||||
|
||||
|
||||
I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(unit), GL_TRUE);
|
||||
|
|
|
@ -490,6 +490,13 @@ i915_destroy_context(struct intel_context *intel)
|
|||
GLuint i;
|
||||
struct i915_context *i915 = i915_context(&intel->ctx);
|
||||
|
||||
intel_region_release(&i915->state.draw_region);
|
||||
intel_region_release(&i915->state.depth_region);
|
||||
intel_region_release(&i915->meta.draw_region);
|
||||
intel_region_release(&i915->meta.depth_region);
|
||||
intel_region_release(&i915->initial.draw_region);
|
||||
intel_region_release(&i915->initial.depth_region);
|
||||
|
||||
for (i = 0; i < I915_TEX_UNITS; i++) {
|
||||
if (i915->state.tex_buffer[i] != NULL) {
|
||||
dri_bo_unreference(i915->state.tex_buffer[i]);
|
||||
|
|
|
@ -18,8 +18,9 @@ DRIVER_SOURCES = \
|
|||
intel_screen.c \
|
||||
intel_span.c \
|
||||
intel_pixel.c \
|
||||
intel_pixel_copy.c \
|
||||
intel_pixel_bitmap.c \
|
||||
intel_pixel_copy.c \
|
||||
intel_pixel_draw.c \
|
||||
intel_state.c \
|
||||
intel_tex.c \
|
||||
intel_tex_copy.c \
|
||||
|
@ -51,6 +52,7 @@ DRIVER_SOURCES = \
|
|||
brw_metaops.c \
|
||||
brw_misc_state.c \
|
||||
brw_program.c \
|
||||
brw_queryobj.c \
|
||||
brw_sf.c \
|
||||
brw_sf_emit.c \
|
||||
brw_sf_state.c \
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "main/imports.h"
|
||||
#include "main/api_noop.h"
|
||||
#include "main/vtxfmt.h"
|
||||
#include "main/simple_list.h"
|
||||
#include "shader/shader_api.h"
|
||||
|
||||
#include "brw_context.h"
|
||||
|
@ -68,6 +69,7 @@ static void brwInitDriverFunctions( struct dd_function_table *functions )
|
|||
|
||||
brwInitFragProgFuncs( functions );
|
||||
brwInitProgFuncs( functions );
|
||||
brw_init_queryobj_functions(functions);
|
||||
}
|
||||
|
||||
|
||||
|
@ -150,9 +152,9 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
|
|||
ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
|
||||
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
||||
|
||||
brw_draw_init( brw );
|
||||
make_empty_list(&brw->query.active_head);
|
||||
|
||||
brw_ProgramCacheInit( ctx );
|
||||
brw_draw_init( brw );
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
|
|
@ -130,7 +130,6 @@ struct brw_context;
|
|||
#define BRW_NEW_CONTEXT 0x80
|
||||
#define BRW_NEW_WM_INPUT_DIMENSIONS 0x100
|
||||
#define BRW_NEW_INPUT_VARYING 0x200
|
||||
#define BRW_NEW_TNL_PROGRAM 0x400
|
||||
#define BRW_NEW_PSP 0x800
|
||||
#define BRW_NEW_METAOPS 0x1000
|
||||
#define BRW_NEW_FENCE 0x2000
|
||||
|
@ -411,7 +410,22 @@ struct brw_tnl_cache {
|
|||
GLuint size, n_items;
|
||||
};
|
||||
|
||||
struct brw_query_object {
|
||||
struct gl_query_object Base;
|
||||
|
||||
/** Doubly linked list of active query objects in the context. */
|
||||
struct brw_query_object *prev, *next;
|
||||
|
||||
/** Last query BO associated with this query. */
|
||||
dri_bo *bo;
|
||||
/** First index in bo with query data for this object. */
|
||||
int first_index;
|
||||
/** Last index in bo with query data for this object. */
|
||||
int last_index;
|
||||
|
||||
/* Total count of pixels from previous BOs */
|
||||
unsigned int count;
|
||||
};
|
||||
|
||||
struct brw_context
|
||||
{
|
||||
|
@ -488,10 +502,6 @@ struct brw_context
|
|||
GLboolean active;
|
||||
} metaops;
|
||||
|
||||
/* Track fixed function t&l in a vertex program:
|
||||
*/
|
||||
struct gl_vertex_program *tnl_program;
|
||||
struct brw_tnl_cache tnl_program_cache;
|
||||
|
||||
/* Active vertex program:
|
||||
*/
|
||||
|
@ -631,7 +641,12 @@ struct brw_context
|
|||
dri_bo *vp_bo;
|
||||
} cc;
|
||||
|
||||
|
||||
struct {
|
||||
struct brw_query_object active_head;
|
||||
dri_bo *bo;
|
||||
int index;
|
||||
GLboolean active;
|
||||
} query;
|
||||
/* Used to give every program string a unique id
|
||||
*/
|
||||
GLuint program_id;
|
||||
|
@ -656,7 +671,13 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
|
|||
__DRIcontextPrivate *driContextPriv,
|
||||
void *sharedContextPrivate);
|
||||
|
||||
|
||||
/*======================================================================
|
||||
* brw_queryobj.c
|
||||
*/
|
||||
void brw_init_queryobj_functions(struct dd_function_table *functions);
|
||||
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
|
||||
|
|
|
@ -382,7 +382,6 @@ void brw_draw_prims( GLcontext *ctx,
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Make a first attempt at drawing:
|
||||
*/
|
||||
retval = brw_try_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index);
|
||||
|
@ -395,6 +394,7 @@ void brw_draw_prims( GLcontext *ctx,
|
|||
_swsetup_Wakeup(ctx);
|
||||
_tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void brw_draw_init( struct brw_context *brw )
|
||||
|
@ -409,8 +409,18 @@ void brw_draw_init( struct brw_context *brw )
|
|||
|
||||
void brw_draw_destroy( struct brw_context *brw )
|
||||
{
|
||||
int i;
|
||||
|
||||
if (brw->vb.upload.bo != NULL) {
|
||||
dri_bo_unreference(brw->vb.upload.bo);
|
||||
brw->vb.upload.bo = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
|
||||
dri_bo_unreference(brw->vb.inputs[i].bo);
|
||||
brw->vb.inputs[i].bo = NULL;
|
||||
}
|
||||
|
||||
dri_bo_unreference(brw->ib.bo);
|
||||
brw->ib.bo = NULL;
|
||||
}
|
||||
|
|
|
@ -365,8 +365,10 @@ static void brw_prepare_vertices(struct brw_context *brw)
|
|||
if (i == 0) {
|
||||
/* Position array not properly enabled:
|
||||
*/
|
||||
if (input->glarray->StrideB == 0)
|
||||
return;
|
||||
if (input->glarray->StrideB == 0) {
|
||||
intel->Fallback = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
interleave = input->glarray->StrideB;
|
||||
ptr = input->glarray->Ptr;
|
||||
|
@ -413,6 +415,8 @@ static void brw_prepare_vertices(struct brw_context *brw)
|
|||
copy_array_to_vbo_array(brw, upload[i], upload[i]->element_size);
|
||||
}
|
||||
}
|
||||
|
||||
brw_prepare_query_begin(brw);
|
||||
}
|
||||
|
||||
static void brw_emit_vertices(struct brw_context *brw)
|
||||
|
@ -433,6 +437,7 @@ static void brw_emit_vertices(struct brw_context *brw)
|
|||
enabled[nr_enabled++] = input;
|
||||
}
|
||||
|
||||
brw_emit_query_begin(brw);
|
||||
|
||||
/* Now emit VB and VEP state packets.
|
||||
*
|
||||
|
|
|
@ -74,10 +74,7 @@ static GLboolean do_check_fallback(struct brw_context *brw)
|
|||
if (texUnit->_ReallyEnabled) {
|
||||
struct intel_texture_object *intelObj = intel_texture_object(texUnit->_Current);
|
||||
struct gl_texture_image *texImage = intelObj->base.Image[0][intelObj->firstLevel];
|
||||
if (texImage->Border ||
|
||||
((texImage->_BaseFormat == GL_DEPTH_COMPONENT) &&
|
||||
((texImage->TexObject->WrapS == GL_CLAMP_TO_BORDER) ||
|
||||
(texImage->TexObject->WrapT == GL_CLAMP_TO_BORDER)))) {
|
||||
if (texImage->Border) {
|
||||
DBG("FALLBACK: texture border\n");
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,263 @@
|
|||
/*
|
||||
* Copyright © 2008 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Eric Anholt <eric@anholt.net>
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file support for ARB_query_object
|
||||
*
|
||||
* ARB_query_object is implemented by using the PIPE_CONTROL command to stall
|
||||
* execution on the completion of previous depth tests, and write the
|
||||
* current PS_DEPTH_COUNT to a buffer object.
|
||||
*
|
||||
* We use before and after counts when drawing during a query so that
|
||||
* we don't pick up other clients' query data in ours. To reduce overhead,
|
||||
* a single BO is used to record the query data for all active queries at
|
||||
* once. This also gives us a simple bound on how much batchbuffer space is
|
||||
* required for handling queries, so that we can be sure that we won't
|
||||
* have to emit a batchbuffer without getting the ending PS_DEPTH_COUNT.
|
||||
*/
|
||||
#include "main/simple_list.h"
|
||||
#include "main/imports.h"
|
||||
|
||||
#include "brw_context.h"
|
||||
#include "intel_batchbuffer.h"
|
||||
#include "intel_reg.h"
|
||||
|
||||
/** Waits on the query object's BO and totals the results for this query */
|
||||
static void
|
||||
brw_queryobj_get_results(struct brw_query_object *query)
|
||||
{
|
||||
int i;
|
||||
uint64_t *results;
|
||||
|
||||
if (query->bo == NULL)
|
||||
return;
|
||||
|
||||
/* Map and count the pixels from the current query BO */
|
||||
dri_bo_map(query->bo, GL_FALSE);
|
||||
results = query->bo->virtual;
|
||||
for (i = query->first_index; i <= query->last_index; i++) {
|
||||
query->Base.Result += results[i * 2 + 1] - results[i * 2];
|
||||
}
|
||||
dri_bo_unmap(query->bo);
|
||||
|
||||
dri_bo_unreference(query->bo);
|
||||
query->bo = NULL;
|
||||
}
|
||||
|
||||
static struct gl_query_object *
|
||||
brw_new_query_object(GLcontext *ctx, GLuint id)
|
||||
{
|
||||
struct brw_query_object *query;
|
||||
|
||||
query = _mesa_calloc(sizeof(struct brw_query_object));
|
||||
|
||||
query->Base.Id = id;
|
||||
query->Base.Result = 0;
|
||||
query->Base.Active = GL_FALSE;
|
||||
query->Base.Ready = GL_TRUE;
|
||||
|
||||
return &query->Base;
|
||||
}
|
||||
|
||||
static void
|
||||
brw_delete_query(GLcontext *ctx, struct gl_query_object *q)
|
||||
{
|
||||
struct brw_query_object *query = (struct brw_query_object *)q;
|
||||
|
||||
dri_bo_unreference(query->bo);
|
||||
_mesa_free(query);
|
||||
}
|
||||
|
||||
static void
|
||||
brw_begin_query(GLcontext *ctx, struct gl_query_object *q)
|
||||
{
|
||||
struct brw_context *brw = brw_context(ctx);
|
||||
struct intel_context *intel = intel_context(ctx);
|
||||
struct brw_query_object *query = (struct brw_query_object *)q;
|
||||
|
||||
/* Reset our driver's tracking of query state. */
|
||||
dri_bo_unreference(query->bo);
|
||||
query->bo = NULL;
|
||||
query->first_index = -1;
|
||||
query->last_index = -1;
|
||||
|
||||
insert_at_head(&brw->query.active_head, query);
|
||||
intel->stats_wm++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Begin the ARB_occlusion_query query on a query object.
|
||||
*/
|
||||
static void
|
||||
brw_end_query(GLcontext *ctx, struct gl_query_object *q)
|
||||
{
|
||||
struct brw_context *brw = brw_context(ctx);
|
||||
struct intel_context *intel = intel_context(ctx);
|
||||
struct brw_query_object *query = (struct brw_query_object *)q;
|
||||
|
||||
/* Flush the batchbuffer in case it has writes to our query BO.
|
||||
* Have later queries write to a new query BO so that further rendering
|
||||
* doesn't delay the collection of our results.
|
||||
*/
|
||||
if (query->bo) {
|
||||
brw_emit_query_end(brw);
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
dri_bo_unreference(brw->query.bo);
|
||||
brw->query.bo = NULL;
|
||||
}
|
||||
|
||||
remove_from_list(query);
|
||||
|
||||
intel->stats_wm--;
|
||||
}
|
||||
|
||||
static void brw_wait_query(GLcontext *ctx, struct gl_query_object *q)
|
||||
{
|
||||
struct brw_query_object *query = (struct brw_query_object *)q;
|
||||
|
||||
brw_queryobj_get_results(query);
|
||||
query->Base.Ready = GL_TRUE;
|
||||
}
|
||||
|
||||
static void brw_check_query(GLcontext *ctx, struct gl_query_object *q)
|
||||
{
|
||||
/* XXX: Need to expose dri_bo_is_idle from bufmgr. */
|
||||
#if 0
|
||||
struct brw_query_object *query = (struct brw_query_object *)q;
|
||||
|
||||
if (dri_bo_is_idle(query->bo)) {
|
||||
brw_queryobj_get_results(query);
|
||||
query->Base.Ready = GL_TRUE;
|
||||
}
|
||||
#else
|
||||
brw_wait_query(ctx, q);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Called to set up the query BO and account for its aperture space */
|
||||
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))
|
||||
return;
|
||||
|
||||
/* Get a new query BO if we're going to need it. */
|
||||
if (brw->query.bo == NULL ||
|
||||
brw->query.index * 2 + 1 >= 4096 / sizeof(uint64_t)) {
|
||||
dri_bo_unreference(brw->query.bo);
|
||||
brw->query.bo = NULL;
|
||||
|
||||
brw->query.bo = dri_bo_alloc(intel->bufmgr, "query", 4096, 1);
|
||||
brw->query.index = 0;
|
||||
}
|
||||
|
||||
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array)))
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
}
|
||||
|
||||
/** Called just before primitive drawing to get a beginning PS_DEPTH_COUNT. */
|
||||
void
|
||||
brw_emit_query_begin(struct brw_context *brw)
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
struct brw_query_object *query;
|
||||
|
||||
/* Skip if we're not doing any queries, or we've emitted the start. */
|
||||
if (brw->query.active || is_empty_list(&brw->query.active_head))
|
||||
return;
|
||||
|
||||
BEGIN_BATCH(4, IGNORE_CLIPRECTS);
|
||||
OUT_BATCH(_3DSTATE_PIPE_CONTROL |
|
||||
PIPE_CONTROL_DEPTH_STALL |
|
||||
PIPE_CONTROL_WRITE_DEPTH_COUNT);
|
||||
/* This object could be mapped cacheable, but we don't have an exposed
|
||||
* mechanism to support that. Since it's going uncached, tell GEM that
|
||||
* we're writing to it. The usual clflush should be all that's required
|
||||
* to pick up the results.
|
||||
*/
|
||||
OUT_RELOC(brw->query.bo,
|
||||
I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
|
||||
PIPE_CONTROL_GLOBAL_GTT_WRITE |
|
||||
((brw->query.index * 2) * sizeof(uint64_t)));
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
ADVANCE_BATCH();
|
||||
|
||||
foreach(query, &brw->query.active_head) {
|
||||
if (query->bo != brw->query.bo) {
|
||||
if (query->bo != NULL)
|
||||
brw_queryobj_get_results(query);
|
||||
dri_bo_reference(brw->query.bo);
|
||||
query->bo = brw->query.bo;
|
||||
query->first_index = brw->query.index;
|
||||
}
|
||||
query->last_index = brw->query.index;
|
||||
}
|
||||
brw->query.active = GL_TRUE;
|
||||
}
|
||||
|
||||
/** Called at batchbuffer flush to get an ending PS_DEPTH_COUNT */
|
||||
void
|
||||
brw_emit_query_end(struct brw_context *brw)
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
|
||||
if (!brw->query.active)
|
||||
return;
|
||||
|
||||
BEGIN_BATCH(4, IGNORE_CLIPRECTS);
|
||||
OUT_BATCH(_3DSTATE_PIPE_CONTROL |
|
||||
PIPE_CONTROL_DEPTH_STALL |
|
||||
PIPE_CONTROL_WRITE_DEPTH_COUNT);
|
||||
OUT_RELOC(brw->query.bo,
|
||||
I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
|
||||
PIPE_CONTROL_GLOBAL_GTT_WRITE |
|
||||
((brw->query.index * 2 + 1) * sizeof(uint64_t)));
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
ADVANCE_BATCH();
|
||||
|
||||
brw->query.active = GL_FALSE;
|
||||
brw->query.index++;
|
||||
}
|
||||
|
||||
void brw_init_queryobj_functions(struct dd_function_table *functions)
|
||||
{
|
||||
functions->NewQueryObject = brw_new_query_object;
|
||||
functions->DeleteQuery = brw_delete_query;
|
||||
functions->BeginQuery = brw_begin_query;
|
||||
functions->EndQuery = brw_end_query;
|
||||
functions->CheckQuery = brw_check_query;
|
||||
functions->WaitQuery = brw_wait_query;
|
||||
}
|
|
@ -74,7 +74,6 @@ const struct brw_tracked_state brw_wm_unit;
|
|||
const struct brw_tracked_state brw_psp_urb_cbs;
|
||||
|
||||
const struct brw_tracked_state brw_active_vertprog;
|
||||
const struct brw_tracked_state brw_tnl_vertprog;
|
||||
const struct brw_tracked_state brw_pipe_control;
|
||||
|
||||
const struct brw_tracked_state brw_clear_surface_cache;
|
||||
|
|
|
@ -497,9 +497,10 @@ void brw_destroy_cache( struct brw_context *brw )
|
|||
GLuint i;
|
||||
|
||||
brw_clear_cache(brw);
|
||||
for (i = 0; i < BRW_MAX_CACHE; i++)
|
||||
for (i = 0; i < BRW_MAX_CACHE; i++) {
|
||||
dri_bo_unreference(brw->cache.last_bo[i]);
|
||||
free(brw->cache.name[i]);
|
||||
|
||||
}
|
||||
free(brw->cache.items);
|
||||
brw->cache.items = NULL;
|
||||
brw->cache.size = 0;
|
||||
|
|
|
@ -45,7 +45,6 @@ const struct brw_tracked_state *atoms[] =
|
|||
{
|
||||
&brw_check_fallback,
|
||||
|
||||
&brw_tnl_vertprog,
|
||||
&brw_active_vertprog,
|
||||
&brw_wm_input_sizes,
|
||||
&brw_vs_prog,
|
||||
|
|
|
@ -80,8 +80,4 @@ struct brw_vs_compile {
|
|||
|
||||
void brw_vs_emit( struct brw_vs_compile *c );
|
||||
|
||||
|
||||
void brw_ProgramCacheDestroy( GLcontext *ctx );
|
||||
void brw_ProgramCacheInit( GLcontext *ctx );
|
||||
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -51,6 +51,12 @@
|
|||
#include "brw_vs.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
static void
|
||||
dri_bo_release(dri_bo **bo)
|
||||
{
|
||||
dri_bo_unreference(*bo);
|
||||
*bo = NULL;
|
||||
}
|
||||
|
||||
/* called from intelDestroyContext()
|
||||
*/
|
||||
|
@ -58,13 +64,40 @@ static void brw_destroy_context( struct intel_context *intel )
|
|||
{
|
||||
GLcontext *ctx = &intel->ctx;
|
||||
struct brw_context *brw = brw_context(&intel->ctx);
|
||||
int i;
|
||||
|
||||
brw_destroy_metaops(brw);
|
||||
brw_destroy_state(brw);
|
||||
brw_draw_destroy( brw );
|
||||
|
||||
brw_ProgramCacheDestroy( ctx );
|
||||
brw_FrameBufferTexDestroy( brw );
|
||||
|
||||
for (i = 0; i < brw->state.nr_draw_regions; i++)
|
||||
intel_region_release(&brw->state.draw_regions[i]);
|
||||
brw->state.nr_draw_regions = 0;
|
||||
intel_region_release(&brw->state.depth_region);
|
||||
|
||||
dri_bo_release(&brw->curbe.curbe_bo);
|
||||
dri_bo_release(&brw->vs.prog_bo);
|
||||
dri_bo_release(&brw->vs.state_bo);
|
||||
dri_bo_release(&brw->gs.prog_bo);
|
||||
dri_bo_release(&brw->gs.state_bo);
|
||||
dri_bo_release(&brw->clip.prog_bo);
|
||||
dri_bo_release(&brw->clip.state_bo);
|
||||
dri_bo_release(&brw->clip.vp_bo);
|
||||
dri_bo_release(&brw->sf.prog_bo);
|
||||
dri_bo_release(&brw->sf.state_bo);
|
||||
dri_bo_release(&brw->sf.vp_bo);
|
||||
for (i = 0; i < BRW_MAX_TEX_UNIT; i++)
|
||||
dri_bo_release(&brw->wm.sdc_bo[i]);
|
||||
dri_bo_release(&brw->wm.bind_bo);
|
||||
for (i = 0; i < BRW_WM_MAX_SURF; i++)
|
||||
dri_bo_release(&brw->wm.surf_bo[i]);
|
||||
dri_bo_release(&brw->wm.prog_bo);
|
||||
dri_bo_release(&brw->wm.state_bo);
|
||||
dri_bo_release(&brw->cc.prog_bo);
|
||||
dri_bo_release(&brw->cc.state_bo);
|
||||
dri_bo_release(&brw->cc.vp_bo);
|
||||
}
|
||||
|
||||
/* called from intelDrawBuffer()
|
||||
|
@ -87,6 +120,15 @@ static void brw_set_draw_region( struct intel_context *intel,
|
|||
brw->state.nr_draw_regions = num_regions;
|
||||
}
|
||||
|
||||
/* called from intel_batchbuffer_flush and children before sending a
|
||||
* batchbuffer off.
|
||||
*/
|
||||
static void brw_finish_batch(struct intel_context *intel)
|
||||
{
|
||||
struct brw_context *brw = brw_context(&intel->ctx);
|
||||
|
||||
brw_emit_query_end(brw);
|
||||
}
|
||||
|
||||
/* called from intelFlushBatchLocked
|
||||
*/
|
||||
|
@ -185,6 +227,7 @@ void brwInitVtbl( struct brw_context *brw )
|
|||
brw->intel.vtbl.note_fence = brw_note_fence;
|
||||
brw->intel.vtbl.note_unlock = brw_note_unlock;
|
||||
brw->intel.vtbl.new_batch = brw_new_batch;
|
||||
brw->intel.vtbl.finish_batch = brw_finish_batch;
|
||||
brw->intel.vtbl.destroy = brw_destroy_context;
|
||||
brw->intel.vtbl.set_draw_region = brw_set_draw_region;
|
||||
brw->intel.vtbl.flush_cmd = brw_flush_cmd;
|
||||
|
|
|
@ -229,6 +229,9 @@ brw_wm_sampler_populate_key(struct brw_context *brw,
|
|||
struct wm_sampler_entry *entry = &key->sampler[unit];
|
||||
struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[unit];
|
||||
struct gl_texture_object *texObj = texUnit->_Current;
|
||||
struct intel_texture_object *intelObj = intel_texture_object(texObj);
|
||||
struct gl_texture_image *firstImage =
|
||||
texObj->Image[0][intelObj->firstLevel];
|
||||
|
||||
entry->wrap_r = texObj->WrapR;
|
||||
entry->wrap_s = texObj->WrapS;
|
||||
|
@ -244,8 +247,22 @@ brw_wm_sampler_populate_key(struct brw_context *brw,
|
|||
entry->comparefunc = texObj->CompareFunc;
|
||||
|
||||
dri_bo_unreference(brw->wm.sdc_bo[unit]);
|
||||
brw->wm.sdc_bo[unit] = upload_default_color(brw, texObj->BorderColor);
|
||||
|
||||
if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) {
|
||||
float bordercolor[4] = {
|
||||
texObj->BorderColor[0],
|
||||
texObj->BorderColor[0],
|
||||
texObj->BorderColor[0],
|
||||
texObj->BorderColor[0]
|
||||
};
|
||||
/* GL specs that border color for depth textures is taken from the
|
||||
* R channel, while the hardware uses A. Spam R into all the
|
||||
* channels for safety.
|
||||
*/
|
||||
brw->wm.sdc_bo[unit] = upload_default_color(brw, bordercolor);
|
||||
} else {
|
||||
brw->wm.sdc_bo[unit] = upload_default_color(brw,
|
||||
texObj->BorderColor);
|
||||
}
|
||||
key->sampler_count = unit + 1;
|
||||
}
|
||||
}
|
||||
|
@ -304,7 +321,7 @@ static void upload_wm_samplers( struct brw_context *brw )
|
|||
continue;
|
||||
|
||||
dri_bo_emit_reloc(brw->wm.sampler_bo,
|
||||
I915_GEM_DOMAIN_INSTRUCTION, 0,
|
||||
I915_GEM_DOMAIN_SAMPLER, 0,
|
||||
0,
|
||||
i * sizeof(struct brw_sampler_state) +
|
||||
offsetof(struct brw_sampler_state, ss2),
|
||||
|
|
|
@ -274,7 +274,6 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit )
|
|||
key.width = firstImage->Width;
|
||||
key.height = firstImage->Height;
|
||||
key.cpp = intelObj->mt->cpp;
|
||||
key.depth = firstImage->Depth;
|
||||
key.tiling = intelObj->mt->region->tiling;
|
||||
|
||||
dri_bo_unreference(brw->wm.surf_bo[unit + MAX_DRAW_BUFFERS]);
|
||||
|
|
|
@ -135,6 +135,14 @@ intel_readbuf_region(struct intel_context *intel)
|
|||
static void
|
||||
intelSetRenderbufferClipRects(struct intel_context *intel)
|
||||
{
|
||||
/* If the batch contents require looping over cliprects, flush them before
|
||||
* we go changing which cliprects get referenced when that happens.
|
||||
*/
|
||||
if (intel->batch->cliprect_mode == LOOP_CLIPRECTS &&
|
||||
(intel->fboRect.x2 != intel->ctx.DrawBuffer->Width ||
|
||||
intel->fboRect.x2 != intel->ctx.DrawBuffer->Height))
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
assert(intel->ctx.DrawBuffer->Width > 0);
|
||||
assert(intel->ctx.DrawBuffer->Height > 0);
|
||||
intel->fboRect.x1 = 0;
|
||||
|
@ -160,6 +168,12 @@ intelSetFrontClipRects(struct intel_context *intel)
|
|||
if (!dPriv)
|
||||
return;
|
||||
|
||||
/* If the batch contents require looping over cliprects, flush them before
|
||||
* we go changing which cliprects get referenced when that happens.
|
||||
*/
|
||||
if (intel->batch->cliprect_mode == LOOP_CLIPRECTS &&
|
||||
intel->pClipRects != dPriv->pClipRects)
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
intel->numClipRects = dPriv->numClipRects;
|
||||
intel->pClipRects = dPriv->pClipRects;
|
||||
intel->drawX = dPriv->x;
|
||||
|
@ -183,6 +197,10 @@ intelSetBackClipRects(struct intel_context *intel)
|
|||
|
||||
if (intel_fb->pf_active || dPriv->numBackClipRects == 0) {
|
||||
/* use the front clip rects */
|
||||
if (intel->batch->cliprect_mode == LOOP_CLIPRECTS &&
|
||||
intel->pClipRects != dPriv->pClipRects)
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
intel->numClipRects = dPriv->numClipRects;
|
||||
intel->pClipRects = dPriv->pClipRects;
|
||||
intel->drawX = dPriv->x;
|
||||
|
@ -190,6 +208,10 @@ intelSetBackClipRects(struct intel_context *intel)
|
|||
}
|
||||
else {
|
||||
/* use the back clip rects */
|
||||
if (intel->batch->cliprect_mode == LOOP_CLIPRECTS &&
|
||||
intel->pClipRects != dPriv->pBackClipRects)
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
intel->numClipRects = dPriv->numBackClipRects;
|
||||
intel->pClipRects = dPriv->pBackClipRects;
|
||||
intel->drawX = dPriv->backX;
|
||||
|
@ -900,12 +922,6 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
|
|||
if (fb->Name)
|
||||
intel_validate_paired_depth_stencil(ctx, fb);
|
||||
|
||||
/* If the batch contents require looping over cliprects, flush them before
|
||||
* we go changing which cliprects get referenced when that happens.
|
||||
*/
|
||||
if (intel->batch->cliprect_mode == LOOP_CLIPRECTS)
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
|
||||
/*
|
||||
* How many color buffers are we drawing into?
|
||||
*/
|
||||
|
|
|
@ -68,14 +68,15 @@
|
|||
int INTEL_DEBUG = (0);
|
||||
#endif
|
||||
|
||||
#define need_GL_NV_point_sprite
|
||||
#define need_GL_ARB_multisample
|
||||
#define need_GL_ARB_occlusion_query
|
||||
#define need_GL_ARB_point_parameters
|
||||
#define need_GL_ARB_shader_objects
|
||||
#define need_GL_ARB_texture_compression
|
||||
#define need_GL_ARB_vertex_buffer_object
|
||||
#define need_GL_ARB_vertex_program
|
||||
#define need_GL_ARB_vertex_shader
|
||||
#define need_GL_ARB_window_pos
|
||||
#define need_GL_ARB_occlusion_query
|
||||
#define need_GL_EXT_blend_color
|
||||
#define need_GL_EXT_blend_equation_separate
|
||||
#define need_GL_EXT_blend_func_separate
|
||||
|
@ -84,14 +85,13 @@ int INTEL_DEBUG = (0);
|
|||
#define need_GL_EXT_fog_coord
|
||||
#define need_GL_EXT_framebuffer_object
|
||||
#define need_GL_EXT_multi_draw_arrays
|
||||
#define need_GL_EXT_secondary_color
|
||||
#define need_GL_NV_vertex_program
|
||||
#define need_GL_ATI_separate_stencil
|
||||
#define need_GL_EXT_point_parameters
|
||||
#define need_GL_EXT_secondary_color
|
||||
#define need_GL_ATI_separate_stencil
|
||||
#define need_GL_NV_point_sprite
|
||||
#define need_GL_NV_vertex_program
|
||||
#define need_GL_VERSION_2_0
|
||||
#define need_GL_VERSION_2_1
|
||||
#define need_GL_ARB_shader_objects
|
||||
#define need_GL_ARB_vertex_shader
|
||||
|
||||
#include "extension_helper.h"
|
||||
|
||||
|
@ -344,88 +344,78 @@ intel_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
|||
* i965_dri.
|
||||
*/
|
||||
static const struct dri_extension card_extensions[] = {
|
||||
{"GL_ARB_multisample", GL_ARB_multisample_functions},
|
||||
{"GL_ARB_multitexture", NULL},
|
||||
{"GL_ARB_point_parameters", GL_ARB_point_parameters_functions},
|
||||
{"GL_NV_point_sprite", GL_NV_point_sprite_functions},
|
||||
{"GL_ARB_texture_border_clamp", NULL},
|
||||
{"GL_ARB_texture_compression", GL_ARB_texture_compression_functions},
|
||||
{"GL_ARB_texture_cube_map", NULL},
|
||||
{"GL_ARB_texture_env_add", NULL},
|
||||
{"GL_ARB_texture_env_combine", NULL},
|
||||
{"GL_ARB_texture_env_crossbar", NULL},
|
||||
{"GL_ARB_texture_env_dot3", NULL},
|
||||
{"GL_ARB_texture_mirrored_repeat", NULL},
|
||||
{"GL_ARB_texture_non_power_of_two", NULL },
|
||||
{"GL_ARB_texture_rectangle", NULL},
|
||||
{"GL_NV_texture_rectangle", NULL},
|
||||
{"GL_EXT_texture_rectangle", NULL},
|
||||
{"GL_ARB_point_parameters", NULL},
|
||||
{"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions},
|
||||
{"GL_ARB_vertex_program", GL_ARB_vertex_program_functions},
|
||||
{"GL_ARB_window_pos", GL_ARB_window_pos_functions},
|
||||
{"GL_EXT_blend_color", GL_EXT_blend_color_functions},
|
||||
{"GL_EXT_blend_equation_separate",
|
||||
GL_EXT_blend_equation_separate_functions},
|
||||
{"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions},
|
||||
{"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions},
|
||||
{"GL_EXT_blend_logic_op", NULL},
|
||||
{"GL_EXT_blend_subtract", NULL},
|
||||
{"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions},
|
||||
{"GL_EXT_fog_coord", GL_EXT_fog_coord_functions},
|
||||
{"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions},
|
||||
{"GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions},
|
||||
#if 1 /* XXX FBO temporary? */
|
||||
{"GL_EXT_packed_depth_stencil", NULL},
|
||||
#endif
|
||||
{"GL_EXT_secondary_color", GL_EXT_secondary_color_functions},
|
||||
{"GL_EXT_stencil_wrap", NULL},
|
||||
{"GL_EXT_texture_edge_clamp", NULL},
|
||||
{"GL_EXT_texture_env_combine", NULL},
|
||||
{"GL_EXT_texture_env_dot3", NULL},
|
||||
{"GL_EXT_texture_filter_anisotropic", NULL},
|
||||
{"GL_EXT_texture_lod_bias", NULL},
|
||||
{"GL_3DFX_texture_compression_FXT1", NULL},
|
||||
{"GL_APPLE_client_storage", NULL},
|
||||
{"GL_MESA_pack_invert", NULL},
|
||||
{"GL_MESA_ycbcr_texture", NULL},
|
||||
{"GL_NV_blend_square", NULL},
|
||||
{"GL_NV_vertex_program", GL_NV_vertex_program_functions},
|
||||
{"GL_NV_vertex_program1_1", NULL},
|
||||
{ "GL_SGIS_generate_mipmap", NULL },
|
||||
{NULL, NULL}
|
||||
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
|
||||
{ "GL_ARB_multitexture", NULL },
|
||||
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
|
||||
{ "GL_ARB_texture_border_clamp", NULL },
|
||||
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
|
||||
{ "GL_ARB_texture_cube_map", NULL },
|
||||
{ "GL_ARB_texture_env_add", NULL },
|
||||
{ "GL_ARB_texture_env_combine", NULL },
|
||||
{ "GL_ARB_texture_env_crossbar", NULL },
|
||||
{ "GL_ARB_texture_env_dot3", NULL },
|
||||
{ "GL_ARB_texture_mirrored_repeat", NULL },
|
||||
{ "GL_ARB_texture_rectangle", NULL },
|
||||
{ "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
|
||||
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
|
||||
{ "GL_ARB_window_pos", GL_ARB_window_pos_functions },
|
||||
{ "GL_EXT_blend_color", GL_EXT_blend_color_functions },
|
||||
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
|
||||
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
|
||||
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
|
||||
{ "GL_EXT_blend_logic_op", NULL },
|
||||
{ "GL_EXT_blend_subtract", NULL },
|
||||
{ "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions },
|
||||
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
|
||||
{ "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
|
||||
{ "GL_EXT_packed_depth_stencil", NULL },
|
||||
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
|
||||
{ "GL_EXT_stencil_wrap", NULL },
|
||||
{ "GL_EXT_texture_edge_clamp", NULL },
|
||||
{ "GL_EXT_texture_env_combine", NULL },
|
||||
{ "GL_EXT_texture_env_dot3", NULL },
|
||||
{ "GL_EXT_texture_filter_anisotropic", NULL },
|
||||
{ "GL_EXT_texture_lod_bias", NULL },
|
||||
{ "GL_3DFX_texture_compression_FXT1", NULL },
|
||||
{ "GL_APPLE_client_storage", NULL },
|
||||
{ "GL_MESA_pack_invert", NULL },
|
||||
{ "GL_MESA_ycbcr_texture", NULL },
|
||||
{ "GL_NV_blend_square", NULL },
|
||||
{ "GL_NV_point_sprite", GL_NV_point_sprite_functions },
|
||||
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
|
||||
{ "GL_NV_vertex_program1_1", NULL },
|
||||
{ "GL_SGIS_generate_mipmap", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
static const struct dri_extension brw_extensions[] = {
|
||||
{ "GL_ARB_shading_language_100", GL_VERSION_2_0_functions},
|
||||
{ "GL_ARB_shading_language_120", GL_VERSION_2_1_functions},
|
||||
{ "GL_ARB_shader_objects", GL_ARB_shader_objects_functions},
|
||||
{ "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions},
|
||||
{ "GL_ARB_point_sprite", NULL},
|
||||
{ "GL_ARB_fragment_shader", NULL },
|
||||
{ "GL_ARB_draw_buffers", NULL },
|
||||
{ "GL_ARB_depth_texture", NULL },
|
||||
{ "GL_ARB_draw_buffers", NULL },
|
||||
{ "GL_ARB_fragment_program", NULL },
|
||||
{ "GL_ARB_shadow", NULL },
|
||||
{ "GL_EXT_shadow_funcs", NULL },
|
||||
{ "GL_ARB_fragment_program_shadow", NULL },
|
||||
/* ARB extn won't work if not enabled */
|
||||
{ "GL_SGIX_depth_texture", NULL },
|
||||
{ "GL_EXT_texture_sRGB", NULL},
|
||||
{ "GL_ARB_fragment_shader", NULL },
|
||||
{ "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions },
|
||||
{ "GL_ARB_point_sprite", NULL },
|
||||
{ "GL_ARB_shader_objects", GL_ARB_shader_objects_functions },
|
||||
{ "GL_ARB_shading_language_100", GL_VERSION_2_0_functions },
|
||||
{ "GL_ARB_shading_language_120", GL_VERSION_2_1_functions },
|
||||
{ "GL_ARB_shadow", NULL },
|
||||
{ "GL_ARB_texture_non_power_of_two", NULL },
|
||||
{ "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions },
|
||||
{ "GL_EXT_shadow_funcs", NULL },
|
||||
{ "GL_EXT_texture_sRGB", NULL },
|
||||
{ "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
#ifdef I915_MMIO_READ
|
||||
static const struct dri_extension arb_oc_extensions[] = {
|
||||
{"GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions},
|
||||
{NULL, NULL}
|
||||
static const struct dri_extension arb_oq_extensions[] = {
|
||||
{ NULL, NULL }
|
||||
};
|
||||
#endif
|
||||
|
||||
static const struct dri_extension ttm_extensions[] = {
|
||||
{"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions},
|
||||
{"GL_ARB_pixel_buffer_object", NULL},
|
||||
{NULL, NULL}
|
||||
{ "GL_ARB_pixel_buffer_object", NULL },
|
||||
{ "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -445,13 +435,6 @@ void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging)
|
|||
if (intel == NULL || intel->ttm)
|
||||
driInitExtensions(ctx, ttm_extensions, GL_FALSE);
|
||||
|
||||
#ifdef I915_MMIO_READ
|
||||
if (intel == NULL ||
|
||||
(IS_965(intel->intelScreen->deviceID) &&
|
||||
intel->intelScreen->drmMinor >= 8))
|
||||
driInitExtensions(ctx, arb_oc_extensions, GL_FALSE);
|
||||
#endif
|
||||
|
||||
if (intel == NULL || IS_965(intel->intelScreen->deviceID))
|
||||
driInitExtensions(ctx, brw_extensions, GL_FALSE);
|
||||
}
|
||||
|
@ -548,39 +531,6 @@ intelFinish(GLcontext * ctx)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef I915_MMIO_READ
|
||||
static void
|
||||
intelBeginQuery(GLcontext *ctx, struct gl_query_object *q)
|
||||
{
|
||||
struct intel_context *intel = intel_context( ctx );
|
||||
struct drm_i915_mmio io = {
|
||||
.read_write = I915_MMIO_READ,
|
||||
.reg = MMIO_REGS_PS_DEPTH_COUNT,
|
||||
.data = &q->Result
|
||||
};
|
||||
intel->stats_wm++;
|
||||
intelFinish(&intel->ctx);
|
||||
drmCommandWrite(intel->driFd, DRM_I915_MMIO, &io, sizeof(io));
|
||||
}
|
||||
|
||||
static void
|
||||
intelEndQuery(GLcontext *ctx, struct gl_query_object *q)
|
||||
{
|
||||
struct intel_context *intel = intel_context( ctx );
|
||||
GLuint64EXT tmp;
|
||||
struct drm_i915_mmio io = {
|
||||
.read_write = I915_MMIO_READ,
|
||||
.reg = MMIO_REGS_PS_DEPTH_COUNT,
|
||||
.data = &tmp
|
||||
};
|
||||
intelFinish(&intel->ctx);
|
||||
drmCommandWrite(intel->driFd, DRM_I915_MMIO, &io, sizeof(io));
|
||||
q->Result = tmp - q->Result;
|
||||
q->Ready = GL_TRUE;
|
||||
intel->stats_wm--;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
intelInitDriverFunctions(struct dd_function_table *functions)
|
||||
{
|
||||
|
@ -597,11 +547,6 @@ intelInitDriverFunctions(struct dd_function_table *functions)
|
|||
functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
|
||||
functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
|
||||
|
||||
#ifdef I915_MMIO_READ
|
||||
functions->BeginQuery = intelBeginQuery;
|
||||
functions->EndQuery = intelEndQuery;
|
||||
#endif
|
||||
|
||||
intelInitTextureFuncs(functions);
|
||||
intelInitStateFuncs(functions);
|
||||
intelInitBufferFuncs(functions);
|
||||
|
@ -810,7 +755,12 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
|
|||
intel->Fallback = 0; /* don't call _swrast_Flush later */
|
||||
|
||||
intel_batchbuffer_free(intel->batch);
|
||||
intel->batch = NULL;
|
||||
|
||||
free(intel->prim.vb);
|
||||
intel->prim.vb = NULL;
|
||||
dri_bo_unreference(intel->prim.vb_bo);
|
||||
intel->prim.vb_bo = NULL;
|
||||
|
||||
if (release_texture_heaps) {
|
||||
/* This share group is about to go away, free our private
|
||||
|
@ -820,6 +770,13 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
|
|||
fprintf(stderr, "do something to free texture heaps\n");
|
||||
}
|
||||
|
||||
intel_region_release(&intel->front_region);
|
||||
intel_region_release(&intel->back_region);
|
||||
intel_region_release(&intel->third_region);
|
||||
intel_region_release(&intel->depth_region);
|
||||
|
||||
driDestroyOptionCache(&intel->optionCache);
|
||||
|
||||
/* free the Mesa context */
|
||||
_mesa_free_context_data(&intel->ctx);
|
||||
}
|
||||
|
|
|
@ -226,7 +226,6 @@ struct intel_context
|
|||
GLenum reduced_primitive;
|
||||
GLuint vertex_size;
|
||||
GLubyte *verts; /* points to tnl->clipspace.vertex_buf */
|
||||
struct intel_region *draw_region;
|
||||
|
||||
/* Fallback rasterization functions
|
||||
*/
|
||||
|
|
|
@ -181,9 +181,9 @@ intelInitPixelFuncs(struct dd_function_table *functions)
|
|||
if (!getenv("INTEL_NO_BLIT")) {
|
||||
functions->Bitmap = intelBitmap;
|
||||
functions->CopyPixels = intelCopyPixels;
|
||||
functions->DrawPixels = intelDrawPixels;
|
||||
#ifdef I915
|
||||
functions->ReadPixels = intelReadPixels;
|
||||
functions->DrawPixels = intelDrawPixels;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
#include "intel_regions.h"
|
||||
#include "intel_pixel.h"
|
||||
#include "intel_buffer_objects.h"
|
||||
#include "intel_tris.h"
|
||||
|
||||
|
||||
static GLboolean
|
||||
|
|
|
@ -44,6 +44,25 @@
|
|||
#define _3DSTATE_LOAD_STATE_IMMEDIATE_1 (CMD_3D | (0x1d<<24) | (0x04<<16))
|
||||
#define I1_LOAD_S(n) (1<<(4+n))
|
||||
|
||||
/** @{
|
||||
*
|
||||
* PIPE_CONTROL operation, a combination MI_FLUSH and register write with
|
||||
* additional flushing control.
|
||||
*/
|
||||
#define _3DSTATE_PIPE_CONTROL (CMD_3D | (3 << 27) | (2 << 24) | 2)
|
||||
#define PIPE_CONTROL_NO_WRITE (0 << 14)
|
||||
#define PIPE_CONTROL_WRITE_IMMEDIATE (1 << 14)
|
||||
#define PIPE_CONTROL_WRITE_DEPTH_COUNT (2 << 14)
|
||||
#define PIPE_CONTROL_WRITE_TIMESTAMP (3 << 14)
|
||||
#define PIPE_CONTROL_DEPTH_STALL (1 << 13)
|
||||
#define PIPE_CONTROL_WRITE_FLUSH (1 << 12)
|
||||
#define PIPE_CONTROL_INSTRUCTION_FLUSH (1 << 11)
|
||||
#define PIPE_CONTROL_INTERRUPT_ENABLE (1 << 8)
|
||||
#define PIPE_CONTROL_PPGTT_WRITE (0 << 2)
|
||||
#define PIPE_CONTROL_GLOBAL_GTT_WRITE (1 << 2)
|
||||
|
||||
/** @} */
|
||||
|
||||
/** @{
|
||||
* 915 definitions
|
||||
*/
|
||||
|
|
|
@ -478,6 +478,11 @@ intel_recreate_static(struct intel_context *intel,
|
|||
region->pitch = intelScreen->pitch;
|
||||
region->height = intelScreen->height; /* needed? */
|
||||
|
||||
if (region->buffer != NULL) {
|
||||
dri_bo_unreference(region->buffer);
|
||||
region->buffer = NULL;
|
||||
}
|
||||
|
||||
if (intel->ttm) {
|
||||
assert(region_desc->bo_handle != -1);
|
||||
region->buffer = intel_bo_gem_create_from_name(intel->bufmgr,
|
||||
|
@ -486,6 +491,11 @@ intel_recreate_static(struct intel_context *intel,
|
|||
|
||||
intel_set_region_tiling_gem(intel, region, region_desc->bo_handle);
|
||||
} else {
|
||||
if (region->classic_map != NULL) {
|
||||
drmUnmap(region->classic_map,
|
||||
region->pitch * region->cpp * region->height);
|
||||
region->classic_map = NULL;
|
||||
}
|
||||
ret = drmMap(intel->driFd, region_desc->handle,
|
||||
region->pitch * region->cpp * region->height,
|
||||
®ion->classic_map);
|
||||
|
|
|
@ -60,7 +60,7 @@ get_teximage_source(struct intel_context *intel, GLenum internalFormat)
|
|||
|
||||
switch (internalFormat) {
|
||||
case GL_DEPTH_COMPONENT:
|
||||
case GL_DEPTH_COMPONENT16_ARB:
|
||||
case GL_DEPTH_COMPONENT16:
|
||||
irb = intel_get_renderbuffer(intel->ctx.ReadBuffer, BUFFER_DEPTH);
|
||||
if (irb && irb->region && irb->region->cpp == 2)
|
||||
return irb->region;
|
||||
|
|
|
@ -141,10 +141,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
|
|||
|
||||
/* Fallback case:
|
||||
*/
|
||||
if (firstImage->base.Border ||
|
||||
((firstImage->base._BaseFormat == GL_DEPTH_COMPONENT) &&
|
||||
((tObj->WrapS == GL_CLAMP_TO_BORDER) ||
|
||||
(tObj->WrapT == GL_CLAMP_TO_BORDER)))) {
|
||||
if (firstImage->base.Border) {
|
||||
if (intelObj->mt) {
|
||||
intel_miptree_release(intel, &intelObj->mt);
|
||||
}
|
||||
|
|
|
@ -138,7 +138,6 @@ const struct dri_extension card_extensions[] = {
|
|||
{"GL_NV_blend_square", NULL},
|
||||
{"GL_NV_vertex_program", GL_NV_vertex_program_functions},
|
||||
{"GL_SGIS_generate_mipmap", NULL},
|
||||
{"GL_SGIX_depth_texture", NULL},
|
||||
{NULL, NULL}
|
||||
/* *INDENT-ON* */
|
||||
};
|
||||
|
|
|
@ -294,7 +294,31 @@ _glapi_get_context(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef USE_X86_ASM
|
||||
|
||||
#if defined( GLX_USE_TLS )
|
||||
extern GLubyte gl_dispatch_functions_start[];
|
||||
extern GLubyte gl_dispatch_functions_end[];
|
||||
#else
|
||||
extern const GLubyte gl_dispatch_functions_start[];
|
||||
#endif
|
||||
|
||||
#endif /* USE_X86_ASM */
|
||||
|
||||
|
||||
#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS)
|
||||
# define DISPATCH_FUNCTION_SIZE 16
|
||||
#elif defined(USE_X86_ASM)
|
||||
# if defined(THREADS) && !defined(GLX_USE_TLS)
|
||||
# define DISPATCH_FUNCTION_SIZE 32
|
||||
# else
|
||||
# define DISPATCH_FUNCTION_SIZE 16
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer)
|
||||
# define NEED_FUNCTION_POINTER
|
||||
#endif
|
||||
|
||||
#if defined(PTHREADS) || defined(GLX_USE_TLS)
|
||||
/**
|
||||
|
|
|
@ -282,8 +282,8 @@ _mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx,
|
|||
z24rb->RefCount = 1;
|
||||
z24rb->Width = dsrb->Width;
|
||||
z24rb->Height = dsrb->Height;
|
||||
z24rb->InternalFormat = GL_DEPTH_COMPONENT24_ARB;
|
||||
z24rb->_ActualFormat = GL_DEPTH_COMPONENT24_ARB;
|
||||
z24rb->InternalFormat = GL_DEPTH_COMPONENT24;
|
||||
z24rb->_ActualFormat = GL_DEPTH_COMPONENT24;
|
||||
z24rb->_BaseFormat = GL_DEPTH_COMPONENT;
|
||||
z24rb->DataType = GL_UNSIGNED_INT;
|
||||
z24rb->DepthBits = 24;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Makefile for core library for VMS
|
||||
# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
|
||||
# Last revision : 2 October 2007
|
||||
# Last revision : 29 September 2008
|
||||
|
||||
.first
|
||||
define gl [---.include.gl]
|
||||
|
@ -21,6 +21,7 @@ CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ie
|
|||
|
||||
SOURCES =accum.c \
|
||||
api_arrayelt.c \
|
||||
api_exec.c \
|
||||
api_loopback.c \
|
||||
api_noop.c \
|
||||
api_validate.c \
|
||||
|
@ -29,6 +30,7 @@ SOURCES =accum.c \
|
|||
blend.c \
|
||||
bufferobj.c \
|
||||
buffers.c \
|
||||
clear.c \
|
||||
clip.c \
|
||||
colortab.c \
|
||||
context.c \
|
||||
|
@ -46,6 +48,7 @@ SOURCES =accum.c \
|
|||
extensions.c \
|
||||
fbobject.c \
|
||||
feedback.c \
|
||||
ffvertex_prog.c \
|
||||
fog.c \
|
||||
framebuffer.c \
|
||||
get.c \
|
||||
|
@ -60,22 +63,29 @@ SOURCES =accum.c \
|
|||
matrix.c \
|
||||
mipmap.c \
|
||||
mm.c \
|
||||
multisample.c \
|
||||
pixel.c \
|
||||
pixelstore.c \
|
||||
points.c \
|
||||
polygon.c \
|
||||
rastpos.c \
|
||||
rbadaptors.c \
|
||||
readpix.c \
|
||||
renderbuffer.c \
|
||||
scissor.c \
|
||||
shaders.c \
|
||||
state.c \
|
||||
stencil.c \
|
||||
texcompress.c \
|
||||
texcompress_fxt1.c \
|
||||
texcompress_s3tc.c \
|
||||
texenv.c \
|
||||
texenvprogram.c \
|
||||
texformat.c \
|
||||
texgen.c \
|
||||
teximage.c \
|
||||
texobj.c \
|
||||
texparam.c \
|
||||
texrender.c \
|
||||
texstate.c \
|
||||
texstore.c \
|
||||
|
@ -86,6 +96,7 @@ SOURCES =accum.c \
|
|||
|
||||
OBJECTS=accum.obj,\
|
||||
api_arrayelt.obj,\
|
||||
api_exec.obj,\
|
||||
api_loopback.obj,\
|
||||
api_noop.obj,\
|
||||
api_validate.obj,\
|
||||
|
@ -94,6 +105,7 @@ attrib.obj,\
|
|||
blend.obj,\
|
||||
bufferobj.obj,\
|
||||
buffers.obj,\
|
||||
clear.obj,\
|
||||
clip.obj,\
|
||||
colortab.obj,\
|
||||
context.obj,\
|
||||
|
@ -111,6 +123,7 @@ execmem.obj,\
|
|||
extensions.obj,\
|
||||
fbobject.obj,\
|
||||
feedback.obj,\
|
||||
ffvertex_prog.obj,\
|
||||
fog.obj,\
|
||||
framebuffer.obj,\
|
||||
get.obj,\
|
||||
|
@ -125,21 +138,28 @@ lines.obj,\
|
|||
matrix.obj,\
|
||||
mipmap.obj,\
|
||||
mm.obj,\
|
||||
multisample.obj,\
|
||||
pixel.obj,\
|
||||
pixelstore.obj,\
|
||||
points.obj,\
|
||||
polygon.obj,\
|
||||
rastpos.obj,\
|
||||
readpix.obj,\
|
||||
renderbuffer.obj,\
|
||||
scissor.obj,\
|
||||
shaders.obj,\
|
||||
state.obj,\
|
||||
stencil.obj,\
|
||||
texcompress.obj,\
|
||||
texcompress_fxt1.obj,\
|
||||
texcompress_s3tc.obj,\
|
||||
texenv.obj,\
|
||||
texenvprogram.obj,\
|
||||
texformat.obj,\
|
||||
texgen.obj,\
|
||||
teximage.obj,\
|
||||
texobj.obj,\
|
||||
texparam.obj,\
|
||||
texrender.obj,\
|
||||
texstate.obj,\
|
||||
texstore.obj,\
|
||||
|
@ -226,3 +246,13 @@ vtxfmt.obj : vtxfmt.c
|
|||
shaders.obj : shaders.c
|
||||
queryobj.obj : queryobj.c
|
||||
rbadaptors.obj : rbadaptors.c
|
||||
clear.obj : clear.c
|
||||
multisample.obj : multisample.c
|
||||
scissor.obj : scissor.c
|
||||
texenv.obj : texenv.c
|
||||
texgen.obj : texgen.c
|
||||
texparam.obj : texparam.c
|
||||
readpix.obj : readpix.c
|
||||
ffvertex_prog.obj : ffvertex_prog.c
|
||||
api_exec.obj : api_exec.c
|
||||
pixelstore.obj : pixelstore.c
|
||||
|
|
|
@ -165,7 +165,7 @@ static const struct {
|
|||
{ OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) },
|
||||
{ ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) },
|
||||
{ ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) },
|
||||
{ OFF, "GL_SGIX_depth_texture", F(SGIX_depth_texture) },
|
||||
{ OFF, "GL_SGIX_depth_texture", F(ARB_depth_texture) },
|
||||
{ OFF, "GL_SGIX_shadow", F(SGIX_shadow) },
|
||||
{ OFF, "GL_SGIX_shadow_ambient", F(SGIX_shadow_ambient) },
|
||||
{ OFF, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) },
|
||||
|
@ -292,7 +292,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
|
|||
ctx->Extensions.SGI_texture_color_table = GL_TRUE;
|
||||
ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;
|
||||
ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE;
|
||||
ctx->Extensions.SGIX_depth_texture = GL_TRUE;
|
||||
ctx->Extensions.SGIX_shadow = GL_TRUE;
|
||||
ctx->Extensions.SGIX_shadow_ambient = GL_TRUE;
|
||||
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
|
||||
|
|
|
@ -178,12 +178,12 @@ static GLboolean check_active_shininess( GLcontext *ctx,
|
|||
|
||||
|
||||
|
||||
static struct state_key *make_state_key( GLcontext *ctx )
|
||||
static void make_state_key( GLcontext *ctx, struct state_key *key )
|
||||
{
|
||||
const struct gl_fragment_program *fp;
|
||||
struct state_key *key = CALLOC_STRUCT(state_key);
|
||||
GLuint i;
|
||||
|
||||
memset(key, 0, sizeof(struct state_key));
|
||||
fp = ctx->FragmentProgram._Current;
|
||||
|
||||
/* This now relies on texenvprogram.c being active:
|
||||
|
@ -301,8 +301,6 @@ static struct state_key *make_state_key( GLcontext *ctx )
|
|||
texUnit->GenModeQ );
|
||||
}
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1714,16 +1712,16 @@ struct gl_vertex_program *
|
|||
_mesa_get_fixed_func_vertex_program(GLcontext *ctx)
|
||||
{
|
||||
struct gl_vertex_program *prog;
|
||||
struct state_key *key;
|
||||
struct state_key key;
|
||||
|
||||
/* Grab all the relevent state and put it in a single structure:
|
||||
*/
|
||||
key = make_state_key(ctx);
|
||||
make_state_key(ctx, &key);
|
||||
|
||||
/* Look for an already-prepared program for this state:
|
||||
*/
|
||||
prog = (struct gl_vertex_program *)
|
||||
_mesa_search_program_cache(ctx->VertexProgram.Cache, key, sizeof(*key));
|
||||
_mesa_search_program_cache(ctx->VertexProgram.Cache, &key, sizeof(key));
|
||||
|
||||
if (!prog) {
|
||||
/* OK, we'll have to build a new one */
|
||||
|
@ -1735,7 +1733,7 @@ _mesa_get_fixed_func_vertex_program(GLcontext *ctx)
|
|||
if (!prog)
|
||||
return NULL;
|
||||
|
||||
create_new_program( key, prog,
|
||||
create_new_program( &key, prog,
|
||||
ctx->Const.VertexProgram.MaxTemps );
|
||||
|
||||
#if 0
|
||||
|
@ -1744,10 +1742,8 @@ _mesa_get_fixed_func_vertex_program(GLcontext *ctx)
|
|||
&prog->Base );
|
||||
#endif
|
||||
_mesa_program_cache_insert(ctx, ctx->VertexProgram.Cache,
|
||||
key, sizeof(*key), &prog->Base);
|
||||
&key, sizeof(key), &prog->Base);
|
||||
}
|
||||
|
||||
_mesa_free(key);
|
||||
|
||||
return prog;
|
||||
}
|
||||
|
|
|
@ -2628,7 +2628,6 @@ struct gl_extensions
|
|||
GLboolean SGIS_generate_mipmap;
|
||||
GLboolean SGIS_texture_edge_clamp;
|
||||
GLboolean SGIS_texture_lod;
|
||||
GLboolean SGIX_depth_texture;
|
||||
GLboolean SGIX_shadow;
|
||||
GLboolean SGIX_shadow_ambient; /* or GL_ARB_shadow_ambient */
|
||||
GLboolean TDFX_texture_compression_FXT1;
|
||||
|
|
|
@ -90,9 +90,8 @@ _mesa_wait_query(GLcontext *ctx, struct gl_query_object *q)
|
|||
|
||||
|
||||
/**
|
||||
* Delete an occlusion query object.
|
||||
* Delete a query object. Called via ctx->Driver.DeleteQuery().
|
||||
* Not removed from hash table here.
|
||||
* XXX maybe add Delete() method to gl_query_object class and call that instead
|
||||
*/
|
||||
void
|
||||
_mesa_delete_query(GLcontext *ctx, struct gl_query_object *q)
|
||||
|
@ -546,6 +545,6 @@ delete_queryobj_cb(GLuint id, void *data, void *userData)
|
|||
void
|
||||
_mesa_free_query_data(GLcontext *ctx)
|
||||
{
|
||||
_mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, NULL);
|
||||
_mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx);
|
||||
_mesa_DeleteHashTable(ctx->Query.QueryObjects);
|
||||
}
|
||||
|
|
|
@ -233,10 +233,18 @@ _mesa_GetObjectParameterivARB(GLhandleARB object, GLenum pname, GLint *params)
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
/* Implement in terms of GetProgramiv, GetShaderiv */
|
||||
if (ctx->Driver.IsProgram(ctx, object)) {
|
||||
ctx->Driver.GetProgramiv(ctx, object, pname, params);
|
||||
if (pname == GL_OBJECT_TYPE_ARB) {
|
||||
*params = GL_PROGRAM_OBJECT_ARB;
|
||||
} else {
|
||||
ctx->Driver.GetProgramiv(ctx, object, pname, params);
|
||||
}
|
||||
}
|
||||
else if (ctx->Driver.IsShader(ctx, object)) {
|
||||
ctx->Driver.GetShaderiv(ctx, object, pname, params);
|
||||
if (pname == GL_OBJECT_TYPE_ARB) {
|
||||
*params = GL_SHADER_OBJECT_ARB;
|
||||
} else {
|
||||
ctx->Driver.GetShaderiv(ctx, object, pname, params);
|
||||
}
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
|
||||
|
|
|
@ -258,12 +258,6 @@ update_program(GLcontext *ctx)
|
|||
}
|
||||
}
|
||||
|
||||
if (ctx->VertexProgram._Current)
|
||||
assert(ctx->VertexProgram._Current->Base.Parameters);
|
||||
if (ctx->FragmentProgram._Current)
|
||||
assert(ctx->FragmentProgram._Current->Base.Parameters);
|
||||
|
||||
|
||||
/* XXX: get rid of _Active flag.
|
||||
*/
|
||||
#if 1
|
||||
|
|
|
@ -1420,14 +1420,13 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
|
|||
; /* fallthrough */
|
||||
}
|
||||
|
||||
if (ctx->Extensions.SGIX_depth_texture ||
|
||||
ctx->Extensions.ARB_depth_texture) {
|
||||
if (ctx->Extensions.ARB_depth_texture) {
|
||||
switch (internalFormat) {
|
||||
case GL_DEPTH_COMPONENT:
|
||||
case GL_DEPTH_COMPONENT24_SGIX:
|
||||
case GL_DEPTH_COMPONENT32_SGIX:
|
||||
case GL_DEPTH_COMPONENT24:
|
||||
case GL_DEPTH_COMPONENT32:
|
||||
return &_mesa_texformat_z32;
|
||||
case GL_DEPTH_COMPONENT16_SGIX:
|
||||
case GL_DEPTH_COMPONENT16:
|
||||
return &_mesa_texformat_z16;
|
||||
default:
|
||||
; /* fallthrough */
|
||||
|
|
|
@ -241,13 +241,12 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat )
|
|||
}
|
||||
}
|
||||
|
||||
if (ctx->Extensions.SGIX_depth_texture ||
|
||||
ctx->Extensions.ARB_depth_texture) {
|
||||
if (ctx->Extensions.ARB_depth_texture) {
|
||||
switch (internalFormat) {
|
||||
case GL_DEPTH_COMPONENT:
|
||||
case GL_DEPTH_COMPONENT16_SGIX:
|
||||
case GL_DEPTH_COMPONENT24_SGIX:
|
||||
case GL_DEPTH_COMPONENT32_SGIX:
|
||||
case GL_DEPTH_COMPONENT16:
|
||||
case GL_DEPTH_COMPONENT24:
|
||||
case GL_DEPTH_COMPONENT32:
|
||||
return GL_DEPTH_COMPONENT;
|
||||
default:
|
||||
; /* fallthrough */
|
||||
|
@ -526,9 +525,9 @@ static GLboolean
|
|||
is_depth_format(GLenum format)
|
||||
{
|
||||
switch (format) {
|
||||
case GL_DEPTH_COMPONENT16_ARB:
|
||||
case GL_DEPTH_COMPONENT24_ARB:
|
||||
case GL_DEPTH_COMPONENT32_ARB:
|
||||
case GL_DEPTH_COMPONENT16:
|
||||
case GL_DEPTH_COMPONENT24:
|
||||
case GL_DEPTH_COMPONENT32:
|
||||
case GL_DEPTH_COMPONENT:
|
||||
return GL_TRUE;
|
||||
default:
|
||||
|
@ -2308,8 +2307,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
|
|||
return;
|
||||
}
|
||||
|
||||
if (!ctx->Extensions.SGIX_depth_texture &&
|
||||
!ctx->Extensions.ARB_depth_texture && is_depth_format(format)) {
|
||||
if (!ctx->Extensions.ARB_depth_texture && is_depth_format(format)) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -642,8 +642,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
|
|||
*params = 0;
|
||||
break;
|
||||
case GL_TEXTURE_DEPTH_SIZE_ARB:
|
||||
if (ctx->Extensions.SGIX_depth_texture ||
|
||||
ctx->Extensions.ARB_depth_texture)
|
||||
if (ctx->Extensions.ARB_depth_texture)
|
||||
*params = img->TexFormat->DepthBits;
|
||||
else
|
||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||
|
@ -903,9 +902,9 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
|
|||
#ifdef FEATURE_OES_draw_texture
|
||||
case GL_TEXTURE_CROP_RECT_OES:
|
||||
params[0] = obj->CropRect[0];
|
||||
params[0] = obj->CropRect[1];
|
||||
params[0] = obj->CropRect[2];
|
||||
params[0] = obj->CropRect[3];
|
||||
params[1] = obj->CropRect[1];
|
||||
params[2] = obj->CropRect[2];
|
||||
params[3] = obj->CropRect[3];
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
@ -1053,9 +1052,9 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
|
|||
#ifdef FEATURE_OES_draw_texture
|
||||
case GL_TEXTURE_CROP_RECT_OES:
|
||||
params[0] = obj->CropRect[0];
|
||||
params[0] = obj->CropRect[1];
|
||||
params[0] = obj->CropRect[2];
|
||||
params[0] = obj->CropRect[3];
|
||||
params[1] = obj->CropRect[1];
|
||||
params[2] = obj->CropRect[2];
|
||||
params[3] = obj->CropRect[3];
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
|
|
@ -3895,6 +3895,9 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target,
|
|||
program->FogOption = ap.FogOption;
|
||||
program->UsesKill = ap.UsesKill;
|
||||
|
||||
if (program->FogOption)
|
||||
program->Base.InputsRead |= FRAG_BIT_FOGC;
|
||||
|
||||
if (program->Base.Instructions)
|
||||
_mesa_free(program->Base.Instructions);
|
||||
program->Base.Instructions = ap.Base.Instructions;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Makefile for core library for VMS
|
||||
# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
|
||||
# Last revision : 27 May 2008
|
||||
# Last revision : 29 September 2008
|
||||
.first
|
||||
define gl [---.include.gl]
|
||||
define math [-.math]
|
||||
|
@ -34,6 +34,7 @@ SOURCES = \
|
|||
prog_instruction.c \
|
||||
prog_parameter.c \
|
||||
prog_print.c \
|
||||
prog_cache.c \
|
||||
prog_statevars.c \
|
||||
shader_api.c prog_uniform.c
|
||||
|
||||
|
@ -52,7 +53,7 @@ OBJECTS = \
|
|||
prog_parameter.obj,\
|
||||
prog_print.obj,\
|
||||
prog_statevars.obj,\
|
||||
shader_api.obj,prog_uniform.obj
|
||||
shader_api.obj,prog_uniform.obj,prog_cache.obj
|
||||
|
||||
##### RULES #####
|
||||
|
||||
|
@ -91,3 +92,4 @@ prog_print.obj : prog_print.c
|
|||
prog_statevars.obj : prog_statevars.c
|
||||
shader_api.obj : shader_api.c
|
||||
prog_uniform.obj : prog_uniform.c
|
||||
prog_cache.obj : prog_cache.c
|
||||
|
|
|
@ -372,7 +372,11 @@ _mesa_reference_program(GLcontext *ctx,
|
|||
assert(ptr);
|
||||
if (*ptr && prog) {
|
||||
/* sanity check */
|
||||
ASSERT((*ptr)->Target == prog->Target);
|
||||
if ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB)
|
||||
ASSERT(prog->Target == GL_VERTEX_PROGRAM_ARB);
|
||||
else if ((*ptr)->Target == GL_FRAGMENT_PROGRAM_ARB)
|
||||
ASSERT(prog->Target == GL_FRAGMENT_PROGRAM_ARB ||
|
||||
prog->Target == GL_FRAGMENT_PROGRAM_NV);
|
||||
}
|
||||
if (*ptr == prog) {
|
||||
return; /* no change */
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "shader/shader_api.h"
|
||||
#include "shader/slang/slang_compile.h"
|
||||
#include "shader/slang/slang_link.h"
|
||||
|
||||
#include "glapi/dispatch.h"
|
||||
|
||||
|
||||
#ifndef GL_PROGRAM_BINARY_LENGTH_OES
|
||||
|
@ -455,7 +455,13 @@ _mesa_attach_shader(GLcontext *ctx, GLuint program, GLuint shader)
|
|||
n = shProg->NumShaders;
|
||||
for (i = 0; i < n; i++) {
|
||||
if (shProg->Shaders[i] == sh) {
|
||||
/* already attached */
|
||||
/* The shader is already attched to this program. The
|
||||
* GL_ARB_shader_objects spec says:
|
||||
*
|
||||
* "The error INVALID_OPERATION is generated by AttachObjectARB
|
||||
* if <obj> is already attached to <containerObj>."
|
||||
*/
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glAttachShader");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -919,24 +925,15 @@ _mesa_get_attached_shaders(GLcontext *ctx, GLuint program, GLsizei maxCount,
|
|||
static GLuint
|
||||
_mesa_get_handle(GLcontext *ctx, GLenum pname)
|
||||
{
|
||||
#if 0
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
switch (pname) {
|
||||
case GL_PROGRAM_OBJECT_ARB:
|
||||
{
|
||||
struct gl2_program_intf **pro = ctx->Shader.CurrentProgram;
|
||||
|
||||
if (pro != NULL)
|
||||
return (**pro)._container._generic.
|
||||
GetName((struct gl2_generic_intf **) (pro));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
GLint handle = 0;
|
||||
|
||||
if (pname == GL_PROGRAM_OBJECT_ARB) {
|
||||
CALL_GetIntegerv(ctx->Exec, (GL_CURRENT_PROGRAM, &handle));
|
||||
} else {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetHandleARB");
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5.1
|
||||
* Version: 7.2.1
|
||||
*
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
@ -534,15 +534,15 @@ depth_test_span( GLcontext *ctx, SWspan *span)
|
|||
if (rb->DataType == GL_UNSIGNED_SHORT) {
|
||||
GLushort zbuffer[MAX_WIDTH];
|
||||
rb->GetRow(ctx, rb, count, x, y, zbuffer);
|
||||
passed = depth_test_span16(ctx, count, zbuffer, zValues, mask );
|
||||
rb->PutRow(ctx, rb, count, x, y, zbuffer, NULL);
|
||||
passed = depth_test_span16(ctx, count, zbuffer, zValues, mask);
|
||||
rb->PutRow(ctx, rb, count, x, y, zbuffer, mask);
|
||||
}
|
||||
else {
|
||||
GLuint zbuffer[MAX_WIDTH];
|
||||
ASSERT(rb->DataType == GL_UNSIGNED_INT);
|
||||
rb->GetRow(ctx, rb, count, x, y, zbuffer);
|
||||
passed = depth_test_span32(ctx, count, zbuffer, zValues, mask );
|
||||
rb->PutRow(ctx, rb, count, x, y, zbuffer, NULL);
|
||||
passed = depth_test_span32(ctx, count, zbuffer, zValues, mask);
|
||||
rb->PutRow(ctx, rb, count, x, y, zbuffer, mask);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1080,15 +1080,15 @@ depth_test_pixels( GLcontext *ctx, SWspan *span )
|
|||
if (rb->DataType == GL_UNSIGNED_SHORT) {
|
||||
GLushort zbuffer[MAX_WIDTH];
|
||||
_swrast_get_values(ctx, rb, count, x, y, zbuffer, sizeof(GLushort));
|
||||
depth_test_span16(ctx, count, zbuffer, z, mask );
|
||||
rb->PutValues(ctx, rb, count, x, y, zbuffer, NULL);
|
||||
depth_test_span16(ctx, count, zbuffer, z, mask);
|
||||
rb->PutValues(ctx, rb, count, x, y, zbuffer, mask);
|
||||
}
|
||||
else {
|
||||
GLuint zbuffer[MAX_WIDTH];
|
||||
ASSERT(rb->DataType == GL_UNSIGNED_INT);
|
||||
_swrast_get_values(ctx, rb, count, x, y, zbuffer, sizeof(GLuint));
|
||||
depth_test_span32(ctx, count, zbuffer, z, mask );
|
||||
rb->PutValues(ctx, rb, count, x, y, zbuffer, NULL);
|
||||
depth_test_span32(ctx, count, zbuffer, z, mask);
|
||||
rb->PutValues(ctx, rb, count, x, y, zbuffer, mask);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -129,13 +129,13 @@ sprite_point(GLcontext *ctx, const SWvertex *vert)
|
|||
s = 0.0;
|
||||
dsdx = 1.0 / size;
|
||||
if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) {
|
||||
t0 = 0.0;
|
||||
dtdy = 1.0 / size;
|
||||
t0 = 0.5 * dtdy;
|
||||
}
|
||||
else {
|
||||
/* GL_UPPER_LEFT */
|
||||
t0 = 1.0;
|
||||
dtdy = -1.0 / size;
|
||||
t0 = 1.0 + 0.5 * dtdy;
|
||||
}
|
||||
|
||||
ATTRIB_LOOP_BEGIN
|
||||
|
|
|
@ -216,9 +216,9 @@ is_depth_format(GLenum format)
|
|||
{
|
||||
switch (format) {
|
||||
case GL_DEPTH_COMPONENT:
|
||||
case GL_DEPTH_COMPONENT16_SGIX:
|
||||
case GL_DEPTH_COMPONENT24_SGIX:
|
||||
case GL_DEPTH_COMPONENT32_SGIX:
|
||||
case GL_DEPTH_COMPONENT16:
|
||||
case GL_DEPTH_COMPONENT24:
|
||||
case GL_DEPTH_COMPONENT32:
|
||||
return GL_TRUE;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
|
|
|
@ -112,22 +112,25 @@ setup_vertex_format(GLcontext *ctx)
|
|||
{
|
||||
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
||||
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
|
||||
GLboolean intColors = !ctx->FragmentProgram._Current
|
||||
&& !ctx->ATIFragmentShader._Enabled
|
||||
&& ctx->RenderMode == GL_RENDER
|
||||
&& CHAN_TYPE == GL_UNSIGNED_BYTE;
|
||||
|
||||
if (!RENDERINPUTS_EQUAL(tnl->render_inputs_bitset,
|
||||
if (intColors != swsetup->intColors ||
|
||||
!RENDERINPUTS_EQUAL(tnl->render_inputs_bitset,
|
||||
swsetup->last_index_bitset)) {
|
||||
DECLARE_RENDERINPUTS(index_bitset);
|
||||
struct tnl_attr_map map[_TNL_ATTRIB_MAX];
|
||||
int i, e = 0;
|
||||
|
||||
swsetup->intColors = intColors;
|
||||
|
||||
RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset );
|
||||
|
||||
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] );
|
||||
|
||||
if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) {
|
||||
swsetup->intColors = !ctx->FragmentProgram._Current
|
||||
&& !ctx->ATIFragmentShader._Enabled
|
||||
&& ctx->RenderMode == GL_RENDER
|
||||
&& CHAN_TYPE == GL_UNSIGNED_BYTE;
|
||||
if (swsetup->intColors)
|
||||
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color );
|
||||
else
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Makefile for core library for VMS
|
||||
# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
|
||||
# Last revision : 30 November 2007
|
||||
# Last revision : 39 September 2008
|
||||
|
||||
.first
|
||||
define gl [---.include.gl]
|
||||
|
@ -27,13 +27,13 @@ SOURCES = t_context.c t_draw.c \
|
|||
t_pipeline.c t_vb_fog.c \
|
||||
t_vb_light.c t_vb_normals.c t_vb_points.c t_vb_program.c \
|
||||
t_vb_render.c t_vb_texgen.c t_vb_texmat.c t_vb_vertex.c \
|
||||
t_vertex.c \
|
||||
t_vertex.c t_rasterpos.c\
|
||||
t_vertex_generic.c t_vp_build.c
|
||||
|
||||
OBJECTS = t_context.obj,t_draw.obj,\
|
||||
t_pipeline.obj,t_vb_fog.obj,t_vb_light.obj,t_vb_normals.obj,\
|
||||
t_vb_points.obj,t_vb_program.obj,t_vb_render.obj,t_vb_texgen.obj,\
|
||||
t_vb_texmat.obj,t_vb_vertex.obj,\
|
||||
t_vb_texmat.obj,t_vb_vertex.obj,t_rasterpos.obj,\
|
||||
t_vertex.obj,t_vertex_generic.obj,\
|
||||
t_vp_build.obj
|
||||
|
||||
|
@ -65,3 +65,4 @@ t_vb_vertex.obj : t_vb_vertex.c
|
|||
t_vertex.obj : t_vertex.c
|
||||
t_vertex_generic.obj : t_vertex_generic.c
|
||||
t_vp_build.obj : t_vp_build.c
|
||||
t_rasterpos.obj : t_rasterpos.c
|
||||
|
|
|
@ -34,6 +34,12 @@
|
|||
#include "t_vertex.h"
|
||||
|
||||
|
||||
#if 0
|
||||
#define DEBUG_INSERT printf("%s\n", __FUNCTION__)
|
||||
#else
|
||||
#define DEBUG_INSERT
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* These functions take the NDC coordinates pointed to by 'in', apply the
|
||||
|
@ -45,7 +51,7 @@ static INLINE void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLu
|
|||
{
|
||||
GLfloat *out = (GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = vp[0] * in[0] + vp[12];
|
||||
out[1] = vp[5] * in[1] + vp[13];
|
||||
out[2] = vp[10] * in[2] + vp[14];
|
||||
|
@ -57,7 +63,7 @@ static INLINE void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLu
|
|||
{
|
||||
GLfloat *out = (GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = vp[0] * in[0] + vp[12];
|
||||
out[1] = vp[5] * in[1] + vp[13];
|
||||
out[2] = vp[10] * in[2] + vp[14];
|
||||
|
@ -69,7 +75,7 @@ static INLINE void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLu
|
|||
{
|
||||
GLfloat *out = (GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = vp[0] * in[0] + vp[12];
|
||||
out[1] = vp[5] * in[1] + vp[13];
|
||||
out[2] = vp[14];
|
||||
|
@ -81,7 +87,7 @@ static INLINE void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLu
|
|||
{
|
||||
GLfloat *out = (GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = vp[0] * in[0] + vp[12];
|
||||
out[1] = vp[13];
|
||||
out[2] = vp[14];
|
||||
|
@ -93,7 +99,7 @@ static INLINE void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLu
|
|||
{
|
||||
GLfloat *out = (GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = vp[0] * in[0] + vp[12];
|
||||
out[1] = vp[5] * in[1] + vp[13];
|
||||
out[2] = vp[10] * in[2] + vp[14];
|
||||
|
@ -104,7 +110,7 @@ static INLINE void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLu
|
|||
{
|
||||
GLfloat *out = (GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = vp[0] * in[0] + vp[12];
|
||||
out[1] = vp[5] * in[1] + vp[13];
|
||||
out[2] = vp[10] * in[2] + vp[14];
|
||||
|
@ -115,7 +121,7 @@ static INLINE void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLu
|
|||
{
|
||||
GLfloat *out = (GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = vp[0] * in[0] + vp[12];
|
||||
out[1] = vp[13];
|
||||
out[2] = vp[14];
|
||||
|
@ -126,7 +132,7 @@ static INLINE void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLu
|
|||
{
|
||||
GLfloat *out = (GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = vp[0] * in[0] + vp[12];
|
||||
out[1] = vp[5] * in[1] + vp[13];
|
||||
}
|
||||
|
@ -136,7 +142,7 @@ static INLINE void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLu
|
|||
{
|
||||
GLfloat *out = (GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = vp[0] * in[0] + vp[12];
|
||||
out[1] = vp[13];
|
||||
}
|
||||
|
@ -150,7 +156,7 @@ static INLINE void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v,
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[2];
|
||||
|
@ -161,7 +167,7 @@ static INLINE void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v,
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[2];
|
||||
|
@ -172,7 +178,7 @@ static INLINE void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v,
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = 0;
|
||||
|
@ -183,7 +189,7 @@ static INLINE void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
out[1] = 0;
|
||||
out[2] = 0;
|
||||
|
@ -194,7 +200,7 @@ static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[3];
|
||||
|
@ -203,6 +209,7 @@ static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte
|
|||
static INLINE void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
|
||||
{
|
||||
(void) a; (void) v; (void) in;
|
||||
DEBUG_INSERT;
|
||||
_mesa_exit(1);
|
||||
}
|
||||
|
||||
|
@ -210,7 +217,7 @@ static INLINE void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v,
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[2];
|
||||
|
@ -220,7 +227,7 @@ static INLINE void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v,
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = 0;
|
||||
|
@ -230,7 +237,7 @@ static INLINE void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
out[1] = 0;
|
||||
out[2] = 0;
|
||||
|
@ -241,7 +248,7 @@ static INLINE void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v,
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
}
|
||||
|
@ -250,7 +257,7 @@ static INLINE void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
out[1] = 0;
|
||||
}
|
||||
|
@ -259,12 +266,13 @@ static INLINE void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
|||
{
|
||||
GLfloat *out = (GLfloat *)(v);
|
||||
(void) a;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = in[0];
|
||||
}
|
||||
|
||||
static INLINE void insert_null( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a; (void) v; (void) in;
|
||||
}
|
||||
|
||||
|
@ -272,6 +280,7 @@ static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, G
|
|||
const GLfloat *in )
|
||||
{
|
||||
GLchan *c = (GLchan *)v;
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]);
|
||||
|
@ -283,6 +292,7 @@ static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, G
|
|||
const GLfloat *in )
|
||||
{
|
||||
GLchan *c = (GLchan *)v;
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]);
|
||||
|
@ -294,6 +304,7 @@ static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, G
|
|||
const GLfloat *in )
|
||||
{
|
||||
GLchan *c = (GLchan *)v;
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]);
|
||||
|
@ -305,6 +316,7 @@ static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, G
|
|||
const GLfloat *in )
|
||||
{
|
||||
GLchan *c = (GLchan *)v;
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
|
||||
c[1] = 0;
|
||||
|
@ -315,6 +327,7 @@ static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, G
|
|||
static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
|
||||
|
@ -325,6 +338,7 @@ static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
|
||||
|
@ -335,6 +349,7 @@ static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
|
||||
|
@ -345,6 +360,7 @@ static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
|
||||
v[1] = 0;
|
||||
|
@ -355,6 +371,7 @@ static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
|
||||
|
@ -365,6 +382,7 @@ static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
|
||||
|
@ -375,6 +393,7 @@ static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
|
||||
|
@ -385,6 +404,7 @@ static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
|
||||
v[1] = 0;
|
||||
|
@ -395,6 +415,7 @@ static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
|
||||
|
@ -405,6 +426,7 @@ static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
|
||||
|
@ -415,6 +437,7 @@ static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
|
||||
|
@ -425,6 +448,7 @@ static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
|
||||
v[2] = 0x00;
|
||||
|
@ -435,6 +459,7 @@ static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
|
||||
|
@ -445,6 +470,7 @@ static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
|
||||
|
@ -455,6 +481,7 @@ static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
|
||||
|
@ -465,6 +492,7 @@ static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
|
||||
v[2] = 0x00;
|
||||
|
@ -475,6 +503,7 @@ static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLu
|
|||
static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
|
||||
|
@ -484,6 +513,7 @@ static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLub
|
|||
static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
|
||||
|
@ -493,6 +523,7 @@ static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLub
|
|||
static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
|
||||
v[1] = 0;
|
||||
|
@ -502,6 +533,7 @@ static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLub
|
|||
static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
|
||||
|
@ -511,6 +543,7 @@ static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLub
|
|||
static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
|
||||
|
@ -520,6 +553,7 @@ static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLub
|
|||
static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
|
||||
v[1] = 0;
|
||||
|
@ -530,6 +564,7 @@ static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLub
|
|||
static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
|
||||
const GLfloat *in )
|
||||
{
|
||||
DEBUG_INSERT;
|
||||
(void) a;
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
|
||||
}
|
||||
|
@ -551,6 +586,7 @@ static void extract_4f_viewport( const struct tnl_clipspace_attr *a, GLfloat *ou
|
|||
/* Although included for completeness, the position coordinate is
|
||||
* usually handled differently during clipping.
|
||||
*/
|
||||
DEBUG_INSERT;
|
||||
out[0] = (in[0] - vp[12]) / vp[0];
|
||||
out[1] = (in[1] - vp[13]) / vp[5];
|
||||
out[2] = (in[2] - vp[14]) / vp[10];
|
||||
|
@ -562,7 +598,7 @@ static void extract_3f_viewport( const struct tnl_clipspace_attr *a, GLfloat *ou
|
|||
{
|
||||
const GLfloat *in = (const GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = (in[0] - vp[12]) / vp[0];
|
||||
out[1] = (in[1] - vp[13]) / vp[5];
|
||||
out[2] = (in[2] - vp[14]) / vp[10];
|
||||
|
@ -575,7 +611,7 @@ static void extract_2f_viewport( const struct tnl_clipspace_attr *a, GLfloat *ou
|
|||
{
|
||||
const GLfloat *in = (const GLfloat *)v;
|
||||
const GLfloat * const vp = a->vp;
|
||||
|
||||
DEBUG_INSERT;
|
||||
out[0] = (in[0] - vp[12]) / vp[0];
|
||||
out[1] = (in[1] - vp[13]) / vp[5];
|
||||
out[2] = 0;
|
||||
|
|
|
@ -41,7 +41,10 @@
|
|||
#include "math/m_debug.h"
|
||||
#endif
|
||||
|
||||
extern void _mesa_x86_64_cpuid(unsigned int *regs);
|
||||
|
||||
DECLARE_XFORM_GROUP( x86_64, 4 )
|
||||
DECLARE_XFORM_GROUP( 3dnow, 4 )
|
||||
|
||||
#else
|
||||
/* just to silence warning below */
|
||||
|
@ -81,6 +84,7 @@ static void message( const char *msg )
|
|||
void _mesa_init_all_x86_64_transform_asm(void)
|
||||
{
|
||||
#ifdef USE_X86_64_ASM
|
||||
unsigned int regs[4];
|
||||
|
||||
if ( _mesa_getenv( "MESA_NO_ASM" ) ) {
|
||||
return;
|
||||
|
@ -88,24 +92,32 @@ void _mesa_init_all_x86_64_transform_asm(void)
|
|||
|
||||
message("Initializing x86-64 optimizations\n");
|
||||
|
||||
ASSIGN_XFORM_GROUP( x86_64, 4 );
|
||||
|
||||
/*
|
||||
_mesa_transform_tab[4][MATRIX_GENERAL] =
|
||||
_mesa_x86_64_transform_points4_general;
|
||||
_mesa_transform_tab[4][MATRIX_IDENTITY] =
|
||||
_mesa_x86_64_transform_points4_identity;
|
||||
_mesa_transform_tab[4][MATRIX_3D] =
|
||||
_mesa_x86_64_transform_points4_3d;
|
||||
_mesa_transform_tab[4][MATRIX_3D_NO_ROT] =
|
||||
_mesa_x86_64_transform_points4_3d_no_rot;
|
||||
_mesa_transform_tab[4][MATRIX_PERSPECTIVE] =
|
||||
_mesa_x86_64_transform_points4_perspective;
|
||||
_mesa_transform_tab[4][MATRIX_2D_NO_ROT] =
|
||||
_mesa_x86_64_transform_points4_2d_no_rot;
|
||||
_mesa_transform_tab[4][MATRIX_2D] =
|
||||
_mesa_x86_64_transform_points4_2d;
|
||||
*/
|
||||
|
||||
regs[0] = 0x80000001;
|
||||
regs[1] = 0x00000000;
|
||||
regs[2] = 0x00000000;
|
||||
regs[3] = 0x00000000;
|
||||
_mesa_x86_64_cpuid(regs);
|
||||
if (regs[3] & (1U << 31)) {
|
||||
message("3Dnow! detected\n");
|
||||
_mesa_transform_tab[4][MATRIX_3D_NO_ROT] =
|
||||
_mesa_3dnow_transform_points4_3d_no_rot;
|
||||
_mesa_transform_tab[4][MATRIX_PERSPECTIVE] =
|
||||
_mesa_3dnow_transform_points4_perspective;
|
||||
_mesa_transform_tab[4][MATRIX_2D_NO_ROT] =
|
||||
_mesa_3dnow_transform_points4_2d_no_rot;
|
||||
_mesa_transform_tab[4][MATRIX_2D] =
|
||||
_mesa_3dnow_transform_points4_2d;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_MATH
|
||||
_math_test_all_transform_functions("x86_64");
|
||||
|
|
|
@ -29,7 +29,22 @@
|
|||
.text
|
||||
|
||||
.align 16
|
||||
.globl _mesa_x86_64_cpuid
|
||||
_mesa_x86_64_cpuid:
|
||||
pushq %rbx
|
||||
movl (%rdi), %eax
|
||||
movl 8(%rdi), %ecx
|
||||
|
||||
cpuid
|
||||
|
||||
movl %ebx, 4(%rdi)
|
||||
movl %eax, (%rdi)
|
||||
movl %ecx, 8(%rdi)
|
||||
movl %edx, 12(%rdi)
|
||||
popq %rbx
|
||||
ret
|
||||
|
||||
.align 16
|
||||
.globl _mesa_x86_64_transform_points4_general
|
||||
_mesa_x86_64_transform_points4_general:
|
||||
/*
|
||||
|
@ -204,8 +219,8 @@ p4_identity_done:
|
|||
|
||||
|
||||
.align 16
|
||||
.globl _mesa_x86_64_transform_points4_3d_no_rot
|
||||
_mesa_x86_64_transform_points4_3d_no_rot:
|
||||
.globl _mesa_3dnow_transform_points4_3d_no_rot
|
||||
_mesa_3dnow_transform_points4_3d_no_rot:
|
||||
|
||||
movl V4F_COUNT(%rdx), %ecx /* count */
|
||||
movzx V4F_STRIDE(%rdx), %eax /* stride */
|
||||
|
@ -268,8 +283,8 @@ p4_3d_no_rot_done:
|
|||
|
||||
|
||||
.align 16
|
||||
.globl _mesa_x86_64_transform_points4_perspective
|
||||
_mesa_x86_64_transform_points4_perspective:
|
||||
.globl _mesa_3dnow_transform_points4_perspective
|
||||
_mesa_3dnow_transform_points4_perspective:
|
||||
|
||||
movl V4F_COUNT(%rdx), %ecx /* count */
|
||||
movzx V4F_STRIDE(%rdx), %eax /* stride */
|
||||
|
@ -334,8 +349,8 @@ p4_perspective_done:
|
|||
ret
|
||||
|
||||
.align 16
|
||||
.globl _mesa_x86_64_transform_points4_2d_no_rot
|
||||
_mesa_x86_64_transform_points4_2d_no_rot:
|
||||
.globl _mesa_3dnow_transform_points4_2d_no_rot
|
||||
_mesa_3dnow_transform_points4_2d_no_rot:
|
||||
|
||||
movl V4F_COUNT(%rdx), %ecx /* count */
|
||||
movzx V4F_STRIDE(%rdx), %eax /* stride */
|
||||
|
@ -389,8 +404,8 @@ p4_2d_no_rot_done:
|
|||
|
||||
|
||||
.align 16
|
||||
.globl _mesa_x86_64_transform_points4_2d
|
||||
_mesa_x86_64_transform_points4_2d:
|
||||
.globl _mesa_3dnow_transform_points4_2d
|
||||
_mesa_3dnow_transform_points4_2d:
|
||||
|
||||
movl V4F_COUNT(%rdx), %ecx /* count */
|
||||
movzx V4F_STRIDE(%rdx), %eax /* stride */
|
||||
|
|
Loading…
Reference in New Issue