Bug 99633

Summary: rasterizer/core/clip.h:279:49: error: ‘const struct API_STATE’ has no member named ‘linkageCount’
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Drivers/Gallium/swrAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium Keywords: bisected
Version: 13.0   
Hardware: x86-64 (AMD64)   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 99517    

Description Vinson Lee 2017-02-01 23:32:20 UTC
mesa: 9c45bb731c97d1f02f83b872c67b2c1b04ec3a41 (master 17.1.0-devel)

  CXX      rasterizer/core/libswrAVX_la-api.lo
In file included from rasterizer/core/api.cpp:43:0:
./rasterizer/core/clip.h: In member function ‘int Clipper<NumVertsPerPrim>::ClipScalar(PA_STATE&, uint32_t, float*, float*)’:
./rasterizer/core/clip.h:279:49: error: ‘const struct API_STATE’ has no member named ‘linkageCount’
         uint32_t numScalarAttribs = this->state.linkageCount * 4;
                                                 ^~~~~~~~~~~~
./rasterizer/core/clip.h:284:52: error: ‘const struct API_STATE’ has no member named ‘linkageMask’
         uint32_t tmpLinkage = uint32_t(this->state.linkageMask);
                                                    ^~~~~~~~~~~
./rasterizer/core/clip.h:289:73: error: ‘const struct API_STATE’ has no member named ‘linkageMap’
             uint32_t inputSlot = VERTEX_ATTRIB_START_SLOT + this->state.linkageMap[mapIdx++];
                                                                         ^~~~~~~~~~
Comment 1 Bruce Cherniak 2017-02-01 23:50:17 UTC
What environment are you compiling under (os, compiler (gcc, icc, clang), and version)?

Clip::ClipScalar() looks like it might be dead code and should be removed.
Comment 2 Vinson Lee 2017-02-01 23:57:10 UTC
Fedora 26

$ gcc --version
gcc (GCC) 7.0.1 20170128 (Red Hat 7.0.1-0.3)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 3 Emil Velikov 2017-02-02 00:18:30 UTC
The member in question was removed with

commit efdaf5fa3e74ca4f3d9217dc6955aef6dc698a68
Author: Tim Rowley <timothy.o.rowley@intel.com>
Date:   Tue Jul 12 15:03:42 2016 -0600

    swr: [rasterizer] attribute swizzling and linkage
    
    Add support for enhanced attribute swizzling. Currently supports constant
    source overrides to handle PrimitiveID support. No support yet for input
    select swizzling or wrap shortest. Removes obsoleted linkageMask and
    associated code.


It have gone unnoticed, most likely, since the function Clipper::ClipScalar() [which references the member] is unused, so the optimiser would have dropped it all together without even attempting to compile it.
Comment 4 Bruce Cherniak 2017-02-02 17:48:27 UTC
I'm create a gcc 7 environment to see if there are other problems behind this.  Then, I'll go ahead and remove the offending code and try to fix any other problems I find.
Comment 5 Bruce Cherniak 2017-02-02 17:53:35 UTC
Then I'm going to have another cup of coffee in hopes that it improves my grammar.  :-/
Comment 6 Bruce Cherniak 2017-02-02 21:20:15 UTC
Patch has been generated:  https://patchwork.freedesktop.org/patch/136674/
Comment 7 Bruce Cherniak 2017-02-07 00:26:52 UTC
Patch has been pushed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.