GLuint primitive,
GLuint vertex_nr )
{
- drm_radeon_cmd_header_t *cmd;
BATCH_LOCALS(&rmesa->radeon);
assert(!(primitive & R200_VF_PRIM_WALK_IND));
void r200FlushElts(GLcontext *ctx)
{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- int dwords;
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
int nr, elt_used = rmesa->tcl.elt_used;
if (R200_DEBUG & (DEBUG_IOCTL|DEBUG_PRIMS))
}
END_BATCH();
}
-
-void r200FireAOS(r200ContextPtr rmesa, int vertex_count, int type)
-{
- BATCH_LOCALS(&rmesa->radeon);
-
- BEGIN_BATCH(3);
- OUT_BATCH_PACKET3(R200_CP_CMD_3D_DRAW_VBUF_2, 0);
- OUT_BATCH(R200_VF_PRIM_WALK_LIST | (vertex_count << 16) | type);
- END_BATCH();
-}
-
{
r200ContextPtr rmesa = (r200ContextPtr)radeon;
drm_radeon_sarea_t *sarea = radeon->sarea;
- int i;
R200_STATECHANGE( rmesa, ctx );
if (rmesa->radeon.sarea->tiling_enabled) {
__DRIdrawablePrivate *dPriv = rmesa->radeon.dri.drawable;
GLuint flags = 0;
GLuint color_mask = 0;
- GLint ret;
GLuint orig_mask = mask;
if ( R200_DEBUG & DEBUG_IOCTL ) {
#include "main/macros.h"
#include "main/context.h"
#include "main/dd.h"
+#include "main/framebuffer.h"
#include "main/simple_list.h"
#include "main/api_arrayelt.h"
#include "main/texformat.h"
static void r300ResetHwState(r300ContextPtr r300)
{
GLcontext *ctx = r300->radeon.glCtx;
- struct radeon_renderbuffer *rrb;
int has_tcl = 1;
if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL))
fprintf(stderr, "%s\n", __FUNCTION__);
radeon_firevertices(&r300->radeon);
- //r300UpdateWindow(ctx);
r300ColorMask(ctx,
ctx->Color.ColorMask[RCOMP],
*/
void r300InitState(r300ContextPtr r300)
{
- GLcontext *ctx = r300->radeon.glCtx;
- GLuint depth_fmt;
-
memset(&(r300->state.texture), 0, sizeof(r300->state.texture));
r300ResetHwState(r300);
#include "xmlpool.h" /* for symbolic values of enum-type options */
#include "utils.h"
#include "vblank.h"
+#include "drirenderbuffer.h"
#include "main/state.h"
#define DRIVER_DATE "20090101"
struct radeon_framebuffer *draw;
radeonContextPtr radeon;
char *regname;
- struct radeon_bo *depth_bo, *bo;
+ struct radeon_bo *depth_bo = NULL, *bo;
if (RADEON_DEBUG & DEBUG_DRI)
fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
att->TextureLevel);
if (att->Texture->Target == GL_TEXTURE_3D) {
- const GLuint *offsets = radeon_miptree_depth_offsets(radeon_image->mt,
- att->TextureLevel);
+ GLuint offsets[6];
+ radeon_miptree_depth_offsets(radeon_image->mt, att->TextureLevel,
+ offsets);
imageOffset += offsets[att->Zoffset];
}
__DRIdrawablePrivate *const drawable = rmesa->dri.drawable;
__DRIdrawablePrivate *const readable = rmesa->dri.readable;
__DRIscreenPrivate *sPriv = rmesa->dri.screen;
- drm_radeon_sarea_t *sarea = rmesa->sarea;
assert(drawable != NULL);
void radeon_lock_hardware(radeonContextPtr radeon)
{
- __DRIdrawable *dPriv = radeon->dri.drawable;
char ret = 0;
struct radeon_framebuffer *rfb = NULL;
struct radeon_renderbuffer *rrb = NULL;
/* Find image size in bytes */
if (mt->compressed) {
/* TODO: Is this correct? Need test cases for compressed textures! */
- GLuint align;
-
lvl->rowstride = (lvl->width * mt->bpp + 63) & ~63;
lvl->size = radeon_compressed_texture_size(mt->radeon->glCtx,
lvl->width, lvl->height, lvl->depth, mt->compressed);
*
* These functions present that view to mesa:
*/
-const GLuint *
-radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level)
+void
+radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets)
{
- static const GLuint zero = 0;
if (mt->target != GL_TEXTURE_3D || mt->faces == 1)
- return &zero;
- else
- return mt->levels[level].faces[0].offset;
+ offsets[0] = 0;
+ else {
+ int i;
+ for (i = 0; i < 6; i++)
+ offsets[i] = mt->levels[level].faces[i].offset;
+ }
}
GLuint
struct gl_texture_image *texImage, GLuint face, GLuint level);
GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt,
GLuint face, GLuint level);
-const GLuint *
-radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level);
+void radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets);
#endif /* __RADEON_MIPMAP_TREE_H_ */
#include "stenciltmp.h"
-void map_unmap_rb(struct gl_renderbuffer *rb, int flag)
+static void map_unmap_rb(struct gl_renderbuffer *rb, int flag)
{
struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
int r;
static void
radeon_map_unmap_buffers(GLcontext *ctx, GLboolean map)
{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
GLuint i, j;
/* color draw buffers */
void radeonDestroySwtcl( GLcontext *ctx )
{
- r100ContextPtr rmesa = R100_CONTEXT(ctx);
-
}
static void disable_tex_obj_state( r100ContextPtr rmesa,
int unit )
{
- /* do not use RADEON_DB_STATE to avoid stale texture caches */
- uint32_t *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
- GLuint se_coord_fmt = rmesa->hw.set.cmd[SET_SE_COORDFMT];
- GLuint *txr_cmd = RADEON_DB_STATE( txr[unit] );
-
RADEON_STATECHANGE( rmesa, tex[unit] );
RADEON_STATECHANGE( rmesa, tcl );
static GLboolean radeonUpdateTextureUnit( GLcontext *ctx, int unit )
{
r100ContextPtr rmesa = R100_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
if (ctx->Texture.Unit[unit]._ReallyEnabled & TEXTURE_3D_BIT) {
return GL_FALSE;