Bug 55149

Summary: Mesa fails to optimize pow(x, vec3(3.0)) where x is a vec3.
Product: Mesa Reporter: Samuel Rødal <srodal>
Component: glsl-compilerAssignee: Ian Romanick <idr>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: medium    
Version: 8.0   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 77547    

Description Samuel Rødal 2012-09-20 15:00:18 UTC
Changing this code to x * x * x gives a noticable performance increase on an r600.

Is this something mesa could automatically optimize?
Comment 1 Samuel Rødal 2012-09-20 15:18:18 UTC
Example change from real-world code:

     1.7 -  if saVolume in attr then fragment+='vec3 norm2 = max(pow((abs(normalize(norm))-0.2)*7.0, vec3(3.0, 3.0, 3.0)), 0.0);norm2 /= dot(norm2, vec3(1.0, 1.0, 1.0));';
     1.8 +  if saVolume in attr then fragment+='vec3 tmpn = (abs(normalize(norm))-0.2)*7.0; vec3 norm2 = max(tmpn*tmpn*tmpn, 0.0);norm2 /= dot(norm2, vec3(1.0, 1.0, 1.0));';
Comment 2 Eero Tamminen 2018-07-11 08:16:27 UTC
(In reply to Samuel Rødal from comment #0)
> Changing this code to x * x * x gives a noticable performance increase on an
> r600.
> 
> Is this something mesa could automatically optimize?

Samuel, your bug is really old, from 2012, is this still an issue?
Comment 3 Dylan Baker 2018-08-15 21:24:07 UTC
The bug may well exist, or it might be fixed by SB. The bug is 6 years old and the original reporting isn't responding. Closing.

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.