OUT_BATCH(BUF_3D_ID_COLOR_BACK |
BUF_3D_PITCH(pitch) | /* pitch in bytes */
+// BUF_3D_TILED_SURFACE); /* JB: Used to force tileing */
BUF_3D_USE_FENCE);
OUT_RELOC(cbuf_surface->buffer,
return (n + multiple - 1) & ~(multiple - 1);
}
+static unsigned
+power_of_two(unsigned x)
+{
+ int value = 1;
+ while (value <= x)
+ value = value << 1;
+ return value;
+}
+ /*pipe_buffer_reference(winsys, &i915_render->vbo, NULL);*/
/**
* Copied from xm_winsys.c
*/
unsigned tex_usage)
{
const unsigned alignment = 64;
+ assert(!surf->buffer);
+#if 0
+ surf->width = width;
+ surf->height = round_up(height, 8);
+ surf->format = format;
+ surf->cpp = pf_get_size(format);
+ surf->pitch = power_of_two(MAX2(width * surf->cpp, 512));
+ surf->buffer = winsys->buffer_create(winsys, 2*4096,
+ PIPE_BUFFER_USAGE_PIXEL,
+ surf->pitch * surf->height);
+
+ surf->pitch = surf->pitch / surf->cpp;
+ surf->height = height;
+#else
surf->width = width;
surf->height = height;
surf->format = format;
surf->cpp = pf_get_size(format);
surf->pitch = round_up(width, alignment / surf->cpp);
- assert(!surf->buffer);
surf->buffer = winsys->buffer_create(winsys, alignment,
PIPE_BUFFER_USAGE_PIXEL,
surf->pitch * surf->cpp * surf->height);
-
+#endif
if(!surf->buffer)
return -1;