OSDN Git Service

anv/pipeline: Lower pipeline layouts etc. after linking
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 7 Aug 2018 22:47:54 +0000 (15:47 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 17 Aug 2018 15:50:28 +0000 (10:50 -0500)
commitd9ea015ced39bab7fb32cc772307c4fb647403bd
tree00af3fbac7c188a801f5eee67ae3a6d8eb5284b7
parentf210a5f4bb868ad5ae70c5fb3912f3a241305666
anv/pipeline: Lower pipeline layouts etc. after linking

This allows us to use the link-optimized shader for determining binding
table layouts and, more importantly, URB layouts.  For apps running on
DXVK, this is extremely important as DXVK likes to declare max-size
inputs and outputs and this lets is massively shrink our URB space
requirements.

VkPipeline-db results (Batman pipelines only) on KBL:

    total instructions in shared programs: 820403 -> 790008 (-3.70%)
    instructions in affected programs: 273759 -> 243364 (-11.10%)
    helped: 622
    HURT: 42

    total spills in shared programs: 8449 -> 5212 (-38.31%)
    spills in affected programs: 3427 -> 190 (-94.46%)
    helped: 607
    HURT: 2

    total fills in shared programs: 11638 -> 6067 (-47.87%)
    fills in affected programs: 5879 -> 308 (-94.76%)
    helped: 606
    HURT: 3

Looking at shaders by hand, it makes the URB between TCS and TES go from
containing 32 per-vertex varyings per tessellation shader pair to a more
reasonable 8-12.  For a 3-vertex patch, that's at least half the URB
space no matter how big the patch section is.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/intel/vulkan/anv_pipeline.c