Merge lp:~jsjgruber/nux/lp1167018.1 into lp:nux
Status: | Needs review |
---|---|
Proposed branch: | lp:~jsjgruber/nux/lp1167018.1 |
Merge into: | lp:nux |
Diff against target: |
432 lines (+399/-0) 6 files modified
debian/changelog (+46/-0) debian/patches/02-ubuntu-ls-blur-return.patch (+17/-0) debian/patches/03-ubuntu-ls-blur-max-program.patch (+143/-0) debian/patches/04-ubuntu-fix-ls-blur-weight-adjustment.patch (+14/-0) debian/patches/06-ubuntu-simplify-ls-shaders.patch (+175/-0) debian/patches/series (+4/-0) |
To merge this branch: | bzr merge lp:~jsjgruber/nux/lp1167018.1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Pending | ||
Unity Team | Pending | ||
Review via email: mp+181614@code.launchpad.net |
Description of the change
Proposed fix for https:/
The first bzr revision contains three small patches for problems I discovered as I worked. Each is a form of indexing problem.
The second contains the bug fix, which moves as much processing as possible from the per pixel shader to the shader set-up. The actual blur algorithm remains unchanged.
------
The specifics of the moved processing is to precompute a set of vec2(offsets) and weights, the set containing one row per sample needed for the blur, with the offsets normalized to the texture length or width. These are assembled in order for purposes of improving the chance that a subsequent texture sample will find its texture memory available in its cache without rereading memory--speeding up the shader.
The shader program is adjusted to take the above input, add the offset to the current pixels coordinate in texture space, get the texture sample, and add the weighted sample to the accumulating pixel gl_FragColor. On my X1250 R400 hardware each sample needs just three shader instructions, the texture address calculation, the sample, and the weighted sample accumulation.
I have a patch I'm not proposing here to alter the LS blur algorithm to produce a more Gaussian blur, it requires an increase of about 1.5 to the sigma to produce a blur similar in strength to the current one.
Unmerged revisions
- 813. By John S. Gruber
-
debian/
patches/ 06-ubuntu- simplify- ls-shaders. patch :
Radically simplify (and generalize) the linear sampling gaussian
blur shader programs by calculating the coordinates normalized
by texture by width or height in the setup. Express these
as x,y vectors.
Apply them as simply as possible in the shader to save
shader instructions.
Also see that the offsets are given to the shader in
order, providing much improved locality of memory access.
This alone causes much time savings as the hardware
can have subsequent memory locations cached--which is impossible
when going from, e.g., texture coordinate (0,-9) directly to
(0, 9). Instead the order is (0, -9), (0, -8)...(0, 0), (0, 1)...
(0, 8), (0, 9).
Fixes lp: #1167018 - 812. By John S. Gruber
-
Add three patches to debian/patches to resolve problems related to LS
blurring:
02-ubuntu-ls-blur- return. patch
Return the length of the vectors so there is room in the shader
for all of them. This resolves an inconsistency between the
shader, shader setup and function return.
03-ubuntu-ls-blur- max-program. patch
Use the sigma rather than the number of samples required when
calculating the place to store one of the two linear sampling
gaussian blur shader programs in the cache.
The number of cache locations is limited to 11 and the
number of samples required can easily exceed that.
04-ubuntu-fix-ls- blur-weight- adjustment. patch
In the linear sampling gaussian blur calculation of offsets and
weights adjust the last weight as well as all others.
This has been built for testing in ppa:jsjgruber/ ppatwo. See https:/ /launchpad. net/~jsjgruber/ +archive/ ppatwo/ +packages for the build.
To test (on the affected Radeon GPU):
1. Install the associated package.
2. Use ccsm to turn on active or static blur.
3. Press the "Super" or Alt button or bring up the Logout dialog box. Any
of these should bring up a blur of the underlying screen on which to
interact.