Remove GPU readback from NoiseTexture3D.get_format
(cherry picked from commit 60d5571d6c
)
This commit is contained in:
parent
6fa4270d71
commit
2c9901af36
|
@ -112,6 +112,7 @@ void NoiseTexture3D::_set_texture_data(const TypedArray<Image> &p_data) {
|
|||
} else {
|
||||
texture = RS::get_singleton()->texture_3d_create(data[0]->get_format(), data[0]->get_width(), data[0]->get_height(), data.size(), false, data);
|
||||
}
|
||||
format = data[0]->get_format();
|
||||
}
|
||||
emit_changed();
|
||||
}
|
||||
|
@ -348,6 +349,5 @@ Vector<Ref<Image>> NoiseTexture3D::get_data() const {
|
|||
}
|
||||
|
||||
Image::Format NoiseTexture3D::get_format() const {
|
||||
ERR_FAIL_COND_V(!texture.is_valid(), Image::FORMAT_L8);
|
||||
return RS::get_singleton()->texture_3d_get(texture)[0]->get_format();
|
||||
return format;
|
||||
}
|
||||
|
|
|
@ -60,6 +60,8 @@ private:
|
|||
Ref<Gradient> color_ramp;
|
||||
Ref<Noise> noise;
|
||||
|
||||
Image::Format format = Image::FORMAT_L8;
|
||||
|
||||
void _thread_done(const TypedArray<Image> &p_data);
|
||||
static void _thread_function(void *p_ud);
|
||||
|
||||
|
|
Loading…
Reference in New Issue