**Work-in-Progress**
Add `dual_kawase` to configuration and argument parsing. Allow `kawase`
for backward compatibility. Add `--blur-strength` parameter for
blur-method `dual_kawase`.
Update documentation to reflect the new blur-method and parameters.
All names start with underscore are reserved in C.
Also just testing out the language server's renaming feature.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
We currently don't use it for anything. We could add a CI pass in the
future.
We don't enable clang-analyzer checks. The checks enabled here should
mostly be syntax/style linting only, and should be cheap to run.
clang-analyzer checks are usually compute-intensive, and can easily be run
separately anyway, with scan-build and such.
The list of checks definitely isn't final.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This is a workaround for #301. This doesn't fix the bug, but by
allocating X resources much less frequently, this should make the
bug almost never happen.
Also, it might generally be a good idea to not create/destroy X
resources so often. (XFixes Region accounts for >99% of the resource
creations/destructions)
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Two problems:
1) the regex used to match the wid in the window tree can match the wid
appearing in window titles as well.
2) instead of picking the parent window of the target window to set
transparency, a random window which is listed just below the target
window will be chosen. not sure why was there a + 1.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Create pictures used for bluring with REPEAT attribute set to PAD (same logic
as GL_CLAMP_TO_EDGE in OpenGL). Fixes darkening at the screen edges with
larger blur radii caused by sampling out of texture bounds.
Related: 4b0ff37b36
Make use of hardware linear interpolation in a GPU to sample 2 pixels
with a single texture access inside the blur shaders by sampling between
both pixels based on their relative weight.
This is significantly easier for a single dimension as 2D bilinear
filtering would raise additional constraints on the kernels (not single
zero-entries, no zero-diagonals, ...) which require additional checks
with limited improvements. Therfore, only use interpolation along the
larger dimension should be a sufficient improvement.
Using this will effectively half the number of texture accesses and
additions needed for a kernel. E.g. a 1D-pass of the gaussian blur
with radius 15 will only need 16 samples instead of 31.
Create texture with GL_LINEAR filtering and GL_CLAMP_TO_EDGE wrapping. Change
`texelFetch()`-call in fragement shader to `texture2D()` to be taken into
account. This requires supplying the size of a pixel in normalized texture
coordinates via an additional uniform.
Fixes darkening at the screen edges with larger blur radii caused by
sampling coordinates being out of texture bounds. This is undefined behaviour
unless the context has set the flag *GL_ARB_robust_buffer_access_behaviour*,
in which case "zero"-pixels are returned (i.e. black). Current behaviour
seems to depend on the driver.
Call `glViewport()` once when initializing the backend with the maximum
supported dimensions. Since all shaders are equipped with the
corresponding projection matrix, the viewport does not have to be
updated prior to each draw call.
Related: a7bd48f5ab
Set viewport in `gl_average_texture_color()` to global `vp_width` and
`vp_height` as the projection matrix has been initialized to these dimensions
as well.
Related: a7bd48f5ab
- Query maximum supported dimensions of `glViewport()` when initializing
so we don't have to worry about differently sized textures when
rendering (usually the same as the maximum supported texture size, but
dependend on the driver).
- Set projection matrix in all shaders at startup to queried viewport
dimensions. Allows using screen coordinates for all vertex positions
without having to keep track of framebuffer dimensions.
- Follow recommendations and set `glViewport()` to queried maximum dimensions
for each draw call (`glDraw*()`, `glClear()`).
Related: #349
xrender-sync-fence might be enabled after init because of driver
detection. Instead of creating it on demand, just always create it as
this is simpler.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
We use the __GL_YIELD=usleep workaround when we detect the NVIDIA
driver, so we could use glFinish without the NVIDIA driver taking all
the CPU.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Because it needs to be cleared when we reset, so we don't use a freed
fbconfig across reset.
Related: #381
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
GLX context is not destroyed immediately after calling
glXDestroyContext. It is only destroyed when it's no longer
being used. So make sure to release the context
Fixes#381
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>