/**************************************************************************/ /* image_compress_betsy.cpp */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /**************************************************************************/ /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #include "image_compress_betsy.h" #include "core/config/project_settings.h" #include "betsy_bc1.h" #include "bc1.glsl.gen.h" #include "bc6h.glsl.gen.h" static Mutex betsy_mutex; static BetsyCompressor *betsy = …; void BetsyCompressor::_init() { … } void BetsyCompressor::init() { … } void BetsyCompressor::_assign_mt_ids(WorkerThreadPool::TaskID p_pump_task_id) { … } // Yield thread to WTP so other tasks can be done on it. // Automatically regains control as soon a task is pushed to the command queue. void BetsyCompressor::_thread_loop() { … } void BetsyCompressor::_thread_exit() { … } void BetsyCompressor::finish() { … } // Helper functions. static int get_next_multiple(int n, int m) { … } static String get_shader_name(BetsyFormat p_format) { … } Error BetsyCompressor::_compress(BetsyFormat p_format, Image *r_img) { … } void ensure_betsy_exists() { … } Error _betsy_compress_bptc(Image *r_img, Image::UsedChannels p_channels) { … } Error _betsy_compress_s3tc(Image *r_img, Image::UsedChannels p_channels) { … } void free_device() { … }