summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_resource.h
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-08-08 15:36:36 +0800
committerChia-I Wu <[email protected]>2014-08-19 19:53:37 +0800
commitfb3d506431871fdb04fc84bbcc916d8f9d7c9954 (patch)
tree3f23bd8055812091cd48e89f67362d4511743cfd /src/gallium/drivers/ilo/ilo_resource.h
parent925359bc784399c1a65a46e2b136da3c4d30388d (diff)
ilo: migrate to ilo_layout
Embed an ilo_layout in ilo_texture, and remove now duplicated members.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_resource.h')
-rw-r--r--src/gallium/drivers/ilo/ilo_resource.h54
1 files changed, 10 insertions, 44 deletions
diff --git a/src/gallium/drivers/ilo/ilo_resource.h b/src/gallium/drivers/ilo/ilo_resource.h
index b0eab5b9c0e..be42386b8e8 100644
--- a/src/gallium/drivers/ilo/ilo_resource.h
+++ b/src/gallium/drivers/ilo/ilo_resource.h
@@ -31,6 +31,7 @@
#include "intel_winsys.h"
#include "ilo_common.h"
+#include "ilo_layout.h"
#include "ilo_screen.h"
enum ilo_texture_flags {
@@ -87,8 +88,6 @@ struct ilo_buffer {
* A 3D image slice, cube face, or array layer.
*/
struct ilo_texture_slice {
- /* 2D offset to the slice */
- unsigned x, y;
unsigned flags;
/*
@@ -109,32 +108,15 @@ struct ilo_texture {
bool imported;
- enum pipe_format bo_format;
- struct intel_bo *bo;
-
- enum intel_tiling_mode tiling;
- unsigned long bo_stride; /* distance between two block rows in bytes */
- unsigned long bo_height;
-
- unsigned block_width;
- unsigned block_height;
- unsigned block_size;
-
- /* true if the mip level alignments are stricter */
- bool halign_8, valign_4;
- /* true if space is reserved between layers */
- bool array_spacing_full;
- /* true if samples are interleaved */
- bool interleaved;
+ struct ilo_layout layout;
+ /* XXX thread-safety */
+ struct intel_bo *bo;
struct ilo_texture_slice *slices[PIPE_MAX_TEXTURE_LEVELS];
- struct ilo_texture *separate_s8;
+ struct intel_bo *aux_bo;
- struct {
- struct intel_bo *bo;
- unsigned long bo_stride;
- } hiz;
+ struct ilo_texture *separate_s8;
};
static inline struct ilo_buffer *
@@ -181,11 +163,6 @@ ilo_texture_get_slice(const struct ilo_texture *tex,
return &tex->slices[level][slice];
}
-unsigned
-ilo_texture_get_slice_offset(const struct ilo_texture *tex,
- unsigned level, unsigned slice,
- unsigned *x_offset, unsigned *y_offset);
-
static inline void
ilo_texture_set_slice_flags(struct ilo_texture *tex, unsigned level,
unsigned first_slice, unsigned num_slices,
@@ -222,25 +199,14 @@ static inline bool
ilo_texture_can_enable_hiz(const struct ilo_texture *tex, unsigned level,
unsigned first_slice, unsigned num_slices)
{
- const struct ilo_screen *is = ilo_screen(tex->base.screen);
- const struct ilo_texture_slice *slice =
- ilo_texture_get_slice(tex, level, first_slice);
-
- if (!tex->hiz.bo)
- return false;
-
- /* we can adjust 3DSTATE_DEPTH_BUFFER for the first slice */
- if (level == 0 && first_slice == 0 && num_slices == 1)
- return true;
-
- /* HiZ is non-mipmapped and non-array on GEN6 */
- assert(is->dev.gen > ILO_GEN(6));
-
/*
* Either all or none of the slices in the same level have ILO_TEXTURE_HIZ
* set. It suffices to check only the first slice.
*/
- return (slice->flags & ILO_TEXTURE_HIZ);
+ const struct ilo_texture_slice *slice =
+ ilo_texture_get_slice(tex, level, 0);
+
+ return (tex->aux_bo && (slice->flags & ILO_TEXTURE_HIZ));
}
#endif /* ILO_RESOURCE_H */