comex
8492d04dfa
Use pointers instead of references in GetUidData to avoid the undefined behavior of *(T *)nullptr (ewwww)
2014-10-21 21:20:05 -04:00
skidau
3023abc1b5
Merge pull request #1285 from degasus/master
...
PixelShaderGen: replace multiplication with shift
2014-10-16 14:04:25 +11:00
Markus Wick
1227bd2ba6
PixelShaderGen: replace multiplication with shift
...
iirc both nvidia and i965 doesn't optimize this
2014-10-14 12:34:37 +02:00
skidau
b4399dbdf3
Fixed the "Undeclared identifier: uv0" OpenGL shader compile error that appears in NBA2K11.
2014-09-24 00:10:45 +10:00
Ryan Houdek
bc9ef95643
Support Sampler binding in the shader.
...
In the cases where we support the binding layout keyword, use it for more than binding UBO location.
This changes it so it is supported for samplers as well.
Instances when this is enabled is if a device supports GL_ARB_shading_language_420pack, or if it supports GLES 3.10.
2014-07-18 17:04:03 -05:00
degasus
01fd96ab31
PixelShaderGen: fix indentation
2014-07-16 17:24:43 +02:00
degasus
924ad1ee9f
LightingShader: hard code const variable
2014-06-19 16:46:53 +02:00
degasus
e456a5e64f
PixelShader: remove the duplicated ppl constants
2014-06-19 16:33:33 +02:00
degasus
d93f2973f7
PixelShader: use the vertex const buffer for ppl
2014-06-19 16:33:33 +02:00
Tony Wasserka
0fac17da33
Merge pull request #269 from magumagu/swbackend-xfregisters
...
SW backend: use VideoCommon XFRegisters struct.
2014-05-17 10:40:57 +02:00
magumagu
1357277f40
Video backends: mass-replace "xfregs" with "xfmem".
2014-05-16 18:58:07 -07:00
magumagu
8b82cea704
Video backends: fix behavior of "konst" TEV inputs.
...
Also fixes TEVCOLORARG_HALF.
Values verified to match hardwarere.
2014-05-16 12:19:35 -07:00
Tony Wasserka
b4e1ac5f08
Merge pull request #185 from degasus/shader-cleanup
...
Shader cleanup
2014-05-06 11:37:11 +02:00
degasus
813e30ec2a
ShaderGen: make uv readonly
2014-05-05 17:06:38 +02:00
degasus
6109958e68
ShaderGen: OGL: don't make a copy of "Normal"
2014-05-05 17:06:37 +02:00
degasus
0e0da8c8fd
ShaderGen: make clipPos readonly
2014-05-05 17:06:37 +02:00
degasus
c80717ac2e
PixelShaderGen: extract iround
2014-05-05 17:06:37 +02:00
degasus
2bc2b73e03
PixelShaderGen: drop fmod as it isn't used any more
2014-05-05 17:06:37 +02:00
degasus
c82991df5b
ShaderGen: inline constant shaders
2014-05-05 17:06:37 +02:00
degasus
b0878c54b2
ShaderGen: use cbuffers for D3D
2014-05-05 17:06:37 +02:00
degasus
fe9fcfdd07
ShaderGen: merge early-z blocks of ogl+d3d
2014-05-05 17:06:37 +02:00
degasus
3e14bf511f
ShaderGen/D3D: inline centroid
2014-05-05 17:06:36 +02:00
magumagu
52c42a2946
VideoCommon: fix indirect texture coordinate computation in TEV.
...
Even if an indirect texture stage doesn't actually sample a texture, we
still need to emit the relevant math.
Fixes Issue 7092.
2014-05-04 22:12:57 -07:00
magumagu
b3a67821e4
VideoCommon: fix rounding in TEV.
...
The hardware backends pass the TEV tests in gxtest with this change.
2014-04-15 16:47:01 -07:00
Tony Wasserka
068f26d2aa
PixelShaderGen: Fix an issue with color combiner compare mode and simplify the affected line a bit.
...
This was a mistake of mine when translating floating point values to integer values.
Also, the max() part of that line was just completely redundant because the sign of an absolute value is always greater than or equal to zero.
Fixes issue 7178.
2014-04-15 23:41:07 +02:00
magumagu
a2150ef1f8
PixelShaderGen: delete extra parenthesis.
...
Without this patch, we can generate a pixel shader which doesn't compile
in some cases.
2014-04-14 00:41:27 -07:00
magumagu
fd9c1fa746
VideoBackend: remove unused config vars.
...
No point to keeping around variables which are always "true".
2014-04-11 14:53:12 -07:00
Ryan Houdek
3251d78f89
Add initial support for GLSL ES 3.10.
...
GLSL ES 3.10 adds implicit support for the binding layout qualifier that we use.
Changes our GLSL version enums to bit values so we can check for both ES versions easily.
2014-04-03 00:46:09 -05:00
Tony Wasserka
eb0f547a17
PixelShaderGen: Cleanups.
2014-03-26 00:23:36 +01:00
Tony Wasserka
4f82d6f7af
PixelShaderGen: Implement tev combiner lerping in a faster way which also reproduces hardware behavior perfectly.
...
The new behavior has been verified to be correct by hardware tests. This is an improvement over the old code, which was just a guess.
2014-03-26 00:17:04 +01:00
Tony Wasserka
fdad95c055
PixelShaderGen: Cleanups and fixes for tev combiners.
...
Fixes issue 4674.
2014-03-26 00:17:03 +01:00
Tony Wasserka
0f81cbd6be
PixelShaderGen: More code alignment fixes.
2014-03-14 22:33:26 +01:00
Tony Wasserka
c1016205d3
Pixel/LightingShaderGen: Fix code alignment issues.
...
Most of these weren't even introduced by me, but hey - I'm nice and love wasting my time :p
2014-03-14 22:33:26 +01:00
Tony Wasserka
2067f88e0f
PixelShaderGen: Don't make local lookup tables "static".
2014-03-14 22:33:26 +01:00
Tony Wasserka
0ce92e0162
PixelShaderGen: Remove the "i" prefix for integer variables.
...
The prefix was just required in the development stage to reduce the risk of regressions.
2014-03-14 22:33:26 +01:00
Tony Wasserka
bdd629c598
PixelShaderGen: Use spaces for alignment where appropriate.
2014-03-14 22:33:26 +01:00
Tony Wasserka
6e65e02c9e
ConstantManager: Do not use single-element arrays.
2014-03-14 22:33:25 +01:00
Tony Wasserka
6c2971eaf6
PixelShaderGen: Write 16777215 in hex (0xFFFFFF) so that it's easier to understand.
2014-03-14 22:33:25 +01:00
Tony Wasserka
8ebb65ebf2
PixelShaderGen: Prettify generated shader source.
2014-03-14 22:33:24 +01:00
Tony Wasserka
e2e1c5c905
PixelShaderGen: Add a note about a random idea which should be checked with hardware tests.
2014-03-14 22:33:12 +01:00
Tony Wasserka
6fcbda6752
PixelShaderGen: Cleanup and clarify bump alpha combiner inputs.
2014-03-14 22:33:12 +01:00
Tony Wasserka
9a96a1d525
PixelShaderGen: Remove old, mostly useless comments.
...
A few vague lines of comments cannot replace an afternoon reading of how TEV works.
2014-03-14 22:33:12 +01:00
Tony Wasserka
8b8bb04fd3
PixelShaderGen: Use bit shifts instead of multiplications as a small optimization.
2014-03-14 22:33:12 +01:00
Tony Wasserka
036a8c6951
PixelShaderGen: Clean up tev compare functionality.
2014-03-14 22:33:10 +01:00
Tony Wasserka
fa7173d099
PixelShaderGen: Store tex scale as an integer.
2014-03-14 22:32:30 +01:00
Tony Wasserka
16109fb453
PixelShaderGen: Treat UV coordinates as actual integers.
2014-03-14 22:32:29 +01:00
Tony Wasserka
50526ae50a
PixelShaderGen: Remove some dead code.
2014-03-14 22:32:18 +01:00
Tony Wasserka
065919f599
PixelShaderGen: Perform some of the fog calculations with integers.
2014-03-14 22:31:32 +01:00
Tony Wasserka
605b687af8
PixelShaderGen: Use integer math for z textures.
2014-03-14 22:31:31 +01:00
Tony Wasserka
3a6389992e
PixelShaderGen: Treat UV coordinates like S17.7 integers (they're still stored as float, though).
2014-03-14 22:31:30 +01:00
Tony Wasserka
3e6efdb53e
LightingShaderGen: Perform more lighting calculations with integers.
2014-03-14 22:31:19 +01:00
Tony Wasserka
387b9bf3c2
LightingShaderGen: Perform some lighting calculations with integers.
2014-03-14 22:31:19 +01:00
Tony Wasserka
78623871f9
ShaderGen: Store material uniforms as integers.
2014-03-14 22:31:19 +01:00
Tony Wasserka
4bf57565e8
ShaderGen: Store light color uniforms as integers.
2014-03-14 22:31:18 +01:00
Tony Wasserka
68e91f0d55
PixelShader: Store fog color as an integer.
2014-03-14 22:31:18 +01:00
Tony Wasserka
0238a56816
PixelShaderGen: Change indirect texture matrix uniforms to use integers.
2014-03-14 22:31:18 +01:00
Tony Wasserka
c13a5c38e9
PixelShaderGen: Change the "alpha" uniform to use integers.
2014-03-14 22:31:18 +01:00
Tony Wasserka
ec60acac3a
PixelShaderGen: Change the "colors" and "kcolors" uniforms to be integers.
2014-03-14 22:31:18 +01:00
Tony Wasserka
df94e62350
PixelShaderGen: Process fog calculations with integer math.
2014-03-14 22:31:18 +01:00
Tony Wasserka
21eb482a6e
PixelShaderGen: Write constants in decimal instead of hexadecimal where appropriate.
2014-03-14 22:31:11 +01:00
Tony Wasserka
cff952c397
PixelShaderGen: Use integer math for indirect tev stage texcoord calculation.
2014-03-14 22:30:27 +01:00
Tony Wasserka
e7a42d884f
PixelShaderGen: prev should be initialized to the proper value; tev output needs to be clamped between -1024 and 1023.
2014-03-14 22:30:16 +01:00
Tony Wasserka
cb1514e082
PixelShaderGen: Remove superfluous registerstate stuff. Also, made alphabump an integer.
2014-03-14 22:30:15 +01:00
Tony Wasserka
a11ae69cb0
PixelShaderGen: Use integer math for TEV combiners.
2014-03-14 22:28:32 +01:00
Tony Wasserka
aaa8e74a68
PixelShaderGen: Use integer math for tev outputs.
2014-03-14 22:28:14 +01:00
Tony Wasserka
654442feb7
PixelShaderGen: Use integer math for tev konst value.
2014-03-14 22:28:12 +01:00
Tony Wasserka
e69ee6ae0a
PixelShaderGen: Remove remaining floating point bits for texture color.
2014-03-14 22:26:50 +01:00
Tony Wasserka
ac1c77c392
PixelShaderGen: Use integer math for rasterizer color.
2014-03-14 22:26:50 +01:00
Tony Wasserka
3ea97f7730
PixelShaderGen: Use integer math for indirect texture coords.
2014-03-14 22:26:50 +01:00
Tony Wasserka
0e711bf520
PixelShaderGen: Use integer math for sampling textures.
2014-03-14 22:26:50 +01:00
Tony Wasserka
1b3b12caa0
PixelShaderGen: Fix an issue where small negative z coordinates would underflow when they shouldn't.
2014-03-14 22:26:50 +01:00
Tony Wasserka
fa77e1d2b6
PixelShaderGen: Use integer math for alpha testing.
2014-03-14 22:26:48 +01:00
Ryan Houdek
22c989de9a
Provide our own dot functions in GLSL since GLSL doesn't provide integer versions of this function, even though AMD and Nvidia provide their own.
2014-03-14 22:26:27 +01:00
Tony Wasserka
bed442198f
PixelShaderGen: Make SampleTexture static inline.
2014-03-14 22:26:26 +01:00
Matthew Parlane
31cfc73a09
Fixes spacing for "for", "while", "switch" and "if"
...
Also moved && and || to ends of lines instead of start.
Fixed misc vertical alignments and some { needed newlining.
2014-03-11 00:35:07 +13:00
Tillmann Karras
d802d39281
clang-modernize -use-nullptr
...
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-03-09 21:14:26 +01:00
degasus
aaaa5af0b2
remove (ATTR|VARY)(IN|OUT) macros
2014-02-26 11:37:29 +01:00
Pierre Bourdon
ffe588cc24
Fix more header sorting issues in VideoCommon/ (now check-includes clean).
2014-02-20 01:01:10 +01:00
Lioncash
2afe215271
Convert all includes to relative paths.
2014-02-18 02:19:10 -05:00
Lioncash
6c4ee1753a
Fix some vertical alignments
...
ie. uses spaces for alignment.
2014-02-16 20:12:05 -05:00
degasus
6089e4470a
OGL: remove ubo workaround
...
This was only keeped for some broken mesa versions. Meanwhile most used versions should be fixed for almost a year.
2014-02-01 22:33:45 +01:00
Ryan Houdek
b55a4bb087
Slight optimization in the pixel shader. We are using pow(2.0, X) in place of exp2(X). This can be faster in places that don't optimize a pow to a exp2 in this case.
...
Notice this from here: http://cgit.freedesktop.org/mesa/mesa/commit/?id=847bc36a38d42967ad6bf0492fe90a4892d9d799
Intel Haswell GPU is 24 cycles for POW and 14 cycles for EXP2.
Maybe other GPUs don't optimize this either. Just be safe.
2014-01-08 16:40:31 -06:00
degasus
c42f274e22
OpenGL: use shader 420pack if available to staticly bind ubo location
...
Bindung locations after compiling a shader stalls the driver. So if we manage not to bind anything after compilation, the lag would be reduced much.
2014-01-05 10:38:45 +01:00
Jasper St. Pierre
34692ab826
Remove unnecessary Src/ folders
2013-12-31 14:03:19 -05:00