[Mesa-dev] [PATCH 3/5] mesa: Make the gl_constant_value's bool occupy the same space as float/int.

Dan McCabe zen3d.linux at gmail.com
Sat Aug 20 15:10:18 PDT 2011


On 08/20/2011 01:30 PM, Bryan Cain wrote:
> On 08/20/2011 03:05 PM, Dan McCabe wrote:
>> What are the implications for other architectures that support doubles?
>
> I don't see what you mean.  gl_constant_value doesn't support doubles yet.

"Yet" - that is the operative word.

You can buy GPUs that support doubles today. Therefore, double support 
should be on our radar (it appears to be on Eric's radar, based on his 
commit comment). And we should understand what the implications are for 
our code. Clearly, I don't understand the implications; if I did, I 
wouldn't have asked. But perhaps Eric might.

There are a couple of possible answers.

"I don't know" - OK, but at least let's ask the question and start 
thinking about it's answer.

"No impact" - I like that answer.

"It affects this, and this, and this" - While not ideal, at least we 
then know what to do in the future and prepare ourselves for that future.

cheers, danm

>
> Bryan
>
>>
>> On 08/19/2011 05:56 PM, Eric Anholt wrote:
>>> At least for Intel, all our uniform components are of uint32_t size,
>>> either
>>> float or signed or unsigned int.  For uploading uniform data in the
>>> driver,
>>> it's much easier to upload a full dword per uniform element instead
>>> of trying
>>> to pick out the bool byte and then fill in the top 3 bytes of pad
>>> with 0.
>>> ---
>>>    src/mesa/program/prog_parameter.h |    2 +-
>>>    1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/src/mesa/program/prog_parameter.h
>>> b/src/mesa/program/prog_parameter.h
>>> index 1a5ed34..4c2773a 100644
>>> --- a/src/mesa/program/prog_parameter.h
>>> +++ b/src/mesa/program/prog_parameter.h
>>> @@ -53,7 +53,7 @@
>>>    typedef union gl_constant_value
>>>    {
>>>       GLfloat f;
>>> -   GLboolean b;
>>> +   GLint b;
>>>       GLint i;
>>>       GLuint u;
>>>    } gl_constant_value;



More information about the mesa-dev mailing list