You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-28 16:07:14 +00:00
Fix various missing rendering parameter checks
This commit is contained in:
@@ -1352,6 +1352,8 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b
|
|||||||
uint32_t old_stride = multimesh->xform_format == RS::MULTIMESH_TRANSFORM_2D ? 8 : 12;
|
uint32_t old_stride = multimesh->xform_format == RS::MULTIMESH_TRANSFORM_2D ? 8 : 12;
|
||||||
old_stride += multimesh->uses_colors ? 4 : 0;
|
old_stride += multimesh->uses_colors ? 4 : 0;
|
||||||
old_stride += multimesh->uses_custom_data ? 4 : 0;
|
old_stride += multimesh->uses_custom_data ? 4 : 0;
|
||||||
|
ERR_FAIL_COND(p_buffer.size() != (multimesh->instances * (int)old_stride));
|
||||||
|
|
||||||
for (int i = 0; i < multimesh->instances; i++) {
|
for (int i = 0; i < multimesh->instances; i++) {
|
||||||
{
|
{
|
||||||
float *dataptr = w + i * old_stride;
|
float *dataptr = w + i * old_stride;
|
||||||
|
|||||||
@@ -723,6 +723,7 @@ void TextureStorage::texture_2d_update(RID p_texture, const Ref<Image> &p_image,
|
|||||||
texture_set_data(p_texture, p_image, p_layer);
|
texture_set_data(p_texture, p_image, p_layer);
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
Texture *tex = texture_owner.get_or_null(p_texture);
|
Texture *tex = texture_owner.get_or_null(p_texture);
|
||||||
|
ERR_FAIL_COND(!tex);
|
||||||
|
|
||||||
tex->image_cache_2d.unref();
|
tex->image_cache_2d.unref();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1244,6 +1244,8 @@ float RendererSceneRenderRD::screen_space_roughness_limiter_get_limit() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TypedArray<Image> RendererSceneRenderRD::bake_render_uv2(RID p_base, const TypedArray<RID> &p_material_overrides, const Size2i &p_image_size) {
|
TypedArray<Image> RendererSceneRenderRD::bake_render_uv2(RID p_base, const TypedArray<RID> &p_material_overrides, const Size2i &p_image_size) {
|
||||||
|
ERR_FAIL_COND_V_MSG(p_image_size.width <= 0, TypedArray<Image>(), "Image width must be greater than 0.");
|
||||||
|
ERR_FAIL_COND_V_MSG(p_image_size.height <= 0, TypedArray<Image>(), "Image height must be greater than 0.");
|
||||||
RD::TextureFormat tf;
|
RD::TextureFormat tf;
|
||||||
tf.format = RD::DATA_FORMAT_R8G8B8A8_UNORM;
|
tf.format = RD::DATA_FORMAT_R8G8B8A8_UNORM;
|
||||||
tf.width = p_image_size.width; // Always 64x64
|
tf.width = p_image_size.width; // Always 64x64
|
||||||
|
|||||||
Reference in New Issue
Block a user