Skip to content

[GL] The race condition if copy from texture to buffer command submited with compute pass #8473

@SpeedCrash100

Description

@SpeedCrash100

Description
I am learning wgpu by writing gstreamer plugins. While I doing that, I noticed that when using Gl backend the output video seems like consists random blocks of previous and current frame(See sample screenshots below). However, Vulkan backend is working fine without artefacts. I assume that copy from texture to output buffer is running at the same time with compute pass. See transform_frame code in my repo for more details.

However, if you submit commands separately, it will work without artefacts. I mean, create an separate command encoder, finish it and submit. For example, this code uses this workaround. And does not have this problem.

I am not entirely sure if this is an bug. I am assuming that encoder should places commands in order I provided. May it is not true?

Simplifed, this code WILL have race condition with OpenGL backend.

let mut encoder = pipeline.device.create_command_encoder(&Default::default());
encoder.copy_buffer_to_texture(...)
let mut pass = encoder.begin_compute_pass(...)
...
encoder.copy_texture_to_buffer(...)
let command_buffer = encoder.finish();
pipeline.queue.submit([command_buffer]);

this code will NOT have race:

let mut encoder = pipeline.device.create_command_encoder(&Default::default());
encoder.copy_buffer_to_texture(...)
pipeline.queue.submit([encoder.finish()]);
...
let mut encoder = pipeline.device.create_command_encoder(&Default::default());
let mut pass = encoder.begin_compute_pass(...)
...
pipeline.queue.submit([encoder.finish()]);
...
let mut encoder = pipeline.device.create_command_encoder(&Default::default());
encoder.copy_texture_to_buffer(...)
pipeline.queue.submit([encoder.finish()]);

Repro steps
I can provide you only full gstreamer plugin, because it can be seen only in motion.

  1. Clone the repo from https://github.com/SpeedCrash100/deka-gst-image-processing-rs/tree/3058382c4f37e67771672e179cfeabc23c602c9f
  2. To build, you need to install gstreamer dev dependencies.
    2.1 For Arch-based distro, it would be:
gst-plugins-bad-libs 1.26.7-1.1
gst-plugins-base 1.26.7-1.1
gst-plugins-base-libs 1.26.7-1.1
gstreamer 1.26.7-1.1
  1. Build the project as always: cargo build --release
  2. Run an sample pipeline from root of the project.
WGPU_BACKEND=gl RUST_LOG=wgpu=debug GST_PLUGIN_PATH=`pwd`/target/release gst-launch-1.0 videotestsrc pattern=ball ! video/x-raw,width=1920,height=1080 ! decodebin ! videoconvert ! dekawgpusobelsimple ! videoconvert ! autovideosink
  1. You can compare results with vulkan using:
WGPU_BACKEND=vulkan RUST_LOG=wgpu=debug GST_PLUGIN_PATH=`pwd`/target/release gst-launch-1.0 videotestsrc pattern=ball ! video/x-raw,width=1920,height=1080 ! decodebin ! videoconvert ! dekawgpusobelsimple ! videoconvert ! autovideosink

Expected vs observed behavior
Observed: The displayed video with GL backend will have stuttering, and some frames haves parts of the other frame.
Expected: Should be stable video without stutters and parts of old frames like with Vulkan

Extra materials

The artefacts that happens with GL backend
Image

How the ball should looks like after shader
Image

Debug logs:

