Skip to content
  • Matthias Clasen's avatar
    Clip intermediate textures · 3aaea0ef
    Matthias Clasen authored
    In some cases, we were creating gigantic intermediate textures
    only to clip out a small section afterwards (e.g. in the listbox
    example in gtk4-demo). This is wasteful if we apply effects on
    the texture, such as blur or color-matrix. So, clip the dimensions
    of the intermediate texture with the current clip. To make this
    feasible, we move the texture coordinate computation out of the
    pipeline setup functions into the node_as_texture function where
    this clipping happens.
    
    One extra complication we encounter is that the node might get
    clipped away completely. Since Vulkan does not allow to create
    empty images, we bail out in this case and not draw anything.
    
    With these changes, the listbox example in gtk4-demo goes from
    32M pixels of intermediate texture to 320000.
    3aaea0ef