Blender
V5.0
source
blender
draw
intern
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
19
bool
ObjectAttribute::sync
(
const
blender::draw::ObjectRef
&ref,
const
GPUUniformAttr
&attr)
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
32
bool
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
BKE_duplilist.hh
BKE_view_layer_find_rgba_attribute
bool BKE_view_layer_find_rgba_attribute(const Scene *scene, const ViewLayer *layer, const char *name, float r_value[4])
Definition
object_dupli.cc:2116
GPU_material.hh
blender::draw::ObjectRef
Definition
draw_handle.hh:207
blender::draw::ObjectRef::find_rgba_attribute
bool find_rgba_attribute(const GPUUniformAttr &attr, float r_value[4]) const
Definition
draw_handle.hh:263
draw_handle.hh
draw_shader_shared.hh
GPULayerAttr
Definition
GPU_material.hh:182
GPULayerAttr::name
char name[256]
Definition
GPU_material.hh:186
GPULayerAttr::hash_code
uint32_t hash_code
Definition
GPU_material.hh:188
GPUUniformAttr
Definition
GPU_material.hh:269
GPUUniformAttr::hash_code
uint32_t hash_code
Definition
GPU_material.hh:275
LayerAttribute::data
float4 data
Definition
draw_shader_shared.hh:289
LayerAttribute::hash_code
uint hash_code
Definition
draw_shader_shared.hh:290
LayerAttribute::sync
bool sync(const Scene *scene, const ViewLayer *layer, const GPULayerAttr &attr)
Definition
draw_resource.cc:32
ObjectAttribute::sync
bool sync(const blender::draw::ObjectRef &ref, const GPUUniformAttr &attr)
Definition
draw_resource.cc:19
ObjectAttribute::data_x
float data_x
Definition
draw_shader_shared.hh:271
ObjectAttribute::hash_code
uint hash_code
Definition
draw_shader_shared.hh:272
Scene
Definition
DNA_scene_types.h:2120
ViewLayer
Definition
DNA_layer_types.h:149
Generated on
for Blender by
doxygen
1.16.1