Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-03-09 21:52:37 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-03-10 04:18:25 +0300
commit8444aaaa693a9b9e613d801612ea46dfd9b82dba (patch)
tree41cd1badc74798d29a2bb007b6100940d0820c19 /source/blender/draw/modes/shaders
parent4540bd226dce454573242c40a8b2de79ca1bffa5 (diff)
DRW: Put all view-only dependant uniform in a UBO.
This leads to less lookups to the GWNShaderInterface and less uniform upload. We still keep a legacy path so that Builtin uniforms can still work. We might restrict this path to Builtin shader only in the future.
Diffstat (limited to 'source/blender/draw/modes/shaders')
-rw-r--r--source/blender/draw/modes/shaders/common_view_lib.glsl14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/common_view_lib.glsl b/source/blender/draw/modes/shaders/common_view_lib.glsl
new file mode 100644
index 00000000000..d261d263a6f
--- /dev/null
+++ b/source/blender/draw/modes/shaders/common_view_lib.glsl
@@ -0,0 +1,14 @@
+/* keep in sync with DRWManager.view_data */
+layout(std140) uniform viewBlock {
+ /* Same order as DRWViewportMatrixType */
+ mat4 ViewProjectionMatrix;
+ mat4 ViewProjectionMatrixInverse;
+ mat4 ViewMatrix;
+ mat4 ViewMatrixInverse;
+ mat4 ProjectionMatrix;
+ mat4 ProjectionMatrixInverse;
+
+ vec4 CameraTexCoFactors;
+
+ vec4 clipPlanes[2];
+};