[Mesa-dev] [PATCH] radeonsi: fix an off-by-one error in the bounds check for max_vertices

Nicolai Hähnle nhaehnle at gmail.com
Wed Dec 7 10:09:53 UTC 2016


On 07.12.2016 04:47, Michel Dänzer wrote:
> On 07/12/16 05:06 AM, Nicolai Hähnle wrote:
>> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>>
>> The spec actually says that calling EmitStreamVertex is undefined when
>> you exceed max_vertices. But we do need to avoid trampling over memory
>> outside the GSVS ring.
>
> Why "but"? It still works up to max_vertices with your fix, right? Anyway,

When the spec says "in situation XYZ, behavior is undefined", you often 
don't actually have to check whether situation XYZ occurs at all. In 
that sense "but": undefined behavior in OpenGL usually isn't meant to 
include crashes or GPU hangs, which could happen from writing outside of 
buffer bounds. So we do need to check.


> Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

Thanks!


More information about the mesa-dev mailing list