[Mesa-dev] default texture buffer object

Eric Anholt eric at anholt.net
Mon Jan 14 11:12:52 PST 2013


Dave Airlie <airlied at gmail.com> writes:

> On Mon, Jan 14, 2013 at 5:09 AM, Eric Anholt <eric at anholt.net> wrote:
>> Dave Airlie <airlied at gmail.com> writes:
>>
>>> Hi,
>>>
>>> so the gallium state tracker falls over with one of the TBO tests and
>>> I wsa wondering what the correct solution is.
>>>
>>> After the tests run, the test leaves the fragment shader bound, but
>>> has deleted the texture object and the buffer object,
>>> so we just have the ctx->Shared->DefaultTex[TEXTURE_BUFFER_INDEX],
>>> however since this has no buffer object bound
>>> the code falls over.
>>>
>>> Now the docs say the results of sampling from an tbo with no buffer
>>> object is undefined, but crashing isn't probably the right solution
>>>
>>> The intel driver seems to deal with there being no backing BO by
>>> binding an object at address 0 with w/h = 0.
>>
>> I actually had written a test to make sure that rendering with no BO
>> didn't crash, before realizing that you actually were allowed to crash
>> for "undefined" behavior.  I'd be tempted to just fix the test that's
>> unintentionally testing this and if we want to avoid the crash, put in
>> the independent test for it.  Let me know if you want that.
>
> Yeah I suppose that makes more sense, fixing the formats test is just
> a matter of putting
> glUseProgram(0) at the end before we go back to glClear, but it might
> be good to have an
> explicit test to just avoid the crash.

We had a little chat at the office today, and Paul noted that he'd been
interpreting "undefined results" as "returns some unknown value but
certainly doesn't terminate your app", whereas "undefined behavior" is
"your app does unknown stuff after this point, such as terminate", and
there was general agreement.

keithp noted that if you can deref a NULL pointer as a result of
complicated GL state, that's often exploitable, so we'd best fix that
regardless of what the spec says.

I think I'll send out the test I had written.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130114/e309bc47/attachment.pgp>


More information about the mesa-dev mailing list