[Mesa-dev] [PATCH 6/6] mesa/main: fix incorrect detph-error

Erik Faye-Lund erik.faye-lund at collabora.com
Mon Nov 26 12:29:03 UTC 2018


On Mon, 2018-11-26 at 13:16 +0100, Juan A. Suarez Romero wrote:
> On Mon, 2018-11-26 at 13:13 +0100, Erik Faye-Lund wrote:
> > On Mon, 2018-11-26 at 13:06 +0100, Juan A. Suarez Romero wrote:
> > > On Thu, 2018-11-22 at 17:48 +0100, Erik Faye-Lund wrote:
> > > > If glGetTexImage or glGetnTexImage is called with a level that
> > > > doesn't
> > > > exist, we get an error message on this form:
> > > > 
> > > > Mesa: User error: GL_INVALID_VALUE in glGetTexImage(depth = 0)
> > > > 
> > > > This is clearly nonsensical, because these APIs don't even have
> > > > a
> > > > depth-parameter. The reason is that get_texture_image_dims()
> > > > return
> > > > all-zero dimensions for non-existent texture-images, and we go
> > > > on
> > > > to
> > > > validate these dimensions as if they were user-input, because
> > > > glGetTextureSubImage requires checking.
> > > > 
> > > > So let's split this logic in two, so glGetTextureSubImage can
> > > > have
> > > > stricter input-validation. All arguments that are no longer
> > > > validated
> > > > are generated internally by mesa, so there's no use in
> > > > validating
> > > > them.
> > > > 
> > > > Fixes: 42891dbaa12 "gettextsubimage: verify zoffset and depth
> > > > are
> > > > correct"
> > > > Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
> > > 
> > > This patch fixes 42891dbaa12 "gettextsubimage: verify zoffset and
> > > depth are
> > > correct" which is in 18.2 branch.
> > > 
> > > Nevertheless, I'm going to reject this patch as it requires other
> > > patches not in
> > > the branch, at least 854202f70e6 ("mesa/main: factor out tex-
> > > image
> > > error-
> > > checking") and 84bc5738401 ("mesa/main: factor out common error-
> > > checking");
> > > maybe others too.
> > > 
> > > 
> > > If you think the patch must be added, including 854202f70e6 and
> > > 84bc5738401,
> > > then let me know. It could be that we are a bit late to add them
> > > in
> > > the next
> > > release; but I'll ensure it will be added in the after one.
> > > 
> > 
> > I'm OK with not back-porting these; I don't think the consequences
> > are
> > serious enough to warrant it. I just wanted to include the fixes-
> > tags
> > to avoid losing the information.
> > 
> 
> Nice.
> 
> I did include 38bbb61252a ("mesa/main: remove bogus error for zero-
> sized
> images") though, as this applies cleanly in the branch.

Yeah, that should be fine. The other patch depends on some of the other
patches to behave correctly, but 38bbb61252a should be free-standing
as-is.





More information about the mesa-dev mailing list