Details
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::egl] Client extensions: [
        "EGL_EXT_device_base",
        "EGL_EXT_device_enumeration",
        "EGL_EXT_device_query",
        "EGL_EXT_platform_base",
        "EGL_KHR_client_get_all_proc_addresses",
        "EGL_EXT_client_extensions",
        "EGL_KHR_debug",
        "EGL_EXT_platform_device",
        "EGL_EXT_explicit_device",
        "EGL_EXT_platform_wayland",
        "EGL_KHR_platform_wayland",
        "EGL_EXT_platform_x11",
        "EGL_KHR_platform_x11",
        "EGL_EXT_platform_xcb",
        "EGL_MESA_platform_gbm",
        "EGL_KHR_platform_gbm",
        "EGL_MESA_platform_surfaceless",
    ]
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::egl] Loading Wayland library to get the current display
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::egl] Loading X11 library to get the current display
[2025-11-04T07:45:24Z INFO  wgpu_hal::gles::egl] Using Wayland platform
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::egl] Display vendor "Mesa Project", version (1, 5)
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::egl] Display extensions: [
        "EGL_ANDROID_blob_cache",
        "EGL_ANDROID_native_fence_sync",
        "EGL_EXT_buffer_age",
        "EGL_EXT_config_select_group",
        "EGL_EXT_create_context_robustness",
        "EGL_EXT_image_dma_buf_import",
        "EGL_EXT_image_dma_buf_import_modifiers",
        "EGL_EXT_present_opaque",
        "EGL_EXT_query_reset_notification_strategy",
        "EGL_EXT_surface_compression",
        "EGL_EXT_swap_buffers_with_damage",
        "EGL_IMG_context_priority",
        "EGL_KHR_cl_event2",
        "EGL_KHR_config_attribs",
        "EGL_KHR_context_flush_control",
        "EGL_KHR_create_context",
        "EGL_KHR_create_context_no_error",
        "EGL_KHR_fence_sync",
        "EGL_KHR_get_all_proc_addresses",
        "EGL_KHR_gl_colorspace",
        "EGL_KHR_gl_renderbuffer_image",
        "EGL_KHR_gl_texture_2D_image",
        "EGL_KHR_gl_texture_3D_image",
        "EGL_KHR_gl_texture_cubemap_image",
        "EGL_KHR_image_base",
        "EGL_KHR_no_config_context",
        "EGL_KHR_reusable_sync",
        "EGL_KHR_surfaceless_context",
        "EGL_KHR_swap_buffers_with_damage",
        "EGL_EXT_pixel_format_float",
        "EGL_KHR_wait_sync",
        "EGL_MESA_configless_context",
        "EGL_MESA_gl_interop",
        "EGL_MESA_image_dma_buf_export",
        "EGL_MESA_query_driver",
        "EGL_MESA_x11_native_visual_id",
    ]
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::egl]        EGL surface: +srgb
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::egl]        Trying native-render
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::egl]        EGL context: +robust access
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::egl]        EGL context: +surfaceless
[2025-11-04T07:45:24Z DEBUG wgpu_core::instance] Instance::new: created Gl backend
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::adapter] Vendor: AMD
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::adapter] Renderer: AMD Radeon RX 9070 XT (radeonsi, gfx1201, LLVM 21.1.4, DRM 3.64, 6.17.6-2-cachyos)
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::adapter] Version: 4.6 (Core Profile) Mesa 25.2.6-cachyos1.2
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::adapter] SL version: 4.60
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::adapter] Supported GL Extensions: {
        "GL_ARB_compute_variable_group_size",
        "GL_ARB_texture_barrier",
        "GL_EXT_EGL_sync",
        "GL_EXT_shader_clock",
        "GL_ARB_occlusion_query2",
        "GL_EXT_polygon_offset_clamp",
        "GL_ARB_stencil_texturing",
        "GL_ARB_gl_spirv",
        "GL_EXT_texture_sRGB",
        "GL_ARB_texture_mirror_clamp_to_edge",
        "GL_ARB_shading_language_packing",
        "GL_ARB_texture_view",
        "GL_EXT_abgr",
        "GL_EXT_EGL_image_storage_compression",
        "GL_EXT_semaphore_fd",
        "GL_ARB_post_depth_coverage",
        "GL_EXT_framebuffer_multisample",
        "GL_ARB_half_float_vertex",
        "GL_AMD_vertex_shader_viewport_index",
        "GL_KHR_shader_subgroup",
        "GL_ANGLE_texture_compression_dxt5",
        "GL_ARB_texture_compression_rgtc",
        "GL_ARB_shader_bit_encoding",
        "GL_ARB_robustness",
        "GL_KHR_robustness",
        "GL_AMD_gpu_shader_int64",
        "GL_NV_shader_atomic_int64",
        "GL_ARB_vertex_attrib_64bit",
        "GL_ARB_vertex_type_10f_11f_11f_rev",
        "GL_ARB_arrays_of_arrays",
        "GL_ARB_fragment_layer_viewport",
        "GL_NV_copy_image",
        "GL_ARB_base_instance",
        "GL_ARB_clip_control",
        "GL_ARB_shader_atomic_counter_ops",
        "GL_ARB_framebuffer_no_attachments",
        "GL_ARB_texture_buffer_range",
        "GL_ARB_transform_feedback2",
        "GL_EXT_texture_sRGB_decode",
        "GL_ARB_map_buffer_alignment",
        "GL_ARB_bindless_texture",
        "GL_EXT_texture_compression_s3tc",
        "GL_ARB_draw_elements_base_vertex",
        "GL_ARB_draw_buffers",
        "GL_EXT_texture_integer",
        "GL_EXT_texture_shared_exponent",
        "GL_ARB_direct_state_access",
        "GL_EXT_texture_swizzle",
        "GL_ATI_texture_mirror_once",
        "GL_EXT_framebuffer_blit",
        "GL_EXT_transform_feedback",
        "GL_AMD_shader_stencil_export",
        "GL_ARB_separate_shader_objects",
        "GL_ARB_texture_rgb10_a2ui",
        "GL_ARB_explicit_attrib_location",
        "GL_ARB_vertex_type_2_10_10_10_rev",
        "GL_ATI_texture_float",
        "GL_ARB_gpu_shader_int64",
        "GL_ARB_shader_precision",
        "GL_EXT_window_rectangles",
        "GL_KHR_robust_buffer_access_behavior",
        "GL_MESA_pack_invert",
        "GL_ARB_texture_non_power_of_two",
        "GL_ARB_invalidate_subdata",
        "GL_AMD_shader_trinary_minmax",
        "GL_KHR_blend_equation_advanced",
        "GL_ARB_debug_output",
        "GL_ARB_shader_image_load_store",
        "GL_EXT_texture_snorm",
        "GL_EXT_framebuffer_object",
        "GL_ARB_query_buffer_object",
        "GL_EXT_draw_instanced",
        "GL_MESA_texture_const_bandwidth",
        "GL_ARB_pixel_buffer_object",
        "GL_EXT_vertex_attrib_64bit",
        "GL_ARB_blend_func_extended",
        "GL_ARB_shading_language_420pack",
        "GL_ARB_ES3_2_compatibility",
        "GL_ARB_vertex_array_object",
        "GL_ARB_copy_buffer",
        "GL_ARB_timer_query",
        "GL_ATI_blend_equation_separate",
        "GL_AMD_pinned_memory",
        "GL_ARB_vertex_array_bgra",
        "GL_NV_conditional_render",
        "GL_ARB_texture_filter_minmax",
        "GL_EXT_packed_depth_stencil",
        "GL_ARB_shader_storage_buffer_object",
        "GL_ARB_buffer_storage",
        "GL_EXT_draw_buffers2",
        "GL_ARB_get_program_binary",
        "GL_ARB_fragment_coord_conventions",
        "GL_EXT_texture_compression_rgtc",
        "GL_EXT_texture_sRGB_RG8",
        "GL_ARB_sync",
        "GL_ARB_compute_shader",
        "GL_ARB_shader_viewport_layer_array",
        "GL_ARB_program_interface_query",
        "GL_ARB_copy_image",
        "GL_AMD_draw_buffers_blend",
        "GL_ARB_enhanced_layouts",
        "GL_ARB_internalformat_query2",
        "GL_ARB_map_buffer_range",
        "GL_AMD_depth_clamp_separate",
        "GL_ARB_multi_bind",
        "GL_EXT_timer_query",
        "GL_ARB_clear_texture",
        "GL_ARB_half_float_pixel",
        "GL_ARB_texture_compression_bptc",
        "GL_ARB_conservative_depth",
        "GL_MESA_framebuffer_flip_y",
        "GL_ARB_sample_shading",
        "GL_ARB_uniform_buffer_object",
        "GL_ARB_texture_buffer_object_rgb32",
        "GL_NVX_gpu_memory_info",
        "GL_NV_texture_barrier",
        "GL_EXT_debug_label",
        "GL_ARB_shader_ballot",
        "GL_OES_EGL_image",
        "GL_ARB_conditional_render_inverted",
        "GL_ARB_shader_texture_lod",
        "GL_KHR_texture_compression_astc_sliced_3d",
        "GL_ARB_texture_border_clamp",
        "GL_EXT_blend_equation_separate",
        "GL_ARB_shader_image_size",
        "GL_ARB_vertex_attrib_binding",
        "GL_EXT_texture_array",
        "GL_ARB_point_sprite",
        "GL_S3_s3tc",
        "GL_ARB_pipeline_statistics_query",
        "GL_ARB_depth_buffer_float",
        "GL_ARB_shader_atomic_counters",
        "GL_ARB_shading_language_include",
        "GL_ARB_get_texture_sub_image",
        "GL_EXT_packed_float",
        "GL_MESA_texture_signed_rgba",
        "GL_ARB_polygon_offset_clamp",
        "GL_ARB_gpu_shader_fp64",
        "GL_EXT_texture_sRGB_R8",
        "GL_ARB_parallel_shader_compile",
        "GL_ARB_spirv_extensions",
        "GL_KHR_debug",
        "GL_ARB_shader_stencil_export",
        "GL_EXT_depth_bounds_test",
        "GL_EXT_provoking_vertex",
        "GL_ARB_texture_cube_map_array",
        "GL_ARB_seamless_cube_map",
        "GL_ARB_transform_feedback_overflow_query",
        "GL_AMD_multi_draw_indirect",
        "GL_ARB_compressed_texture_pixel_storage",
        "GL_EXT_memory_object_fd",
        "GL_ARB_framebuffer_object",
        "GL_EXT_pixel_buffer_object",
        "GL_ARB_ES3_compatibility",
        "GL_ARB_draw_buffers_blend",
        "GL_ARB_framebuffer_sRGB",
        "GL_EXT_demote_to_helper_invocation",
        "GL_ARB_color_buffer_float",
        "GL_EXT_framebuffer_multisample_blit_scaled",
        "GL_EXT_shader_image_load_store",
        "GL_EXT_EGL_image_storage",
        "GL_EXT_shader_integer_mix",
        "GL_ARB_vertex_shader",
        "GL_ARB_robust_buffer_access_behavior",
        "GL_ARB_internalformat_query",
        "GL_ARB_shader_draw_parameters",
        "GL_EXT_framebuffer_sRGB",
        "GL_EXT_texture_filter_anisotropic",
        "GL_ARB_shader_group_vote",
        "GL_ARB_derivative_control",
        "GL_ARB_explicit_uniform_location",
        "GL_ARB_cull_distance",
        "GL_ARB_texture_gather",
        "GL_ARB_shader_clock",
        "GL_ARB_texture_filter_anisotropic",
        "GL_ARB_texture_float",
        "GL_ARB_texture_stencil8",
        "GL_AMD_conservative_depth",
        "GL_ARB_shader_subroutine",
        "GL_ARB_ES3_1_compatibility",
        "GL_NV_depth_clamp",
        "GL_ARB_shader_texture_image_samples",
        "GL_ATI_meminfo",
        "GL_ARB_texture_storage",
        "GL_ARB_clear_buffer_object",
        "GL_ARB_vertex_buffer_object",
        "GL_MESA_shader_integer_functions",
        "GL_ANGLE_texture_compression_dxt3",
        "GL_ARB_texture_rg",
        "GL_ARB_multi_draw_indirect",
        "GL_EXT_semaphore",
        "GL_INTEL_blackhole_render",
        "GL_KHR_parallel_shader_compile",
        "GL_ARB_transform_feedback_instanced",
        "GL_EXT_texture_compression_dxt1",
        "GL_EXT_texture_filter_minmax",
        "GL_NV_packed_depth_stencil",
        "GL_ARB_texture_query_levels",
        "GL_ARB_draw_instanced",
        "GL_ARB_viewport_array",
        "GL_ARB_texture_multisample",
        "GL_EXT_vertex_array_bgra",
        "GL_EXT_memory_object",
        "GL_KHR_context_flush_control",
        "GL_ARB_tessellation_shader",
        "GL_KHR_texture_compression_astc_ldr",
        "GL_ARB_transform_feedback3",
        "GL_ARB_texture_query_lod",
        "GL_ARB_draw_indirect",
        "GL_ARB_fragment_shader",
        "GL_EXT_shader_image_load_formatted",
        "GL_ARB_depth_clamp",
        "GL_AMD_texture_texture4",
        "GL_ARB_texture_buffer_object",
        "GL_AMD_query_buffer_object",
        "GL_EXT_texture_storage",
        "GL_ARB_provoking_vertex",
        "GL_ARB_seamless_cubemap_per_texture",
        "GL_ARB_texture_storage_multisample",
        "GL_EXT_texture_mirror_clamp",
        "GL_AMD_seamless_cubemap_per_texture",
        "GL_ARB_gpu_shader5",
        "GL_ARB_indirect_parameters",
        "GL_EXT_texture_shadow_lod",
        "GL_NV_compute_shader_derivatives",
        "GL_ARB_texture_swizzle",
        "GL_ARB_ES2_compatibility",
        "GL_ARB_sampler_objects",
        "GL_NV_alpha_to_coverage_dither_control",
        "GL_ARB_texture_rectangle",
        "GL_ARB_shader_objects",
        "GL_ARB_instanced_arrays",
        "GL_AMD_vertex_shader_layer",
        "GL_KHR_no_error",
        "GL_NV_vdpau_interop",
        "GL_IBM_multimode_draw_arrays",
    }
