| Age | Commit message (Collapse) | Author |
|
Continues the migration of the shader generators over to fmt.
After this, all that remains in the Ubershader pixel generator.
|
|
Rather than expose the bounding box members directly, we can instead
provide an interface for code to use. This makes it nicer to transition
from global data, as the interface function names are already in
place.
|
|
VideoCommon/PixelShaderGen: Make look-up table arrays immutable where applicable
|
|
Zero-initialization zeroes out all members and padding bits, so this is
safe to do. While we're at it, also add static assertions that enforce
the necessary requirements of a UID type explicitly within the ShaderUid
class.
This way, we can remove several memset calls around the shader
generation code that makes sure the underlying UID data is zeroed out.
Now our ShaderUid class enforces this for us, so we don't need to care about
it at the usage sites.
|
|
This is likely a remnant of the initial transition to clang-format.
|
|
Many of the arrays defined within this file weren't declared as
immutable, which can inhibit the strings being put into the read-only
segment. We can declare them constexpr to make them immutable.
While we're at it, we can use std::array, to allow bounds conditional
bounds checking with standard libraries. The declarations can also be
shortened in the future when all platform toolchain versions we use
support std::array deduction guides. Currently macOS and FreeBSD
builders fail on them.
|
|
one line
Them's the code formatting rules.
|
|
|
|
If bounding box is enabled when a UID cache is created, then later disabled,
we shouldn't emit the bounding box portion of the shader.
Fixes pipeline creation errors on D3D12 backend for this case.
|
|
|
|
|
|
|
|
|
|
Doing so causes the Adreno driver to choke and spew errors about
too many output locations/components, when clearly we're under
the limit.
|
|
Removes the clipPos varying unless slow-depth is used, and the
clipDistance varyings if geometry shaders are not used.
|
|
The Metal shader compiler fails to compile the atomic instructions
when operating on individual components of a vector. Spltting it
into four variables shouldn't make any difference for other
platforms, as they are accessed independently.
|
|
floatindex is clamped to the range [0, 9]. For non-negative numbers
floor() is equivalent to trunc(). Truncation happens implicitly when
converting to uint, so the floor() is unnecessary.
|
|
|
|
AMD appears to have since fixed this in their driver, and it makes
shadergen ever so slightly less messy.
|
|
This was causing a warning in the shader compiler, as the rgb components
were not initialized. Which shouldn't be an issue, as the rgb is not
used in the blend equation, only the alpha. However, the lack of
initialization causes crashes in Intel's D3D shader compiler, so we'll
play nice and initialize all the channels.
|
|
This may have been causing issues for D3D10 hardware, where logic op was
not supported.
|
|
|
|
|
|
Puts the true condition body first instead of the false one for better
reading.
|
|
The outer conditional executes only whenever destination alpha is used.
|
|
|
|
Macros should be all upper-cased. This is also kind of a wart that's
been sticking out for quite a while now (we avoid prefixing
underscores).
|
|
|
|
Tested on a linux Intel Skylake integrated graphics with
blend_func_extended force-disabled, as it's the only platform I have
that doesn't crash with ubershaders and supports fb_fetch
|
|
It seems it doesn't like modifying inout variables in place - so instead
use a temporary for ocol0/ocol1 and only write them once at the end of
the shader
|
|
For some GLES drivers that don't support dual-source blending, but do
support GL_EXT_shader_framebuffer_fetch, this might be useful.
|
|
Cel-damage uses the color from the lighting stage of the vertex pipeline
as texture coordinates, but sets numColorChans to zero.
We now calculate the colors in all cases, but override the color before
writing it from the vertex shader if numColorChans is set to a lower value.
|
|
|
|
Currently, this is only the logic op bit, but this will be extended to
the framebuffer fetch/blend modes. In the future, when/if we move to
VideoCommon pipelines, this state will be part of the pipeline UID
anyway, and we can mask it out in the backend by using a two-level map,
so the shaders/programs are shared.
|
|
This is required for D3D to support logic op.
|
|
|
|
Disable it at shader generation time instead. This way the UIDs are
sharable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also moves the host config checks to common.
|
|
|
|
This fixes a linkage warning in D3D because of mismatched inputs.
|
|
It seems it doesn't like negating arguments for bitops, so suff like
"var <<= (-othervar);"
fails to compile
|
|
@JMC47 requested this to be able to do performance comparisons.
|
|
|
|
|