Blender V5.3
blender::ComputeContextHash Struct Reference

#include <BLI_compute_context.hh>

Inherits blender::blender::UniqueHash.

Static Public Member Functions

template<size_t N, typename... Args>
static ComputeContextHash from (const ComputeContext *parent, const char(&type_str)[N], Args &&...args)
template<typename... Args>
static ComputeContextHash from_shallow_bytes (Args &&...args)
static ComputeContextHash from_bytes (const void *data, int64_t len)

Friends

std::ostream & operator<< (std::ostream &stream, const ComputeContextHash &hash)

Additional Inherited Members

Public Member Functions inherited from blender::blender::UniqueHash
uint64_t hash () const
Public Attributes inherited from blender::blender::UniqueHash
uint64_t v1
uint64_t v2

Detailed Description

A hash that uniquely identifies a specific (non-fixed-size) compute context.

Definition at line 48 of file BLI_compute_context.hh.

Member Function Documentation

◆ from()

template<size_t N, typename... Args>
ComputeContextHash blender::ComputeContextHash::from ( const ComputeContext * parent,
const char(&) type_str[N],
Args &&... args )
inlinestatic

Standard way to create a compute context hash.

Parameters
parentThe optional parent context.
type_strA string literal that identifies the context type. This is used to avoid hash collisions between different context types.
argsAdditional arguments that affect the hash. Note that only the shallow bytes of these types are used. So they generally should not contain any padding.

Definition at line 145 of file BLI_compute_context.hh.

References from_shallow_bytes(), blender::ComputeContext::hash(), and N.

◆ from_bytes()

ComputeContextHash blender::ComputeContextHash::from_bytes ( const void * data,
int64_t len )
static

Compute a context hash from a contiguous buffer.

Definition at line 17 of file compute_context.cc.

References blender::data, blender::blender::UniqueHash::hash(), and len().

Referenced by from_shallow_bytes().

◆ from_shallow_bytes()

template<typename... Args>
ComputeContextHash blender::ComputeContextHash::from_shallow_bytes ( Args &&... args)
inlinestatic

Compute a context hash by packing all the arguments into a contiguous buffer and hashing that.

Definition at line 154 of file BLI_compute_context.hh.

References from_bytes().

Referenced by from().

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
const ComputeContextHash & hash )
friend

Definition at line 27 of file compute_context.cc.

References blender::blender::UniqueHash::hash(), and operator<<.

Referenced by operator<<.


The documentation for this struct was generated from the following files: