diff options
author | Renato Araujo Oliveira Filho <renato.araujo@kdab.com> | 2017-09-05 16:01:01 -0300 |
---|---|---|
committer | Renato Araujo Oliveira Filho <renato.araujo@kdab.com> | 2017-09-07 11:39:20 +0000 |
commit | 018c3756649c8ce3219ca9c99de2a754e7e3a00a (patch) | |
tree | 5876cc9e2bb82f79cc1d2c99bf1a2c45daf720df | |
parent | 296e25c149337d9ea8e52ec51a340d2a79acffcd (diff) |
New prototypes for QShaderProgramBuilder
Add new default prototypes that make more flexible for the apps to:
Join two elements into one
Join three elements into one
Join four elements into one
Cast an element into another
Change-Id: I4544d3a193101a948b7017f2f12bd4f2d49ac892
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
-rw-r--r-- | src/render/materialsystem/prototypes/default.json | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/src/render/materialsystem/prototypes/default.json b/src/render/materialsystem/prototypes/default.json index b868889d6..429c435f4 100644 --- a/src/render/materialsystem/prototypes/default.json +++ b/src/render/materialsystem/prototypes/default.json @@ -410,5 +410,140 @@ "headerSnippets": [ "#pragma include :/shaders/gl3/metalrough.inc.frag" ] } ] + }, + "join2": { + "inputs": [ + "first", + "second" + ], + "outputs": [ + "output" + ], + "parameters": { + "type": { + "type": "QShaderLanguage::VariableType", + "value": "QShaderLanguage::Vec2" + } + }, + "rules": [ + { + "format": { + "api": "OpenGLES", + "major": 2, + "minor": 0 + }, + "substitution": "highp $type $output = $type($first, $second);" + }, + { + "format": { + "api": "OpenGLCoreProfile", + "major": 3, + "minor": 0 + }, + "substitution": "$type $output = $type($first, $second);" + } + ] + }, + "join3": { + "inputs": [ + "first", + "second", + "third" + ], + "outputs": [ + "output" + ], + "parameters": { + "type": { + "type": "QShaderLanguage::VariableType", + "value": "QShaderLanguage::Vec3" + } + }, + "rules": [ + { + "format": { + "api": "OpenGLES", + "major": 2, + "minor": 0 + }, + "substitution": "highp $type $output = $type($first, $second, $third);" + }, + { + "format": { + "api": "OpenGLCoreProfile", + "major": 3, + "minor": 0 + }, + "substitution": "$type $output = $type($first, $second, $third);" + } + ] + }, + "join4": { + "inputs": [ + "first", + "second", + "third", + "fourth" + ], + "outputs": [ + "output" + ], + "parameters": { + "type": { + "type": "QShaderLanguage::VariableType", + "value": "QShaderLanguage::Vec4" + } + }, + "rules": [ + { + "format": { + "api": "OpenGLES", + "major": 2, + "minor": 0 + }, + "substitution": "highp $type $output = $type($first, $second, $third, $fourth);" + }, + { + "format": { + "api": "OpenGLCoreProfile", + "major": 3, + "minor": 0 + }, + "substitution": "$type $output = $type($first, $second, $third, $fourth);" + } + ] + }, + "cast": { + "inputs": [ + "input" + ], + "outputs": [ + "output" + ], + "parameters": { + "type": { + "type": "QShaderLanguage::VariableType", + "value": "QShaderLanguage::Vec3" + } + }, + "rules": [ + { + "format": { + "api": "OpenGLES", + "major": 2, + "minor": 0 + }, + "substitution": "highp $type $output = $type($input);" + }, + { + "format": { + "api": "OpenGLCoreProfile", + "major": 3, + "minor": 0 + }, + "substitution": "$type $output = $type($input);" + } + ] } } + |