void r300_init_state_functions(struct r300_context* r300);
void r300_init_surface_functions(struct r300_context* r300);
+/* Fun with includes: r300_winsys also declares this prototype.
+ * We'll just step out in that case... */
+#ifndef R300_WINSYS_H
struct pipe_context* r300_create_context(struct pipe_screen* screen,
struct pipe_winsys* winsys,
struct r300_winsys* r300_winsys);
+#endif
#endif /* R300_CONTEXT_H */
struct pipe_framebuffer_state* fb)
{
CS_LOCALS(r300);
+ struct r300_texture* tex;
int i;
BEGIN_CS((3 * fb->nr_cbufs) + 6);
for (i = 0; i < fb->nr_cbufs; i++) {
+ tex = (struct r300_texture*)fb->cbufs[i]->texture;
OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1);
- OUT_CS_RELOC(fb->cbufs[i]->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+ OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
}
R300_PACIFY;
END_CS;
struct pipe_surface* surface,
unsigned flags)
{
- char* map = pipe_buffer_map(screen, surface->buffer, flags);
+ struct r300_texture* tex = (struct r300_texture*)surface->texture;
+ char* map = pipe_buffer_map(screen, tex->buffer, flags);
if (!map) {
return NULL;
static void r300_surface_unmap(struct pipe_screen* screen,
struct pipe_surface* surface)
{
- pipe_buffer_unmap(screen, surface->buffer);
+ struct r300_texture* tex = (struct r300_texture*)surface->texture;
+ pipe_buffer_unmap(screen, tex->buffer);
}
static void r300_destroy_screen(struct pipe_screen* pscreen)
struct r300_context* r300 = r300_context(pipe);
CS_LOCALS(r300);
struct r300_capabilities* caps = ((struct r300_screen*)pipe->screen)->caps;
+ struct r300_texture* tex = (struct r300_texture*)dest->texture;
int i;
float r, g, b, a;
r = (float)((color >> 16) & 0xff) / 255.0f;
R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE);
OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1);
-OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
/* XXX this should not be so rigid and it still doesn't work right */
OUT_CS_REG(R300_RB3D_COLORPITCH0, (dest->stride >> 2) | R300_COLOR_FORMAT_ARGB8888);
OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F);
if (surface) {
surface->refcount = 1;
pipe_texture_reference(&surface->texture, texture);
- pipe_buffer_reference(screen, &surface->buffer, tex->buffer);
surface->format = texture->format;
surface->width = texture->width[level];
surface->height = texture->height[level];
if (s->refcount <= 0) {
pipe_texture_reference(&s->texture, NULL);
- pipe_buffer_reference(screen, &s->buffer, NULL);
FREE(s);
}
/* XXX tex->stride = *stride; */
- pipe_buffer_reference(screen, &tex->buffer, buffer);
-
return (struct pipe_texture*)tex;
}