[Mesa-dev] [PATCH 22/26] glsl: Store ir_variable::ir_type in 8 bits instead of 32

Matt Turner mattst88 at gmail.com
Fri Jul 18 16:44:03 PDT 2014


On Fri, Jul 18, 2014 at 4:33 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Mon, Jul 14, 2014 at 3:48 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> No change Valgrind massif results for a trimmed apitrace of dota2.
>>
>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>> ---
>>  src/glsl/ir.h | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/glsl/ir.h b/src/glsl/ir.h
>> index ee42857..5c565ff 100644
>> --- a/src/glsl/ir.h
>> +++ b/src/glsl/ir.h
>> @@ -88,12 +88,13 @@ enum ir_node_type {
>>   */
>>  class ir_instruction : public exec_node {
>>  private:
>> -   enum ir_node_type ir_type;
>
> Mark this with the packed attribute and drop the previous patch.

Oh, you're doing it this way because MSVC isn't going to support the
packed attribute, and you want to store stuff in the padding, which is
sized by knowledge of how the struct is going to be laid out.

Like you said, the last patches are contentious. If we don't store
things in the padding, we should definitely just mark this with
packed. If we do store things in the padding, I'm still not sure we
should worry about making it optimal on MSVC.


More information about the mesa-dev mailing list