[Mesa-dev] [PATCH 1/2] i965: Push intel_get_texture_alignment_unit call into brw_miptree_layout
Kenneth Graunke
kenneth at whitecape.org
Tue Jul 2 16:06:12 PDT 2013
intel_miptree_create_layout() calls intel_get_texture_alignment_unit()
and then immediately calls brw_miptree_layout(). There are no other
callers.
intel_get_texture_alignment_unit() populates the miptree's alignment
unit fields, which are used by brw_miptree_layout() to determine where
to place each miplevel. Since brw_miptree_layout() needs those to be
present, it makes sense to have it initialize them as the first step.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_tex_layout.c | 3 +++
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 3 ---
2 files changed, 3 insertions(+), 3 deletions(-)
Applies to my last 7 patch series (which applies to the 3 patch series
before that). Sorry! Or, get the 'tidying' branch of ~kwg/mesa.
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index 6fe4398..f4029c4 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -212,6 +212,9 @@ brw_miptree_layout_texture_3d(struct intel_context *intel,
void
brw_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree *mt)
{
+ intel_get_texture_alignment_unit(intel, mt->format,
+ &mt->align_w, &mt->align_h);
+
switch (mt->target) {
case GL_TEXTURE_CUBE_MAP:
if (intel->gen == 4) {
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index e9b2464..bebfe51 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -400,9 +400,6 @@ intel_miptree_create_layout(struct intel_context *intel,
}
}
- intel_get_texture_alignment_unit(intel, mt->format,
- &mt->align_w, &mt->align_h);
-
brw_miptree_layout(intel, mt);
return mt;
--
1.8.3.1
More information about the mesa-dev
mailing list