Blender V5.3
gpu_shader_material_hash_value.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
9uint hash_value_float_to_uint(float value)
10{
11 return hash_uint(floatBitsToUint(value));
12}
13
18
20{
21 return hash_uint4(floatBitsToUint(vec.x),
22 floatBitsToUint(vec.y),
23 floatBitsToUint(vec.z),
24 floatBitsToUint(vec.w));
25}
26
34
35[[node]]
36void hash_value_float(float value, int seed, int &hash)
37{
38 hash = int(hash_uint2(hash_value_float_to_uint(value), uint(seed)));
39}
40
41[[node]]
42void hash_value_vector(float3 value, int seed, int &hash)
43{
44 hash = int(hash_uint2(hash_value_vec3_to_uint(value), uint(seed)));
45}
46
47[[node]]
48void hash_value_color(float4 value, int seed, int &hash)
49{
50 hash = int(hash_uint2(hash_value_vec4_to_uint(value), uint(seed)));
51}
52
53[[node]]
54void hash_value_int(int value, int seed, int &hash)
55{
56 hash = int(hash_uint2(hash_uint(uint(value)), uint(seed)));
57}
58
59[[node]]
60void hash_value_rotation(float4 value, int seed, int &hash)
61{
62 hash = int(hash_uint2(hash_value_vec4_to_uint(value), uint(seed)));
63}
64
65[[node]]
66void hash_value_matrix(float4x4 value, int seed, int &hash)
67{
68 hash = int(hash_uint2(hash_value_mat4_to_uint(value), uint(seed)));
69}
uint hash_uint(uint kx)
uint hash_uint4(uint kx, uint ky, uint kz, uint kw)
uint hash_uint3(uint kx, uint ky, uint kz)
uint hash_uint2(uint kx, uint ky)
VecBase< uint, D > floatBitsToUint(VecOp< float, D >) RET
uint hash_value_float_to_uint(float value)
void hash_value_int(int value, int seed, int &hash)
void hash_value_matrix(float4x4 value, int seed, int &hash)
uint hash_value_vec3_to_uint(float3 vec)
void hash_value_vector(float3 value, int seed, int &hash)
uint hash_value_vec4_to_uint(float4 vec)
void hash_value_float(float value, int seed, int &hash)
uint hash_value_mat4_to_uint(float4x4 mat)
void hash_value_color(float4 value, int seed, int &hash)
void hash_value_rotation(float4 value, int seed, int &hash)
MatBase< float, 4, 4 > float4x4
#define hash
Definition noise_c.cc:156
float z
Definition sky_math.h:136
float y
Definition sky_math.h:136
float x
Definition sky_math.h:136
float y
Definition sky_math.h:225
float z
Definition sky_math.h:225
float x
Definition sky_math.h:225
float w
Definition sky_math.h:225