Skip to content
  • Timothy Arceri's avatar
    glsl: pass mem_ctx to constant_expression_value(...) and friends · 77f52212
    Timothy Arceri authored
    The main motivation for this is that threaded compilation can fall
    over if we were to allocate IR inside constant_expression_value()
    when calling it on a builtin. This is because builtins are shared
    across the whole OpenGL context.
    
    f81ede46
    
     worked around the problem by cloning the entire
    builtin before constant_expression_value() could be called on
    it. However cloning the whole function each time we referenced
    it lead to a significant reduction in the GLSL IR compiler
    performance. This change along with the following patch
    helps fix that performance regression.
    
    Other advantages are that we reduce the number of calls to
    ralloc_parent(), and for loop unrolling we free constants after
    they are used rather than leaving them hanging around.
    
    Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
    77f52212