27 if (context.use_gpu()) {
44 const char *sampler_name)
const
56 const char *sampler_name)
const
67void SMAAPrecomputedTextures::compute_gpu()
73 gpu::TextureFormat::UNORM_8,
83 gpu::TextureFormat::UNORM_8_8,
90void SMAAPrecomputedTextures::compute_cpu()
104 (
int64_t(texel.
y) * area_texture_size.x + texel.
x) * 2)) /
117 if (textures_ && !textures_->needed) {
124 textures_->needed =
false;
131 textures_ = std::make_unique<SMAAPrecomputedTextures>(context);
#define GPU_TEXTURE_FREE_SAFE(texture)
void store_pixel(const int2 &texel, const T &pixel_value)
void allocate_texture(const Domain domain, const bool from_pool=true, const std::optional< ResultStorageType > storage_type=std::nullopt)
SMAAPrecomputedTextures & get(Context &context)
void bind_area_texture(gpu::Shader *shader, const char *sampler_name) const
~SMAAPrecomputedTextures()
void bind_search_texture(gpu::Shader *shader, const char *sampler_name) const
void unbind_area_texture() const
SMAAPrecomputedTextures(Context &context)
void unbind_search_texture() const
void parallel_for(const int2 range, const Function &function)
int GPU_shader_get_sampler_binding(gpu::Shader *shader, const char *name)
void GPU_texture_update(gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
const unsigned char areaTexBytes[]
const unsigned char searchTexBytes[]
VecBase< int32_t, 2 > int2
@ GPU_TEXTURE_USAGE_SHADER_READ
void GPU_texture_filter_mode(gpu::Texture *texture, bool use_filter)
void GPU_texture_bind(gpu::Texture *texture, int unit)
void GPU_texture_unbind(gpu::Texture *texture)
gpu::Texture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)