34 .default_value({0.0f, 0.0f, 0.0f, 1.0f})
35 .structure_type(StructureType::Dynamic);
56 if (this->
context().treat_viewer_as_compositor_output() &&
57 !this->
context().is_valid_compositing_region())
80 if (this->
context().use_gpu()) {
84 parallel_for(domain.size, [&](
const int2 texel) { output.store_pixel(texel, color); });
90 if (this->
context().use_gpu()) {
115 output.bind_as_image(shader,
"output_img");
133 const int2 output_texel = texel + bounds.min;
134 if (output_texel.x > bounds.max.x || output_texel.y > bounds.max.y) {
147 if (this->
context().treat_viewer_as_compositor_output() &&
148 this->
context().use_context_bounds_for_input_output())
150 return this->
context().get_compositing_region();
161 if (this->
context().treat_viewer_as_compositor_output() &&
162 this->
context().use_context_bounds_for_input_output())
190 "Visualize data from inside a node graph, in the image editor or as a backdrop";
193 ntype.
declare = file_ns::cmp_node_viewer_declare;
194 ntype.
initfunc = file_ns::node_composit_init_viewer;
#define NODE_CLASS_OUTPUT
@ NODE_VIEWER_SHORTCUT_NONE
void GPU_shader_bind(blender::gpu::Shader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_shader_uniform_2iv(blender::gpu::Shader *sh, const char *name, const int data[2])
void GPU_texture_clear(blender::gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
virtual Result get_viewer_output(Domain domain, bool is_data, ResultPrecision precision)=0
gpu::Shader * get_shader(const char *info_name, ResultPrecision precision)
NodeOperation(Context &context, DNode node)
Context & context() const
Result & get_input(StringRef identifier) const
virtual Domain compute_domain()
void unbind_as_texture() const
void bind_as_texture(gpu::Shader *shader, const char *texture_name) const
T load_pixel(const int2 &texel) const
static ResultPrecision precision(blender::gpu::TextureFormat format)
bool is_single_value() const
const T & get_single_value() const
Domain compute_domain() override
Bounds< int2 > get_output_bounds()
NodeOperation(Context &context, DNode node)
void * MEM_callocN(size_t len, const char *str)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void compute_dispatch_threads_at_least(gpu::Shader *shader, int2 threads_range, int2 local_size=int2(16))
void parallel_for(const int2 range, const Function &function)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
static void cmp_node_viewer_declare(NodeDeclarationBuilder &b)
static void node_composit_init_viewer(bNodeTree *, bNode *node)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
void cmp_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
static void register_node_type_cmp_viewer()
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
void(* initfunc)(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare