Summary: | opt_dead_code_local removing assignments to array elements | ||
---|---|---|---|
Product: | Mesa | Reporter: | Chris Wolfe <cwolfe> |
Component: | glsl-compiler | Assignee: | Ian Romanick <idr> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | eric, fjhmesabug |
Version: | git | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 67224 |
Description
Chris Wolfe
2012-08-08 16:09:36 UTC
Re-aiming at the list, guess the CC isn't automatic. Please see the bug for context. Summary: GLSL optimizer mangles "vec4 tmp; tmp[3] = 1.0; tmp.xyz = some_3d_vector;" Walked through the optimization behavior in opt_dead_local_code (and friends) again. Feels like the best fix is to consider assignment to a deference_array of a vector as a write to an unknown component. That way the assignment will get removed only if there is an overriding whole_variable_written to the vector. If the array index is constant it will get converted to a swizzle (vec_index_to_swizzle), and hopefully become a deference_variable for the next pass (haven't found the code for that yet). My current guess is the optimization pass is happening before lowering tmp[3] to tmp.w. I'll look into it. I just committed some piglit tests that I wrote back in January. Since the ir_triop_vector_insert / ir_binop_vector_extract work, all of the piglit tests pass. I believe this issue is fixed as of (approximately) a61a0dbe. If the issue persists, please re-open the bug. |
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.