Compositor: Support node integer sockets

This patch adds support for using integer sockets in compositor nodes.
This involves updating the Result class, node tree compiler, implicit
conversion operation, multi-function procedure operation, shader
operation, and some operations that supports multiple types.

Shader operation internally treats integers as floats, doing conversion
to and from int when reading and writing. That's because the GPUMaterial
compiler doesn't support integers. This is also the same workaround used
by the shader system. Though the GPU module are eyeing adding support
for integers, so we will update the code once they do that.

Domain realization is not yet supported for integer types, but this is
an internal limitation so far, as we do not plan to add nodes that
outputs integers soon. We are not yet sure how realization should happen
with regards to interpolation and we do not have base functions to
sample integer images, that's why I decided to delay its implementation
when it is actually needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/132599
This commit is contained in:
Omar Emara
2025-01-06 10:09:26 +01:00
committed by Omar Emara
parent 77041084cd
commit b3623feab2
19 changed files with 569 additions and 79 deletions

View File

@@ -446,7 +446,7 @@ class CompositorNodeGroupInterfaceTest(AbstractNodeGroupInterfaceTest, NodeGroup
self.do_test_socket_type("NodeSocketFloat")
self.do_test_invalid_socket_type("NodeSocketGeometry")
self.do_test_invalid_socket_type("NodeSocketImage")
self.do_test_invalid_socket_type("NodeSocketInt")
self.do_test_socket_type("NodeSocketInt")
self.do_test_invalid_socket_type("NodeSocketMaterial")
self.do_test_invalid_socket_type("NodeSocketObject")
self.do_test_invalid_socket_type("NodeSocketRotation")