[2025-11-04T07:45:24Z DEBUG wgpu_core::instance] Found 1 compatible adapters. Sorted by preference:
[2025-11-04T07:45:24Z DEBUG wgpu_core::instance] * AdapterInfo { name: "AMD Radeon RX 9070 XT (radeonsi, gfx1201, LLVM 21.1.4, DRM 3.64, 6.17.6-2-cachyos)", vendor: 4098, device: 0, device_type: Other, driver: "", driver_info: "4.6 (Core Profile) Mesa 25.2.6-cachyos1.2", backend: Gl }
[2025-11-04T07:45:24Z DEBUG wgpu_core::instance] Request adapter result AdapterInfo { name: "AMD Radeon RX 9070 XT (radeonsi, gfx1201, LLVM 21.1.4, DRM 3.64, 6.17.6-2-cachyos)", vendor: 4098, device: 0, device_type: Other, driver: "", driver_info: "4.6 (Core Profile) Mesa 25.2.6-cachyos1.2", backend: Gl }
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::device] Naga generated shader:
    #version 450 core
    #extension GL_ARB_compute_shader : require
    #extension GL_ARB_shader_storage_buffer_object : require
    layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
    
    struct OffsetPc {
        uint inner;
    };
    layout(std430, binding = 0) buffer type_1_block_0Compute { uint _group_0_binding_0_cs[6]; };
    
    layout(std430, binding = 1) readonly buffer type_2_block_1Compute { uint _group_1_binding_0_cs[]; };
    
    uniform OffsetPc _push_constant_binding_cs;
    
    
    void main() {
        uint _e3 = _push_constant_binding_cs.inner;
        uint _e5 = _group_1_binding_0_cs[_e3];
        uint _e9 = _push_constant_binding_cs.inner;
        uint _e13 = _group_1_binding_0_cs[(_e9 + 1u)];
        uint _e17 = _push_constant_binding_cs.inner;
        uint _e21 = _group_1_binding_0_cs[(_e17 + 2u)];
        uvec3 src_1 = uvec3(_e5, _e13, _e21);
        if ((((src_1.x > 65535u) || (src_1.y > 65535u)) || (src_1.z > 65535u))) {
            _group_0_binding_0_cs = uint[6](0u, 0u, 0u, 0u, 0u, 0u);
            return;
        } else {
            _group_0_binding_0_cs = uint[6](src_1.x, src_1.y, src_1.z, src_1.x, src_1.y, src_1.z);
            return;
        }
    }
    
    
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::device]     Compiled shader NativeShader(2)
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::device]     Linked program NativeProgram(1)
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::device] Naga generated shader:
    #version 450 core
    #extension GL_ARB_compute_shader : require
    #extension GL_ARB_shader_storage_buffer_object : require
    layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
    
    struct MetadataEntry {
        uint src_offset;
        uint dst_offset;
        uint vertex_or_index_limit;
        uint instance_limit;
    };
    struct MetadataRange {
        uint start;
        uint count;
    };
    const bool supports_indirect_first_instance = false;
    const bool write_d3d12_special_constants = false;
    
    uniform MetadataRange _push_constant_binding_cs;
    
    layout(std430, binding = 0) readonly buffer type_2_block_0Compute { MetadataEntry _group_0_binding_0_cs[]; };
    
    layout(std430, binding = 1) readonly buffer type_3_block_1Compute { uint _group_1_binding_0_cs[]; };
    
    layout(std430, binding = 2) buffer type_3_block_2Compute { uint _group_2_binding_0_cs[]; };
    
    
    bool is_bit_set(uint data, uint index) {
        return (((data >> index) & 1u) == 1u);
    }
    
    void main() {
        uvec3 global_invocation_id = gl_GlobalInvocationID;
        bool failed = false;
        uint _e4 = _push_constant_binding_cs.count;
        if ((global_invocation_id.x >= _e4)) {
            return;
        }
        uint _e9 = _push_constant_binding_cs.start;
        MetadataEntry metadata_1 = _group_0_binding_0_cs[(_e9 + global_invocation_id.x)];
        bool _e18 = is_bit_set(metadata_1.src_offset, 31u);
        uint src_base_offset = ((metadata_1.src_offset << 2u) >> 2u);
        uint dst_base_offset = ((metadata_1.dst_offset << 2u) >> 2u);
        uint first_vertex_or_index = _group_1_binding_0_cs[(src_base_offset + 2u)];
        uint vertex_or_index_count = _group_1_binding_0_cs[(src_base_offset + 0u)];
        {
            bool _e41 = is_bit_set(metadata_1.dst_offset, 30u);
            bool sub_overflows = (metadata_1.vertex_or_index_limit < first_vertex_or_index);
            bool _e46 = failed;
            failed = (_e46 || (sub_overflows && !(_e41)));
            uint vertex_or_index_limit = (metadata_1.vertex_or_index_limit - first_vertex_or_index);
            bool _e51 = failed;
            failed = (_e51 || (vertex_or_index_limit < vertex_or_index_count));
        }
        uint first_instance = _group_1_binding_0_cs[((src_base_offset + 3u) + uint(_e18))];
        uint instance_count = _group_1_binding_0_cs[(src_base_offset + 1u)];
        {
            bool _e67 = is_bit_set(metadata_1.dst_offset, 31u);
            bool sub_overflows_1 = (metadata_1.instance_limit < first_instance);
            bool _e72 = failed;
            failed = (_e72 || (sub_overflows_1 && !(_e67)));
            uint instance_limit = (metadata_1.instance_limit - first_instance);
            bool _e77 = failed;
            failed = (_e77 || (instance_limit < instance_count));
        }
        if (true) {
            bool _e84 = failed;
            failed = (_e84 || (first_instance != 0u));
        }
        bool _e91 = failed;
        if (_e91) {
            if (write_d3d12_special_constants) {
                _group_2_binding_0_cs[(dst_base_offset + 0u)] = 0u;
                _group_2_binding_0_cs[(dst_base_offset + 1u)] = 0u;
                _group_2_binding_0_cs[(dst_base_offset + 2u)] = 0u;
            }
            _group_2_binding_0_cs[((dst_base_offset + 0u) + 0u)] = 0u;
            _group_2_binding_0_cs[((dst_base_offset + 0u) + 1u)] = 0u;
            _group_2_binding_0_cs[((dst_base_offset + 0u) + 2u)] = 0u;
            _group_2_binding_0_cs[((dst_base_offset + 0u) + 3u)] = 0u;
            if (_e18) {
                _group_2_binding_0_cs[((dst_base_offset + 0u) + 4u)] = 0u;
                return;
            } else {
                return;
            }
        } else {
            if (write_d3d12_special_constants) {
                uint _e149 = _group_1_binding_0_cs[((src_base_offset + 2u) + uint(_e18))];
                _group_2_binding_0_cs[(dst_base_offset + 0u)] = _e149;
                uint _e160 = _group_1_binding_0_cs[((src_base_offset + 3u) + uint(_e18))];
                _group_2_binding_0_cs[(dst_base_offset + 1u)] = _e160;
                _group_2_binding_0_cs[(dst_base_offset + 2u)] = 0u;
            }
            uint _e175 = _group_1_binding_0_cs[(src_base_offset + 0u)];
            _group_2_binding_0_cs[((dst_base_offset + 0u) + 0u)] = _e175;
            uint _e185 = _group_1_binding_0_cs[(src_base_offset + 1u)];
            _group_2_binding_0_cs[((dst_base_offset + 0u) + 1u)] = _e185;
            uint _e195 = _group_1_binding_0_cs[(src_base_offset + 2u)];
            _group_2_binding_0_cs[((dst_base_offset + 0u) + 2u)] = _e195;
            uint _e205 = _group_1_binding_0_cs[(src_base_offset + 3u)];
            _group_2_binding_0_cs[((dst_base_offset + 0u) + 3u)] = _e205;
            if (_e18) {
                uint _e215 = _group_1_binding_0_cs[(src_base_offset + 4u)];
                _group_2_binding_0_cs[((dst_base_offset + 0u) + 4u)] = _e215;
                return;
            } else {
                return;
            }
        }
    }
    
    
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::device]     Compiled shader NativeShader(4)
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::device]     Linked program NativeProgram(3)
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::device] Naga generated shader:
    #version 450 core
    #extension GL_ARB_compute_shader : require
    layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
    
    layout(binding = 0) uniform sampler2D _group_0_binding_0_cs;
    
    layout(binding = 0,rgba8) writeonly uniform image2D _group_0_binding_1_cs;
    
    
    void main() {
        uvec3 id = gl_GlobalInvocationID;
        if (((id.x == 0u) || (id.y == 0u))) {
            return;
        }
        mat3x3 kernel = mat3x3(vec3(1.0, 2.0, 1.0), vec3(0.0, 0.0, 0.0), vec3(-1.0, -2.0, -1.0));
        vec4 _e32 = (0 < textureQueryLevels(_group_0_binding_0_cs) && all(lessThan(ivec2(uvec2((id.x - 1u), (id.y - 1u))), textureSize(_group_0_binding_0_cs, 0))) ? texelFetch(_group_0_binding_0_cs, ivec2(uvec2((id.x - 1u), (id.y - 1u))), 0) : vec4(0.0));
        vec4 _e46 = (0 < textureQueryLevels(_group_0_binding_0_cs) && all(lessThan(ivec2(uvec2((id.x - 1u), (id.y + 0u))), textureSize(_group_0_binding_0_cs, 0))) ? texelFetch(_group_0_binding_0_cs, ivec2(uvec2((id.x - 1u), (id.y + 0u))), 0) : vec4(0.0));
        vec4 _e61 = (0 < textureQueryLevels(_group_0_binding_0_cs) && all(lessThan(ivec2(uvec2((id.x - 1u), (id.y + 1u))), textureSize(_group_0_binding_0_cs, 0))) ? texelFetch(_group_0_binding_0_cs, ivec2(uvec2((id.x - 1u), (id.y + 1u))), 0) : vec4(0.0));
        vec4 _e76 = (0 < textureQueryLevels(_group_0_binding_0_cs) && all(lessThan(ivec2(uvec2((id.x + 0u), (id.y - 1u))), textureSize(_group_0_binding_0_cs, 0))) ? texelFetch(_group_0_binding_0_cs, ivec2(uvec2((id.x + 0u), (id.y - 1u))), 0) : vec4(0.0));
        vec4 _e91 = (0 < textureQueryLevels(_group_0_binding_0_cs) && all(lessThan(ivec2(uvec2((id.x + 0u), (id.y + 0u))), textureSize(_group_0_binding_0_cs, 0))) ? texelFetch(_group_0_binding_0_cs, ivec2(uvec2((id.x + 0u), (id.y + 0u))), 0) : vec4(0.0));
        vec4 _e106 = (0 < textureQueryLevels(_group_0_binding_0_cs) && all(lessThan(ivec2(uvec2((id.x + 0u), (id.y + 1u))), textureSize(_group_0_binding_0_cs, 0))) ? texelFetch(_group_0_binding_0_cs, ivec2(uvec2((id.x + 0u), (id.y + 1u))), 0) : vec4(0.0));
        vec4 _e121 = (0 < textureQueryLevels(_group_0_binding_0_cs) && all(lessThan(ivec2(uvec2((id.x + 1u), (id.y - 1u))), textureSize(_group_0_binding_0_cs, 0))) ? texelFetch(_group_0_binding_0_cs, ivec2(uvec2((id.x + 1u), (id.y - 1u))), 0) : vec4(0.0));
        vec4 _e136 = (0 < textureQueryLevels(_group_0_binding_0_cs) && all(lessThan(ivec2(uvec2((id.x + 1u), (id.y + 0u))), textureSize(_group_0_binding_0_cs, 0))) ? texelFetch(_group_0_binding_0_cs, ivec2(uvec2((id.x + 1u), (id.y + 0u))), 0) : vec4(0.0));
        vec4 _e151 = (0 < textureQueryLevels(_group_0_binding_0_cs) && all(lessThan(ivec2(uvec2((id.x + 1u), (id.y + 1u))), textureSize(_group_0_binding_0_cs, 0))) ? texelFetch(_group_0_binding_0_cs, ivec2(uvec2((id.x + 1u), (id.y + 1u))), 0) : vec4(0.0));
        vec3 color = abs((((((((((kernel[0].x * _e32.xyz) + (kernel[1].x * _e46.xyz)) + (kernel[2].x * _e61.xyz)) + (kernel[0].y * _e76.xyz)) + (kernel[1].y * _e91.xyz)) + (kernel[2].y * _e106.xyz)) + (kernel[0].z * _e121.xyz)) + (kernel[1].z * _e136.xyz)) + (kernel[2].z * _e151.xyz)));
        vec3 color_clamped = vec3(clamp(color.x, 0.0, 1.0), clamp(color.y, 0.0, 1.0), clamp(color.z, 0.0, 1.0));
        imageStore(_group_0_binding_1_cs, ivec2(id.xy), vec4(color_clamped, 1.0));
        return;
    }
    
    
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::device]     Compiled shader NativeShader(6)
[2025-11-04T07:45:24Z DEBUG wgpu_hal::gles::device]     Linked program NativeProgram(5)

Platform
OS: CachyOS Linux, Arch based
wgpu: 26.0.1, 27.0.1 are both affected

EDIT: fixes problem with rows_per_image but issue still here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions