ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.59k stars 809 forks source link

Pre-Civilization: Marble Age: Panicked - create_texture: Dimension Y is zero #13946

Open MartySVK opened 11 months ago

MartySVK commented 11 months ago

Error Info

Error name: Error Error message: panicked at /home/runner/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/49d16f7/wgpu/src/backend/direct.rs:3056:5: wgpu error: Validation Error

Caused by: In Device::create_texture Dimension Y is zero

Error stack:

Error: panicked at /home/runner/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/49d16f7/wgpu/src/backend/direct.rs:3056:5:
wgpu error: Validation Error

Caused by:
    In Device::create_texture
    Dimension Y is zero

    at H.n.wbg.__wbg_new_ab87fd305ed9004b (https://www.zahraj.sk/emulators/ruffle/core.ruffle.d273449361a0cd066e42.js:1:56255)
    at core::ops::function::FnOnce::call_once{{vtable.shim}}::h189f598b25fe4514 (wasm://wasm/033ef5ea:wasm-function[9962]:0x9cb822)
    at std::panicking::rust_panic_with_hook::h3aa054d35a0817d7 (wasm://wasm/033ef5ea:wasm-function[6532]:0x8cf542)
    at core::panicking::panic_fmt::h3e1dd3d08288569e (wasm://wasm/033ef5ea:wasm-function[9762]:0x9c6622)
    at core::ops::function::Fn::call::hab4d293b6b61afb0 (wasm://wasm/033ef5ea:wasm-function[6715]:0x8d9da1)
    at wgpu::backend::direct::ErrorSinkRaw::handle_error::ha8d57641bba5ca8c (wasm://wasm/033ef5ea:wasm-function[5416]:0x870389)
    at <T as wgpu::context::DynContext>::device_create_texture::haf3ce0631cd54806 (wasm://wasm/033ef5ea:wasm-function[7273]:0x908fb3)
    at wgpu::Device::create_texture::hc6929010bde77107 (wasm://wasm/033ef5ea:wasm-function[5543]:0x87c73e)
    at <ruffle_render_wgpu::backend::WgpuRenderBackend<T> as ruffle_render::backend::RenderBackend>::register_bitmap::haf7fc2f99939d60c (wasm://wasm/033ef5ea:wasm-function[2038]:0x5aa8e8)
    at ruffle_core::bitmap::bitmap_data::BitmapData::bitmap_handle::h44647728a8a3e897 (wasm://wasm/033ef5ea:wasm-function[1490]:0x4ae721)

AVM2 stack:

    at flash.display::BitmapData/flash::display::BitmapData::draw()
    at com.emibap.textureAtlas::DynamicAtlas$/drawItem()
    at com.emibap.textureAtlas::DynamicAtlas$/fromMovieClipContainer()
    at Asset$/loadAtlas()
    at Asset$/init()
    at Classes$/init()
    at MainMenu()
    at starling.core::Starling/initializeRoot()
    at starling.core::Starling/initialize()
    at starling.core::Starling/onContextCreated()
    at flash.events::EventDispatcher/flash::events::EventDispatcher::dispatchEvent()
    at flash.display::Stage3D/flash::display::Stage3D::requestContext3D_internal()
    at MethodInfo-1805()

Player Info

Allows script access: false Renderer: wgpu Adapter Backend: Gl Adapter Name: "ANGLE (NVIDIA, NVIDIA GeForce GTX 1070 (0x00001BE1) Direct3D11 vs_5_0 ps_5_0, D3D11)" Adapter Device Type: Other Adapter Driver Name: "" Adapter Driver Info: "" Enabled features: Features(TEXTURE_COMPRESSION_BC | TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES | PUSH_CONSTANTS | SHADER_UNUSED_VERTEX_OUTPUT) Available features: Features(CLEAR_TEXTURE | MULTIVIEW) Current limits: Limits { max_texture_dimension_1d: 16384, max_texture_dimension_2d: 16384, max_texture_dimension_3d: 2048, max_texture_array_layers: 256, max_bind_groups: 4, max_bindings_per_bind_group: 1000, max_dynamic_uniform_buffers_per_pipeline_layout: 8, max_dynamic_storage_buffers_per_pipeline_layout: 0, max_sampled_textures_per_shader_stage: 16, max_samplers_per_shader_stage: 16, max_storage_buffers_per_shader_stage: 0, max_storage_textures_per_shader_stage: 0, max_uniform_buffers_per_shader_stage: 11, max_uniform_buffer_binding_size: 16384, max_storage_buffer_binding_size: 0, max_vertex_buffers: 8, max_buffer_size: 268435456, max_vertex_attributes: 16, max_vertex_buffer_array_stride: 255, min_uniform_buffer_offset_alignment: 256, min_storage_buffer_offset_alignment: 256, max_inter_stage_shader_components: 60, max_compute_workgroup_storage_size: 0, max_compute_invocations_per_workgroup: 0, max_compute_workgroup_size_x: 0, max_compute_workgroup_size_y: 0, max_compute_workgroup_size_z: 0, max_compute_workgroups_per_dimension: 0, max_push_constant_size: 96 } Surface quality: high Surface samples: 4 Surface size: Extent3d { width: 550, height: 400, depth_or_array_layers: 1 }

Page Info

Page URL: https://www.zahraj.sk/embed/pre-civilization-marble-age/ SWF URL: https://data.gameflare.com/games/7934/Qm7DbTq9VBoiZJ.swf

Browser Info

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Platform: Win32 Has touch support: false

Ruffle Info

Version: 0.1.0 Name: nightly 2023-11-10 Channel: nightly Built: 2023-11-10T00:25:11.047Z Commit: d98a2750a07e313bef80f6ed2bcd1cce3888f094 Is extension: false

Metadata

width: 800 height: 533 frameRate: 30 numFrames: 2 swfVersion: 34 backgroundColor: undefined isActionScript3: true uncompressedLength: 9733381

Aaron1011 commented 11 months ago

We're ending up with a TextLine with an enormous width (1,000,000), which is causing us to produce a zero-height texture when we resize (trying to preserve the apsect ratio) to clamp the image to the max dimensions.

I traced this as far back as flashx.textLayout.compose.Parcel::getLineSlug, which explicitly sets TextLine.MAX_LINE_WIDTH (1,000,000) in some cases. I'm not familiar with our TextLine support, so I don't know if getBounds is supposed to ignore this, or if it's a bug that we're reaching param1.width = TextLine.MAX_LINE_WIDTH; in the first place.

n0samu commented 9 months ago

The panic also happens for me on desktop (Windows 10), not just web.

MartySVK commented 9 months ago

It works on desktop (Windows 10) for me, but it is frozen for few seconds