mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 22:05:06 +00:00
gs-texture: Allow texture creation without data
This is a valid operation and allows for creation of uninitialized textures, which can be copied to but should not be read from until that moment.
This commit is contained in:
parent
95018868dc
commit
c591902fea
2 changed files with 1 additions and 7 deletions
|
@ -40,8 +40,6 @@ gs::texture::texture(uint32_t width, uint32_t height, gs_color_format format, ui
|
|||
throw std::logic_error("height must be at least 1");
|
||||
if (mip_levels == 0)
|
||||
throw std::logic_error("mip_levels must be at least 1");
|
||||
if (!mip_data)
|
||||
throw std::logic_error("mip_data is invalid");
|
||||
|
||||
if (mip_levels > 1 || ((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps)) {
|
||||
bool isPOT = util::math::is_power_of_two(width) && util::math::is_power_of_two(height);
|
||||
|
@ -73,8 +71,6 @@ gs::texture::texture(uint32_t width, uint32_t height, uint32_t depth, gs_color_f
|
|||
throw std::logic_error("depth must be at least 1");
|
||||
if (mip_levels == 0)
|
||||
throw std::logic_error("mip_levels must be at least 1");
|
||||
if (!mip_data)
|
||||
throw std::logic_error("mip_data is invalid");
|
||||
|
||||
if (mip_levels > 1 || ((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps)) {
|
||||
bool isPOT = (pow(2, (int64_t)floor(log(width) / log(2))) == width)
|
||||
|
@ -104,8 +100,6 @@ gs::texture::texture(uint32_t size, gs_color_format format, uint32_t mip_levels,
|
|||
throw std::logic_error("size must be at least 1");
|
||||
if (mip_levels == 0)
|
||||
throw std::logic_error("mip_levels must be at least 1");
|
||||
if (!mip_data)
|
||||
throw std::logic_error("mip_data is invalid");
|
||||
|
||||
if (mip_levels > 1 || ((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps)) {
|
||||
bool isPOT = (pow(2, (int64_t)floor(log(size) / log(2))) == size);
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace gs {
|
|||
* \brief Create a texture from an existing gs_texture_t object.
|
||||
*/
|
||||
texture(gs_texture_t* tex, bool takeOwnership = false) : m_texture(tex), m_isOwner(takeOwnership) {}
|
||||
|
||||
|
||||
void load(int unit);
|
||||
|
||||
gs_texture_t* get_object();
|
||||
|
|
Loading…
Reference in a new issue