<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Jul 10, 2018 at 4:13 AM Andrii Simiklit <<a href="mailto:asimiklit.work@gmail.com">asimiklit.work@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">the difference between GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE<br>
doesn't matter as far as the miptree is concerned;<br>
genX(update_sampler_state) only looks at the<br>
gl_texture_object and not the miptree when determining whether or<br>
not to use normalized coordinates.<br>
<br>
Signed-off-by: Andrii Simiklit <<a href="mailto:andrii.simiklit@globallogic.com" target="_blank">andrii.simiklit@globallogic.com</a>><br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=107117" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=107117</a><br>
<br>
---<br>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 10 +++++++++-<br>
1 file changed, 9 insertions(+), 1 deletion(-)<br>
<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 7d1fa96..dc45a06 100644<br>
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c<br>
@@ -58,6 +58,12 @@ static void *intel_miptree_map_raw(struct brw_context *brw,<br>
<br>
static void intel_miptree_unmap_raw(struct intel_mipmap_tree *mt);<br>
<br>
+static GLenum<br>
+tex_rect_to_tex2d(GLenum val)<br>
+{<br>
+ return (GL_TEXTURE_RECTANGLE == val) ? GL_TEXTURE_2D : val;<br>
+}<br>
+<br>
static bool<br>
intel_miptree_supports_mcs(struct brw_context *brw,<br>
const struct intel_mipmap_tree *mt)<br>
@@ -1320,13 +1326,15 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,<br>
{<br>
struct intel_texture_image *intelImage = intel_texture_image(image);<br>
GLuint level = intelImage->base.Base.Level;<br>
+ GLenum texObjTarget = tex_rect_to_tex2d(mt->target);<br>
+ GLenum mipmapTreeTarget = tex_rect_to_tex2d(image->TexObject->Target);<br>
int width, height, depth;<br>
<br>
/* glTexImage* choose the texture object based on the target passed in, and<br>
* objects can't change targets over their lifetimes, so this should be<br>
* true.<br>
*/<br>
- assert(image->TexObject->Target == mt->target);<br>
+ assert(texObjTarget == mipmapTreeTarget);<br></blockquote><div><br></div><div>If the only use of that helper is in an assert, just put the calls to the helper inside the assert. Otherwise, good job debugging. :-)<br></div><div><br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
mesa_format mt_format = mt->format;<br>
if (mt->format == MESA_FORMAT_Z24_UNORM_X8_UINT && mt->stencil_mt)<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div>