static void
i915_texture_set_level_info(struct i915_texture *tex,
- unsigned level,
- unsigned nr_images,
- unsigned w, unsigned h, unsigned d)
+ unsigned level,
+ unsigned nr_images,
+ unsigned w, unsigned h, unsigned d)
{
assert(level < Elements(tex->nr_images));
/*
- * i915 layout functions, some used by i945
+ * Shared layout functions
*/
* Special case to deal with scanout textures.
*/
static boolean
-i915_scanout_layout(struct i915_texture *tex)
+i9x5_scanout_layout(struct i915_texture *tex)
{
struct pipe_resource *pt = &tex->b.b;
* Special case to deal with shared textures.
*/
static boolean
-i915_display_target_layout(struct i915_texture *tex)
+i9x5_display_target_layout(struct i915_texture *tex)
{
struct pipe_resource *pt = &tex->b.b;
return TRUE;
}
+
+/*
+ * i915 layout functions
+ */
+
+
static void
i915_texture_layout_2d(struct i915_texture *tex)
{
/* used for scanouts that need special layouts */
if (pt->bind & PIPE_BIND_SCANOUT)
- if (i915_scanout_layout(tex))
+ if (i9x5_scanout_layout(tex))
return;
/* shared buffers needs to be compatible with X servers
* of core gallium, and probably move the flag to resource.flags,
* rather than bindings.
*/
- if (pt->bind & PIPE_BIND_SHARED)
- if (i915_display_target_layout(tex))
+ if (pt->bind & (PIPE_BIND_SHARED | PIPE_BIND_DISPLAY_TARGET))
+ if (i9x5_display_target_layout(tex))
return;
tex->stride = align(util_format_get_stride(pt->format, pt->width0), 4);
/* used for scanouts that need special layouts */
if (tex->b.b.bind & PIPE_BIND_SCANOUT)
- if (i915_scanout_layout(tex))
+ if (i9x5_scanout_layout(tex))
return;
/* shared buffers needs to be compatible with X servers */
- if (tex->b.b.bind & PIPE_BIND_SHARED)
- if (i915_display_target_layout(tex))
+ if (tex->b.b.bind & (PIPE_BIND_SHARED | PIPE_BIND_DISPLAY_TARGET))
+ if (i9x5_display_target_layout(tex))
return;
tex->stride = align(util_format_get_stride(pt->format, pt->width0), 4);
*/
if (level == 1) {
x += align(nblocksx, align_x);
- }
- else {
+ } else {
y += nblocksy;
}
if (resource->target == PIPE_TEXTURE_CUBE) {
offset = tex->image_offset[sr.level][sr.face];
- }
- else if (resource->target == PIPE_TEXTURE_3D) {
+ } else if (resource->target == PIPE_TEXTURE_3D) {
offset = tex->image_offset[sr.level][box->z];
- }
- else {
+ } else {
offset = tex->image_offset[sr.level][0];
assert(sr.face == 0);
assert(box->z == 0);
}
- map = iws->buffer_map(iws,
- tex->buffer,
- (transfer->usage & PIPE_TRANSFER_WRITE) ? TRUE : FALSE);
+ map = iws->buffer_map(iws, tex->buffer,
+ (transfer->usage & PIPE_TRANSFER_WRITE) ? TRUE : FALSE);
if (map == NULL)
return NULL;