Skip to content

Tophat crashes on drawing an image stored in a local variable #228

@vtereshkov

Description

@vtereshkov

Code example:

import (
    "std.um"
    "th.um"
    "window.um"
    "image.um"
)

fn test() {
    img, err := image::mk({0, 0, 0, 0}, {2, 2})
    std::exitif(err)
    std::assert(img.validate())
    img.draw(th::mkTransform({0, 0}))
}

fn init*() {
    window::setup("Test", 800, 600)
    window::onFrame.register({
        test()      
    })
}

Result:

sg][error][id:308] lib/sokol/sokol_gfx.h:18483:0:
        VALIDATE_ABND_IMG_EXISTS: sg_apply_bindings: bound image no longer alive

[sg][error][id:318] lib/sokol/sokol_gfx.h:18514:0:
        VALIDATE_ABND_SMP_EXISTS: sg_apply_bindings: bound sampler no longer alive

[sg][panic][id:346] lib/sokol/sokol_gfx.h:17554:0:
        VALIDATION_FAILED: validation layer checks failed

ABORTING because of [panic]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions