54 if (
resource.bind_type != ShaderCreateInfo::Resource::BindType::IMAGE) {
80 map_.remove_if([](
auto item) {
return !item.value->needed; });
84 for (
auto &value : map_.values()) {
85 value->needed =
false;
93 auto &cached_shader = *map_.lookup_or_add_cb(
94 key, [&]() {
return std::make_unique<CachedShader>(info_name, precision); });
96 cached_shader.needed =
true;
97 return cached_shader.shader();
void GPU_shader_free(blender::gpu::Shader *shader)
blender::gpu::Shader * GPU_shader_create_from_info(const GPUShaderCreateInfo *_info)
const GPUShaderCreateInfo * GPU_shader_create_info_get(const char *info_name)
unsigned long long int uint64_t
gpu::Shader * get(const char *info_name, ResultPrecision precision)
ResultPrecision precision
CachedShaderKey(const char *info_name, ResultPrecision precision)
CachedShader(const char *info_name, ResultPrecision precision)
gpu::Shader * shader() const
static blender::gpu::TextureFormat gpu_texture_format(ResultType type, ResultPrecision precision)
bool operator==(const BokehKernelKey &a, const BokehKernelKey &b)
uint64_t get_default_hash(const T &v, const Args &...args)
Describe inputs & outputs, stage interfaces, resources and sources of a shader. If all data is correc...
void finalize(const bool recursive=false)
Vector< Resource > pass_resources_