<div dir="ltr"><div>Ilia, the patch is OK if GL_STENCIL_INDEX is not allowed, right?</div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 27, 2019 at 9:24 PM Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">By the way, I took the liberty of composing a test which fails with<br>
current mesa, and I'm pretty sure it continues to fail with this<br>
patch. It does pass if I just make it a GLubyte like all the other<br>
instances of the code already do.<br>
<br>
Piglit test: <a href="https://patchwork.freedesktop.org/patch/327460/" rel="noreferrer" target="_blank">https://patchwork.freedesktop.org/patch/327460/</a><br>
<br>
On Tue, Aug 27, 2019 at 7:37 PM Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>> wrote:<br>
><br>
> I don't think the original author was included -- CC was probably<br>
> stripped by the ML. Adding here.<br>
><br>
> On Tue, Aug 27, 2019 at 6:49 PM Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
> ><br>
> > Yes, but if the original author doesn't reply, I'd like to push this.<br>
> ><br>
> > Marek<br>
> ><br>
> > On Thu, Aug 15, 2019 at 8:01 PM Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>> wrote:<br>
> >><br>
> >> Subtle. The source format *can* be 64-bit, by the way, but if it's<br>
> >> GL_DEPTH_COMPONENT it may well be 32-bit.<br>
> >><br>
> >> But what if it's GL_STENCIL_INDEX -- could it not be 1-byte? IOW,<br>
> >> should this just be a char *, and use byte addressing and be done with<br>
> >> it?<br>
> >><br>
> >> On Thu, Aug 15, 2019 at 7:56 PM Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
> >> ><br>
> >> > From: Jiadong Zhu <<a href="mailto:Jiadong.Zhu@amd.com" target="_blank">Jiadong.Zhu@amd.com</a>><br>
> >> ><br>
> >> > _mesa_texstore_z32f_x24s8 calculates source rowStride at a<br>
> >> > pace of 64-bit, this will make inaccuracy offset if the width<br>
> >> > of src image is an odd number. Modify src pointer to int_32* as<br>
> >> > source image format is gl_float which is 32-bit per pixel.<br>
> >> ><br>
> >> > Signed-off-by: Jiadong Zhu <<a href="mailto:Jiadong.Zhu@amd.com" target="_blank">Jiadong.Zhu@amd.com</a>><br>
> >> > Signed-off-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
> >> > ---<br>
> >> > src/mesa/main/texstore.c | 6 +++---<br>
> >> > 1 file changed, 3 insertions(+), 3 deletions(-)<br>
> >> > mode change 100644 => 100755 src/mesa/main/texstore.c<br>
> >> ><br>
> >> > diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c<br>
> >> > old mode 100644<br>
> >> > new mode 100755<br>
> >> > index 2913d4bc067..207695041a7<br>
> >> > --- a/src/mesa/main/texstore.c<br>
> >> > +++ b/src/mesa/main/texstore.c<br>
> >> > @@ -531,35 +531,35 @@ _mesa_texstore_s8(TEXSTORE_PARAMS)<br>
> >> > return GL_TRUE;<br>
> >> > }<br>
> >> ><br>
> >> ><br>
> >> > static GLboolean<br>
> >> > _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)<br>
> >> > {<br>
> >> > GLint img, row;<br>
> >> > const GLint srcRowStride<br>
> >> > = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType)<br>
> >> > - / sizeof(uint64_t);<br>
> >> > + / sizeof(int32_t);<br>
> >> ><br>
> >> > assert(dstFormat == MESA_FORMAT_Z32_FLOAT_S8X24_UINT);<br>
> >> > assert(srcFormat == GL_DEPTH_STENCIL ||<br>
> >> > srcFormat == GL_DEPTH_COMPONENT ||<br>
> >> > srcFormat == GL_STENCIL_INDEX);<br>
> >> > assert(srcFormat != GL_DEPTH_STENCIL ||<br>
> >> > srcType == GL_UNSIGNED_INT_24_8 ||<br>
> >> > srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);<br>
> >> ><br>
> >> > /* In case we only upload depth we need to preserve the stencil */<br>
> >> > for (img = 0; img < srcDepth; img++) {<br>
> >> > uint64_t *dstRow = (uint64_t *) dstSlices[img];<br>
> >> > - const uint64_t *src<br>
> >> > - = (const uint64_t *) _mesa_image_address(dims, srcPacking, srcAddr,<br>
> >> > + const int32_t *src<br>
> >> > + = (const int32_t *) _mesa_image_address(dims, srcPacking, srcAddr,<br>
> >> > srcWidth, srcHeight,<br>
> >> > srcFormat, srcType,<br>
> >> > img, 0, 0);<br>
> >> > for (row = 0; row < srcHeight; row++) {<br>
> >> > /* The unpack functions with:<br>
> >> > * dstType = GL_FLOAT_32_UNSIGNED_INT_24_8_REV<br>
> >> > * only write their own dword, so the other dword (stencil<br>
> >> > * or depth) is preserved. */<br>
> >> > if (srcFormat != GL_STENCIL_INDEX)<br>
> >> > _mesa_unpack_depth_span(ctx, srcWidth,<br>
> >> > --<br>
> >> > 2.17.1<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>