26 : info_name(info_name), precision(precision)
37 return a.info_name ==
b.info_name && a.precision ==
b.precision;
46 using namespace gpu::shader;
55 if (resource.bind_type != ShaderCreateInfo::Resource::BindType::IMAGE) {
81 map_.remove_if([](
auto item) {
return !item.value->needed; });
85 for (
auto &value : map_.values()) {
86 value->needed =
false;
94 auto &cached_shader = *map_.lookup_or_add_cb(
95 key, [&]() {
return std::make_unique<CachedShader>(info_name, precision); });
97 cached_shader.needed =
true;
98 return cached_shader.shader();
const GPUShaderCreateInfo * GPU_shader_create_info_get(const char *info_name)
GPUShader * GPU_shader_create_from_info(const GPUShaderCreateInfo *_info)
void GPU_shader_free(GPUShader *shader)
struct GPUShader GPUShader
GPUShader * get(const char *info_name, ResultPrecision precision)
CachedShaderKey(const char *info_name, ResultPrecision precision)
ResultPrecision precision
GPUShader * shader() const
CachedShader(const char *info_name, ResultPrecision precision)
static eGPUTextureFormat gpu_texture_format(ResultType type, ResultPrecision precision)
local_group_size(16, 16) .push_constant(Type b
bool operator==(const BokehKernelKey &a, const BokehKernelKey &b)
uint64_t get_default_hash(const T &v)
unsigned __int64 uint64_t
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_