[Mesa-dev] [PATCH] gallium: remove enum numbers from shader cap queries

Brian Paul brianp at vmware.com
Mon May 5 06:39:11 PDT 2014


On 05/03/2014 07:43 AM, Michel Dänzer wrote:
> On 03.05.2014 22:29, Brian Paul wrote:
>> The enum numbers were just cruft.
>
> I disagree. Nothing's changed about the reason I added them in the first
> place: When a driver is queried for a cap it doesn't know about, it
> prints an error message containing only the numeric value of the cap.
> These explicit numbers make it easy to find out which cap the driver is
> complaining about.

Hi Michel,

In the past when someone added a new enum and softpipe, llvmpipe or svga 
complained at runtime about an unhandled num, it's been pretty easy to 
spot the new one and fix it.

Actually, what you have in the radeon/si drivers is better:  switch 
statements w/out default cases.  So the compiler will warn about the 
missing enum case by name (not number).  That's a more effective way of 
catching unhandled enums earlier.  I should change softpipe, llvmpipe 
and svga to do the same.

How does that sound?  Are there other drivers you're concerned about?

-Brian



More information about the mesa-dev mailing list