Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. RHI uploadTexture failed in MacOS Metal backend
Forum Updated to NodeBB v4.3 + New Features

RHI uploadTexture failed in MacOS Metal backend

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 101 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • EthanTsaiE Offline
    EthanTsaiE Offline
    EthanTsai
    wrote on last edited by
    #1

    Recently I'm using Qt RHI to draw some graphics, which use textures. When I use Metal as the backend on MacOS and update the texture in the render function, the App crashed with the following error. However, it works fine on Windows platform when using DirectX as the backend. Does anyone know what the reason is?

    error: -[AGXG13GFamilyCommandBuffer blitCommandEncoderCommon:]:833: failed assertion `A command encoder is already encoding to this command buffer'

    Code Snippet:

    void TextureRenderer::render(QRhiCommandBuffer *cb)
    {
        
        QRhiResourceUpdateBatch *batch = _rhi->nextResourceUpdateBatch();
        // ....
        // update vertices and matrix uniforms
        // ....
        
        // update texture
        _textureImage = crateTextureImage();
        batch->uploadTexture(_texture.get(), _textureImage);
    
        cb->resourceUpdate(batch);
    
        // draw graphics
        cb->draw(...);
        cb->endPass();
    
    }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved