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>2022-02-17 19:03:23 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-02-18 23:33:47 +0300
commit7f7c614ecddbcb66de0bff1657366970dede99be (patch)
treed8cb20c25249bccfa45125978569e671d3b042ca /intern/opencolorio/ocio_shader_shared.hh
parentef0e21f0ae71d9ec4ba3cdf6f6a16c9575459ced (diff)
OCIO: Port shader creation logic to use GPUShaderCreateInfo
This commit should suffice to make the shader API agnostic now (given that all users of it use the GPU API). This makes the shaders not trigger a false positive error anymore since the binding slots are now garanteed by the backend and not changed at after compilation. This also bundles all uniforms into UBOs. Making them extendable without limitations of push constants. The generated uniforms from OCIO are not densely packed in the UBO to avoid complexity. Another approach would be to use GPU_uniformbuf_create_from_list but this requires converting uniforms to GPUInputs which is too complex for what it is. Reviewed by: brecht, jbakker Differential Revision: https://developer.blender.org/D14123
Diffstat (limited to 'intern/opencolorio/ocio_shader_shared.hh')
-rw-r--r--intern/opencolorio/ocio_shader_shared.hh41
1 files changed, 41 insertions, 0 deletions
diff --git a/intern/opencolorio/ocio_shader_shared.hh b/intern/opencolorio/ocio_shader_shared.hh
new file mode 100644
index 00000000000..c7045217196
--- /dev/null
+++ b/intern/opencolorio/ocio_shader_shared.hh
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright 2022 Blender Foundation. All rights reserved. */
+
+#ifndef GPU_SHADER
+# include "GPU_shader_shared_utils.h"
+#endif
+
+struct OCIO_GPUCurveMappingParameters {
+ /* Curve mapping parameters
+ *
+ * See documentation for OCIO_CurveMappingSettings to get fields descriptions.
+ * (this ones pretty much copies stuff from C structure.)
+ */
+ float4 mintable;
+ float4 range;
+ float4 ext_in_x;
+ float4 ext_in_y;
+ float4 ext_out_x;
+ float4 ext_out_y;
+ float4 first_x;
+ float4 first_y;
+ float4 last_x;
+ float4 last_y;
+ float4 black;
+ float4 bwmul;
+ int lut_size;
+ int use_extend_extrapolate;
+ int _pad0;
+ int _pad1;
+};
+
+struct OCIO_GPUParameters {
+ float dither;
+ float scale;
+ float exponent;
+ bool1 use_predivide;
+ bool1 use_overlay;
+ int _pad0;
+ int _pad1;
+ int _pad2;
+};