<html><head></head><body><div><br></div><div>Ping. This patch fixes a significant amount of CTS tests and</div><div>it will be nice to have it reviewed.</div><div><br></div><div>On sáb, 2016-09-03 at 03:04 +0200, Antia Puentes wrote:</div><blockquote type="cite"><div>- Fixes CTS tests:</div><div><br></div><div>* GL44-CTS.shader_image_size.advanced-nonMS-cs-float</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-cs-int</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-cs-uint</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-gs-float</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-gs-int</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-gs-uint</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-tes-float</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-tes-int</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-tes-uint</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-vs-float</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-vs-int</div><div>* GL44-CTS.shader_image_size.advanced-nonMS-vs-uint</div><div><br></div><div>v1: (written by Dave Airlie) Always shift height images for levels.</div><div>Fixed the CTS test.</div><div><br></div><div>v2: Only shift height if the texture is not an 1D_ARRAY,</div><div>it fixes assertion in GL44-CTS.texture_view.gettexparameter</div><div>due to the original patch (Antia).</div><div><br></div><div>v3: Remove the loop. Do not shift height either for 1D textures.</div><div>Use an explicit switch and add an assertion (levels == 0) for</div><div>multisampled textures (Jason).</div><div><br></div><div>v4: Rectangle textures can not have levels either (Ilia Mirkin).</div><div><br></div><div>Signed-off-by: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>></div><div>Signed-off-by: Antia Puentes <<a href="mailto:apuentes@igalia.com">apuentes@igalia.com</a>></div><div>---</div><div> src/mesa/drivers/dri/i965/intel_tex_image.c | 27 +++++++++++++++++++++------</div><div> 1 file changed, 21 insertions(+), 6 deletions(-)</div><div><br></div><div>diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c</div><div>index 7affe08..65962eb 100644</div><div>--- a/src/mesa/drivers/dri/i965/intel_tex_image.c</div><div>+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c</div><div>@@ -47,12 +47,27 @@ intel_miptree_create_for_teximage(struct brw_context *brw,</div><div> DBG("%s\n", __func__);</div><div> </div><div> /* Figure out image dimensions at start level. */</div><div>- for (i = intelImage->base.Base.Level; i > 0; i--) {</div><div>- width <<= 1;</div><div>- if (height != 1)</div><div>- height <<= 1;</div><div>- if (intelObj->base.Target == GL_TEXTURE_3D)</div><div>- depth <<= 1;</div><div>+ switch(intelObj->base.Target) {</div><div>+ case GL_TEXTURE_2D_MULTISAMPLE:</div><div>+ case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:</div><div>+ case GL_TEXTURE_RECTANGLE:</div><div>+ assert(intelImage->base.Base.Level == 0);</div><div>+ break;</div><div>+ case GL_TEXTURE_3D:</div><div>+ depth <<= intelImage->base.Base.Level;</div><div>+ /* Fall through */</div><div>+ case GL_TEXTURE_2D:</div><div>+ case GL_TEXTURE_2D_ARRAY:</div><div>+ case GL_TEXTURE_CUBE_MAP:</div><div>+ case GL_TEXTURE_CUBE_MAP_ARRAY:</div><div>+ height <<= intelImage->base.Base.Level;</div><div>+ /* Fall through */</div><div>+ case GL_TEXTURE_1D:</div><div>+ case GL_TEXTURE_1D_ARRAY:</div><div>+ width <<= intelImage->base.Base.Level;</div><div>+ break;</div><div>+ default:</div><div>+ unreachable("Unexpected target");</div><div> }</div><div> </div><div> /* Guess a reasonable value for lastLevel. This is probably going</div></blockquote></body></html>