mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
(Partially) subsetted driver runs miniglxtest and texobj.
Other applications segfault at null function pointers, etc -- need to remove these entrypoints from miniglx libGL.so.
This commit is contained in:
parent
18a5321288
commit
9e3c6f3b8e
6 changed files with 71 additions and 21 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: Makefile,v 1.1.2.15 2003/01/22 16:19:42 keithw Exp $
|
||||
# $Id: Makefile,v 1.1.2.16 2003/01/22 18:16:33 keithw Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 5.0
|
||||
|
|
@ -45,7 +45,7 @@ DRIVER_SOURCES = server/radeon_dri.c \
|
|||
SUBSET_DRIVER_SOURCES = \
|
||||
radeon_subset_bitmap.c \
|
||||
radeon_subset_tcl.c \
|
||||
radeon_subset_vtx.c
|
||||
radeon_subset_vtx.c
|
||||
|
||||
FULL_DRIVER_SOURCES = \
|
||||
radeon_tcl.c \
|
||||
|
|
@ -86,6 +86,9 @@ default: radeon_dri.so install
|
|||
|
||||
radeon_dri.so: $(COREMESA) $(OBJECTS) Makefile
|
||||
rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(COREMESA) -L$(MESA)/src/miniglx -lGL -lc -lm
|
||||
# wc -l $(DRIVER_SOURCES)
|
||||
# wc -l $(SUBSET_DRIVER_SOURCES)
|
||||
# wc -l $(FULL_DRIVER_SOURCES)
|
||||
|
||||
install:
|
||||
rm -f $(MESA)/lib/radeon_dri.so && \
|
||||
|
|
|
|||
|
|
@ -329,6 +329,8 @@ radeonCreateContext( const __GLcontextModes *glVisual,
|
|||
|
||||
rmesa->swtcl.RenderIndex = ~0;
|
||||
rmesa->lost_context = 1;
|
||||
|
||||
rmesa->tcl.tcl_flag = RADEON_CP_VC_CNTL_TCL_ENABLE;
|
||||
|
||||
/* KW: Set the maximum texture size small enough that we can
|
||||
* guarentee that both texture units can bind a maximal texture
|
||||
|
|
|
|||
|
|
@ -503,6 +503,7 @@ struct radeon_tcl_info {
|
|||
GLuint vertex_format;
|
||||
GLint last_offset;
|
||||
GLuint hw_primitive;
|
||||
GLuint tcl_flag;
|
||||
|
||||
struct radeon_dma_region *aos_components[8];
|
||||
GLuint nr_aos_components;
|
||||
|
|
|
|||
|
|
@ -46,13 +46,15 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include "radeon_tcl.h"
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Render unclipped vertex buffers by emitting vertices directly to
|
||||
* dma buffers. Use strip/fan hardware primitives where possible.
|
||||
* Try to simulate missing primitives with indexed vertices.
|
||||
/* KW: Import a version of radeon_tcl.c plus t_dd_dmatmp2.h here.
|
||||
*
|
||||
* This is all just to support radeon_subset_vtx.c, and is pretty
|
||||
* heavyweight for that purpose -- it shouldn't be hard to get the
|
||||
* code there to turn quads into triangles, etc, in a lot less code.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#define HAVE_POINTS 1
|
||||
#define HAVE_LINES 1
|
||||
#define HAVE_LINE_LOOP 0
|
||||
|
|
@ -278,12 +280,12 @@ static void TAG(render_line_loop_verts)( GLcontext *ctx,
|
|||
|
||||
if (flags & PRIM_END) {
|
||||
|
||||
if (start+1 >= count)
|
||||
return;
|
||||
|
||||
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
|
||||
int currentsz;
|
||||
|
||||
if (start+1 >= count)
|
||||
return;
|
||||
|
||||
ELT_INIT( GL_LINE_STRIP, HW_LINE_STRIP );
|
||||
|
||||
currentsz = GET_CURRENT_VB_MAX_ELTS();
|
||||
|
|
@ -516,3 +518,38 @@ void radeonTclFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
|
|||
if (mode)
|
||||
fprintf(stderr, "Warning: hit nonexistant fallback path!\n");
|
||||
}
|
||||
|
||||
void radeonTclPrimitive( GLcontext *ctx,
|
||||
GLenum prim,
|
||||
int hw_prim )
|
||||
{
|
||||
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
|
||||
GLuint se_cntl;
|
||||
GLuint newprim = hw_prim | rmesa->tcl.tcl_flag;
|
||||
|
||||
RADEON_NEWPRIM( rmesa );
|
||||
rmesa->tcl.hw_primitive = newprim;
|
||||
|
||||
se_cntl = rmesa->hw.set.cmd[SET_SE_CNTL];
|
||||
se_cntl &= ~RADEON_FLAT_SHADE_VTX_LAST;
|
||||
|
||||
if (prim == GL_POLYGON && (ctx->_TriangleCaps & DD_FLATSHADE))
|
||||
se_cntl |= RADEON_FLAT_SHADE_VTX_0;
|
||||
else
|
||||
se_cntl |= RADEON_FLAT_SHADE_VTX_LAST;
|
||||
|
||||
if (se_cntl != rmesa->hw.set.cmd[SET_SE_CNTL]) {
|
||||
RADEON_STATECHANGE( rmesa, set );
|
||||
rmesa->hw.set.cmd[SET_SE_CNTL] = se_cntl;
|
||||
}
|
||||
}
|
||||
|
||||
void radeonSubsetVtxEnableTCL( radeonContextPtr rmesa,
|
||||
GLboolean flag )
|
||||
{
|
||||
if (flag)
|
||||
rmesa->tcl.tcl_flag = RADEON_CP_VC_CNTL_TCL_ENABLE;
|
||||
else
|
||||
rmesa->tcl.tcl_flag = 0;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ void radeon_copy_to_current( GLcontext *ctx )
|
|||
{
|
||||
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
|
||||
|
||||
assert(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT);
|
||||
assert(vb.context == ctx);
|
||||
|
||||
ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = vb.floatcolorptr[0];
|
||||
|
|
@ -75,8 +74,6 @@ void radeon_copy_to_current( GLcontext *ctx )
|
|||
ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] = 0.0F;
|
||||
ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] = 1.0F;
|
||||
}
|
||||
|
||||
ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -322,8 +319,8 @@ static void radeonVtxfmtValidate( GLcontext *ctx )
|
|||
|
||||
/* Would prefer to use ubyte floats in the vertex:
|
||||
*/
|
||||
vb.vertex_size += 4;
|
||||
vb.floatcolorptr = &vb.vertex[vb.vertex_size].f;
|
||||
vb.vertex_size += 4;
|
||||
vb.floatcolorptr[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
|
||||
vb.floatcolorptr[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
|
||||
vb.floatcolorptr[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
|
||||
|
|
@ -339,6 +336,7 @@ static void radeonVtxfmtValidate( GLcontext *ctx )
|
|||
vb.texcoordptr[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
|
||||
|
||||
rmesa->vb.recheck = GL_FALSE;
|
||||
ctx->Driver.NeedFlush = FLUSH_UPDATE_CURRENT;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -434,7 +432,6 @@ static void radeonFlushVertices( GLcontext *ctx, GLuint flags )
|
|||
if (RADEON_DEBUG & DEBUG_VFMT)
|
||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||
|
||||
assert(rmesa->vb.installed);
|
||||
assert(vb.context == ctx);
|
||||
|
||||
if (flags & FLUSH_UPDATE_CURRENT) {
|
||||
|
|
@ -442,7 +439,6 @@ static void radeonFlushVertices( GLcontext *ctx, GLuint flags )
|
|||
if (RADEON_DEBUG & DEBUG_VFMT)
|
||||
fprintf(stderr, "reinstall on update_current\n");
|
||||
_mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
|
||||
ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
|
||||
}
|
||||
|
||||
if (flags & FLUSH_STORED_VERTICES) {
|
||||
|
|
@ -468,9 +464,9 @@ static __inline__ void radeon_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
|
|||
*vb.dmaptr++ = *(int *)&y;
|
||||
*vb.dmaptr++ = *(int *)&z;
|
||||
|
||||
for (i = 3; i < vb.vertex_size; i++)
|
||||
for (i = 3; i < vb.vertex_size; i++)
|
||||
*vb.dmaptr++ = vb.vertex[i].i;
|
||||
|
||||
|
||||
if (--vb.counter == 0)
|
||||
vb.notify();
|
||||
}
|
||||
|
|
@ -549,6 +545,7 @@ void radeonVtxfmtInit( GLcontext *ctx )
|
|||
exec->Vertex3fv = radeon_Vertex3fv;
|
||||
exec->Begin = radeon_Begin;
|
||||
exec->End = radeon_End;
|
||||
exec->Rectf = _mesa_noop_Rectf; /* is this supported? */
|
||||
|
||||
|
||||
vb.context = ctx;
|
||||
|
|
@ -556,10 +553,9 @@ void radeonVtxfmtInit( GLcontext *ctx )
|
|||
rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive;
|
||||
rmesa->vb.primflags = 0;
|
||||
|
||||
|
||||
ctx->Driver.FlushVertices = radeonFlushVertices;
|
||||
ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
|
||||
radeonVtxfmtValidate( ctx );
|
||||
assert( rmesa->vb.installed );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -563,3 +563,14 @@ void radeonTclFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
|
|||
fprintf(stderr, "Warning: hit nonexistant fallback path!\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void radeonSubsetVtxEnableTCL( radeonContextPtr rmesa,
|
||||
GLboolean flag )
|
||||
{
|
||||
if (flag)
|
||||
rmesa->tcl.tcl_flag = RADEON_CP_VC_CNTL_TCL_ENABLE;
|
||||
else
|
||||
rmesa->tcl.tcl_flag = 0;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue