<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 18, 2015 at 5:45 PM, Laura Ekstrand <span dir="ltr"><<a href="mailto:laura@jlekstrand.net" target="_blank">laura@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes all of the failures in arb_direct_state_access/gettextureimage-targets<br>
except for GL_TEXTURE_1D_ARRAY PBO. Previously, the miptree for meta pbo<br>
uploads and downloads was not getting initialized correctly.<br>
---<br>
src/mesa/drivers/common/meta_tex_subimage.c | 8 ++++++--<br>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 +-<br>
src/mesa/drivers/dri/i965/intel_tex.c | 3 ++-<br>
src/mesa/main/dd.h | 1 +<br>
4 files changed, 10 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c<br>
index 68c8273..6196283 100644<br>
--- a/src/mesa/drivers/common/meta_tex_subimage.c<br>
+++ b/src/mesa/drivers/common/meta_tex_subimage.c<br>
@@ -51,7 +51,7 @@ create_texture_for_pbo(struct gl_context *ctx, bool create_pbo,<br>
{<br>
uint32_t pbo_format;<br>
GLenum internal_format;<br>
- unsigned row_stride;<br>
+ unsigned row_stride, image_stride;<br>
struct gl_buffer_object *buffer_obj;<br>
struct gl_texture_object *tex_obj;<br>
struct gl_texture_image *tex_image;<br>
@@ -74,6 +74,8 @@ create_texture_for_pbo(struct gl_context *ctx, bool create_pbo,<br>
pixels = _mesa_image_address3d(packing, pixels,<br>
width, height, format, type, 0, 0, 0);<br>
row_stride = _mesa_image_row_stride(packing, width, format, type);<br>
+ image_stride = _mesa_image_image_stride(packing, width, height, format,<br>
+ type);<br>
<br>
if (_mesa_is_bufferobj(packing->BufferObj)) {<br>
*tmp_pbo = 0;<br>
@@ -100,8 +102,9 @@ create_texture_for_pbo(struct gl_context *ctx, bool create_pbo,<br>
_mesa_GenTextures(1, tmp_tex);<br>
tex_obj = _mesa_lookup_texture(ctx, *tmp_tex);<br>
tex_obj->Target = depth > 1 ? GL_TEXTURE_2D_ARRAY : GL_TEXTURE_2D;<br>
+ _mesa_initialize_texture_object(ctx, tex_obj, *tmp_tex, tex_obj->Target);<br>
tex_obj->Immutable = GL_TRUE;<br>
- _mesa_initialize_texture_object(ctx, tex_obj, *tmp_tex, GL_TEXTURE_2D);<br>
+ tex_obj->NumLayers = 1;<br></blockquote><div><br></div><div>Why are you setting NumLayers to 1? If this is the number of array slices, shouldn't it be set to depth or something?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
internal_format = _mesa_get_format_base_format(pbo_format);<br>
<br>
@@ -114,6 +117,7 @@ create_texture_for_pbo(struct gl_context *ctx, bool create_pbo,<br>
buffer_obj,<br>
(intptr_t)pixels,<br>
row_stride,<br>
+ image_stride,<br>
read_only)) {<br>
_mesa_DeleteTextures(1, tmp_tex);<br>
_mesa_DeleteBuffers(1, tmp_pbo);<br>
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c<br>
index 0e3888f..b46532d 100644<br>
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c<br>
@@ -724,7 +724,7 @@ intel_miptree_create_for_bo(struct brw_context *brw,<br>
mt = intel_miptree_create_layout(brw, target, format,<br>
0, 0,<br>
width, height, depth,<br>
- true, 0, false);<br>
+ true, 0, true);<br></blockquote><div><br></div><div>It's not at all obvious from the commit message that this is happening or what it is. Since it lives inside intel_miptree_create_bo, it should probably be its own commit with its own commit message.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
if (!mt) {<br>
free(mt);<br>
return mt;<br>
diff --git a/src/mesa/drivers/dri/i965/intel_tex.c b/src/mesa/drivers/dri/i965/intel_tex.c<br>
index 2d3009a..3a0c09a 100644<br>
--- a/src/mesa/drivers/dri/i965/intel_tex.c<br>
+++ b/src/mesa/drivers/dri/i965/intel_tex.c<br>
@@ -305,6 +305,7 @@ intel_set_texture_storage_for_buffer_object(struct gl_context *ctx,<br>
struct gl_buffer_object *buffer_obj,<br>
uint32_t buffer_offset,<br>
uint32_t row_stride,<br>
+ uint32_t image_stride,<br>
bool read_only)<br>
{<br>
struct brw_context *brw = brw_context(ctx);<br>
@@ -334,7 +335,7 @@ intel_set_texture_storage_for_buffer_object(struct gl_context *ctx,<br>
<br>
drm_intel_bo *bo = intel_bufferobj_buffer(brw, intel_buffer_obj,<br>
buffer_offset,<br>
- row_stride * image->Height);<br>
+ image_stride * image->Depth);<br>
intel_texobj->mt =<br>
intel_miptree_create_for_bo(brw, bo,<br>
image->TexFormat,<br>
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h<br>
index ec8662b..9de08e2 100644<br>
--- a/src/mesa/main/dd.h<br>
+++ b/src/mesa/main/dd.h<br>
@@ -429,6 +429,7 @@ struct dd_function_table {<br>
struct gl_buffer_object *bufferObj,<br>
uint32_t buffer_offset,<br>
uint32_t row_stride,<br>
+ uint32_t image_stride,<br>
bool read_only);<br>
<br>
/**<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>