struct pipe_surface *depth_surface = i915->framebuffer.zsbuf;
if (cbuf_surface) {
- unsigned pitch = (cbuf_surface->pitch * cbuf_surface->cpp);
+ unsigned ctile = BUF_3D_USE_FENCE;
+ struct i915_texture *tex = (struct i915_texture *)
+ cbuf_surface->texture;
+ assert(tex);
+
+ if (tex && tex->tiled) {
+ ctile = BUF_3D_TILED_SURFACE;
+ }
OUT_BATCH(_3DSTATE_BUF_INFO_CMD);
- OUT_BATCH(BUF_3D_ID_COLOR_BACK |
- BUF_3D_PITCH(pitch) | /* pitch in bytes */
- BUF_3D_USE_FENCE);
+ OUT_BATCH(BUF_3D_ID_COLOR_BACK |
+ BUF_3D_PITCH(tex->stride) | /* pitch in bytes */
+ ctile);
- OUT_RELOC(cbuf_surface->buffer,
+ OUT_RELOC(tex->buffer,
I915_BUFFER_ACCESS_WRITE,
- 0);
+ cbuf_surface->offset);
}
/* What happens if no zbuf??
*/
if (depth_surface) {
- unsigned zpitch = (depth_surface->pitch * depth_surface->cpp);
-
+ unsigned ztile = BUF_3D_USE_FENCE;
+ struct i915_texture *tex = (struct i915_texture *)
+ depth_surface->texture;
+ assert(tex);
+
+ if (tex && tex->tiled) {
+ ztile = BUF_3D_TILED_SURFACE;
+ }
+
OUT_BATCH(_3DSTATE_BUF_INFO_CMD);
OUT_BATCH(BUF_3D_ID_DEPTH |
- BUF_3D_PITCH(zpitch) | /* pitch in bytes */
- BUF_3D_USE_FENCE);
+ BUF_3D_PITCH(tex->stride) | /* pitch in bytes */
+ ztile);
- OUT_RELOC(depth_surface->buffer,
+ OUT_RELOC(tex->buffer,
I915_BUFFER_ACCESS_WRITE,
- 0);
+ depth_surface->offset);
}
{
{
uint w, h;
boolean k = framebuffer_size(&i915->framebuffer, &w, &h);
+ (void)k;
assert(k);
OUT_BATCH(_3DSTATE_DRAW_RECT_CMD);