Commit Graph

23 Commits

Author SHA1 Message Date
Dr. Chat
300d1c57ba SPIR-V: Rewrite basic control-flow to use a while loop paired with a switch statement 2016-09-05 16:57:02 -05:00
sephiroth99
90b54bbaa6 Fix usage of mix in fragment shader
The boolean value must be a vector too, where each bool component
selects whether the value of the output vector component is from the
first or the second source vector.
2016-03-10 01:14:42 -05:00
sephiroth99
00674736fe Fix minor syntax error in shaders.
Discovered with glslangValidator.
2016-02-08 20:42:09 -05:00
Dr. Chat
f75a4cab0e Apply a few optimizations to generated GLSL shaders. 2016-01-30 19:39:47 -06:00
Dr. Chat
8a89a93eab Fix improperly reading 2_10_10_10 bitfields (or so I hope)
Check at runtime if a vertex fetch index doesn't match gl_VertexID
Fix trying to instantiate a vec1
2016-01-22 18:49:17 -06:00
Dr. Chat
55a8964428 Fix shaders reading 10_11_11 bitfields backwards. 2016-01-18 15:46:41 -06:00
Ben Vanik
2e5c64fb13 Prevent some divide by zeros in shaders. Thanks @vlj!
Fixes #518.
2016-01-18 11:51:18 -08:00
Dr. Chat
a5b37dce1d Shaders: Emit an unimplemented warning for indexed vertex fetch instructions 2016-01-13 01:50:20 -06:00
sephiroth99
962d8215da shader_translator: Handle all enum values in switch-cases 2015-12-30 17:42:18 -05:00
Dr. Chat
cf41a84fe3 Fix broken check against bool constants
Fix always terminating execution in cexece branches (these are sometimes followed by exece branches)
2015-12-20 20:53:31 -06:00
Ben Vanik
5db84105c4 Utilizing fallthrough for most shader CF, hopefully speeding things up. 2015-12-13 10:14:35 -08:00
Ben Vanik
b5469b57ba Moving temporary registers to exec blocks. ps may still need to be shared. 2015-12-07 22:57:28 -08:00
Ben Vanik
85b1797b9e Workaround for nvidia bug with dynamic local memory access. 2015-12-07 22:55:17 -08:00
Ben Vanik
ec113275dc Making texture swizzles dynamic. Seems to fix some color swap issues.
And probably exposes many more ;)
2015-12-07 22:39:33 -08:00
Ben Vanik
09022a6ad3 gl_FragCoord support. 2015-12-07 20:45:02 -08:00
Ben Vanik
ed0b97813a Loops in shaders (no TDRs! woo!). 2015-12-07 13:03:57 -08:00
Ben Vanik
367ca09f1d Don't duplicate vf bindings. 2015-12-07 13:03:35 -08:00
sephiroth99
f154b7ed59 Fix compilation error of translated GLSL shader.
Comparison of uvec2 and int is not possible, explicitly
use a zero-value uvec2.
2015-12-07 01:39:17 -05:00
Ben Vanik
280c0b35f6 Basic control flow skeleton and jumps implemented.
A-train's trees draw right now!
Helps a bit with #473 but still need to implement loops.
2015-12-06 11:44:22 -08:00
Ben Vanik
c86e479214 Replacing old Shader with TranslatedShader. 2015-12-06 10:36:07 -08:00
Ben Vanik
083f936bbc aL placeholder until loops are implemented. 2015-12-06 00:53:25 -08:00
Ben Vanik
51a8002629 Moving GL backend to new shader translator.
This seems to make a lot of things better, but may also break things.
Cleanup to follow.
2015-12-06 00:48:41 -08:00
Ben Vanik
2b3b423776 Mostly complete new GLSL translator (modulo flow control). 2015-12-05 17:44:06 -08:00