* not a user-created renderbuffer.
*/
struct intel_renderbuffer *
-intel_create_renderbuffer(GLenum intFormat, int tiling)
+intel_create_renderbuffer(intelScreenPrivate *intelScreen,
+ GLenum intFormat, enum tiling_mode tiling)
{
GET_CURRENT_CONTEXT(ctx);
irb->Base.Delete = intel_delete_renderbuffer;
irb->Base.AllocStorage = intel_alloc_window_storage;
irb->Base.GetPointer = intel_get_pointer;
- /* This sets the Get/PutRow/Value functions */
- intel_set_span_functions(&irb->Base, tiling);
+ /* This sets the Get/PutRow/Value functions. In classic mode, all access
+ * is through the aperture and will be swizzled by the fence registers, so
+ * we don't need the span functions to perfom tile swizzling
+ */
+ if (intelScreen->ttm)
+ intel_set_span_functions(&irb->Base, tiling);
+ else
+ intel_set_span_functions(&irb->Base, INTEL_TILE_NONE);
return irb;
}
#ifndef INTEL_FBO_H
#define INTEL_FBO_H
+#include "intel_screen.h"
struct intel_context;
-struct intel_region;
/**
* Intel framebuffer, derived from gl_framebuffer.
struct intel_region *region;
void *pfMap; /* possibly paged flipped map pointer */
GLuint pfPitch; /* possibly paged flipped pitch */
- int tiling;
+ enum tiling_mode tiling;
GLboolean RenderToTexture; /* RTT? */
GLuint PairedDepth; /**< only used if this is a depth renderbuffer */
struct intel_region *region);
extern struct intel_renderbuffer *
-intel_create_renderbuffer(GLenum intFormat, int tiling);
+intel_create_renderbuffer(intelScreenPrivate *intelScreen,
+ GLenum intFormat, enum tiling_mode tiling);
extern void intel_fbo_init(struct intel_context *intel);
GLboolean swStencil = (mesaVis->stencilBits > 0 &&
mesaVis->depthBits != 24);
GLenum rgbFormat = (mesaVis->redBits == 5 ? GL_RGB5 : GL_RGBA8);
+ enum tiling_mode tiling;
struct intel_framebuffer *intel_fb = CALLOC_STRUCT(intel_framebuffer);
_mesa_initialize_framebuffer(&intel_fb->Base, mesaVis);
/* setup the hardware-based renderbuffers */
+ /* We get only a boolean value from the DDX for whether tiling is
+ * enabled, so we have to guess when it's Y and not X (965 depth).
+ */
{
- intel_fb->color_rb[0] = intel_create_renderbuffer(rgbFormat,
- screen->ttm ? screen->front.tiled : INTEL_TILE_NONE);
+ tiling = screen->front.tiled ? INTEL_TILE_X : INTEL_TILE_NONE;
+ intel_fb->color_rb[0] = intel_create_renderbuffer(screen,
+ rgbFormat, tiling);
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_FRONT_LEFT,
&intel_fb->color_rb[0]->Base);
}
if (mesaVis->doubleBufferMode) {
- intel_fb->color_rb[1] = intel_create_renderbuffer(rgbFormat,
- screen->ttm ? screen->back.tiled : INTEL_TILE_NONE);
+ tiling = screen->back.tiled ? INTEL_TILE_X : INTEL_TILE_NONE;
+ intel_fb->color_rb[1] = intel_create_renderbuffer(screen,
+ rgbFormat, tiling);
+
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_BACK_LEFT,
&intel_fb->color_rb[1]->Base);
if (screen->third.handle) {
struct gl_renderbuffer *tmp_rb = NULL;
-
- intel_fb->color_rb[2] = intel_create_renderbuffer(rgbFormat,
- screen->ttm ? screen->third.tiled : INTEL_TILE_NONE);
+ tiling = screen->third.tiled ? INTEL_TILE_X : INTEL_TILE_NONE;
+ intel_fb->color_rb[2] = intel_create_renderbuffer(screen,
+ rgbFormat,
+ tiling);
_mesa_reference_renderbuffer(&tmp_rb, &intel_fb->color_rb[2]->Base);
}
}
+#ifdef I915
+ tiling = screen->depth.tiled ? INTEL_TILE_X : INTEL_TILE_NONE;
+#else
+ tiling = screen->depth.tiled ? INTEL_TILE_Y : INTEL_TILE_NONE;
+#endif
if (mesaVis->depthBits == 24) {
if (mesaVis->stencilBits == 8) {
/* combined depth/stencil buffer */
struct intel_renderbuffer *depthStencilRb
- = intel_create_renderbuffer(GL_DEPTH24_STENCIL8_EXT,
- screen->ttm ? screen->depth.tiled : INTEL_TILE_NONE);
+ = intel_create_renderbuffer(screen,
+ GL_DEPTH24_STENCIL8_EXT, tiling);
/* note: bind RB to two attachment points */
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH,
&depthStencilRb->Base);
&depthStencilRb->Base);
} else {
struct intel_renderbuffer *depthRb
- = intel_create_renderbuffer(GL_DEPTH_COMPONENT24,
- screen->ttm ? screen->depth.tiled : INTEL_TILE_NONE);
+ = intel_create_renderbuffer(screen,
+ GL_DEPTH_COMPONENT24, tiling);
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH,
&depthRb->Base);
}
else if (mesaVis->depthBits == 16) {
/* just 16-bit depth buffer, no hw stencil */
struct intel_renderbuffer *depthRb
- = intel_create_renderbuffer(GL_DEPTH_COMPONENT16,
- screen->ttm ? screen->depth.tiled : INTEL_TILE_NONE);
+ = intel_create_renderbuffer(screen,
+ GL_DEPTH_COMPONENT16, tiling);
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH, &depthRb->Base);
}
int x_tile_number, y_tile_number;
int tile_off, tile_base;
- tile_stride = (irb->pfPitch * irb->region->cpp) << 3;
+ tile_stride = (irb->pfPitch * irb->region->cpp) << 5;
x += intel->drawX;
y += intel->drawY;
x_tile_number = xbyte >> 7;
y_tile_number = y >> 5;
- tile_off = ((x_tile_off & ~0xf) << 5) + (y_tile_off << 4) + (x_tile_off & 0xf);
+ tile_off = ((x_tile_off & ~0xf) << 5) + (y_tile_off << 4) +
+ (x_tile_off & 0xf);
tile_base = (x_tile_number << 12) + y_tile_number * tile_stride;
return buf + tile_base + tile_off;
* These are used for the software fallbacks.
*/
void
-intel_set_span_functions(struct gl_renderbuffer *rb, int tiling)
+intel_set_span_functions(struct gl_renderbuffer *rb, enum tiling_mode tiling)
{
if (rb->_ActualFormat == GL_RGB5) {
/* 565 RGB */