Blender V5.0
draw_resource.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BKE_duplilist.hh"
10#include "GPU_material.hh"
11
12#include "draw_handle.hh"
13#include "draw_shader_shared.hh"
14
15/* -------------------------------------------------------------------- */
18
20{
21 /* This function mirrors `lookup_instance_property` in `cycles/blender/blender_object.cpp`. */
22 hash_code = attr.hash_code;
23 return ref.find_rgba_attribute(attr, &data_x);
24}
25
27
28/* -------------------------------------------------------------------- */
31
32bool LayerAttribute::sync(const Scene *scene, const ViewLayer *layer, const GPULayerAttr &attr)
33{
34 hash_code = attr.hash_code;
35
36 return BKE_view_layer_find_rgba_attribute(scene, layer, attr.name, &data.x);
37}
38
bool BKE_view_layer_find_rgba_attribute(const Scene *scene, const ViewLayer *layer, const char *name, float r_value[4])
bool find_rgba_attribute(const GPUUniformAttr &attr, float r_value[4]) const
char name[256]
uint32_t hash_code
bool sync(const Scene *scene, const ViewLayer *layer, const GPULayerAttr &attr)
bool sync(const blender::draw::ObjectRef &ref, const GPUUniformAttr &attr)