zyrolasting/racket-vulkan

Problem with (check-vkResult)

HectareaGalbis opened this issue · 2 comments

In theory, the function (check-vkResult v who) throws an error if v is not a VkResult success code.

I guess an example of use could be this:

(define result (vkCreateInstance ...))
(check-vkResult result 'create-instance)

However, this always fails and the following code too:

(check-vkResult VK_SUCCESS 'whatever)
; Result: "whatever: failed: 0"

Actually, check-vkResult is searching for a symbol representing a success code. So this does not throw an error:

(check-vkResult 'VK_SUCCESS 'whatever)

Is this intentional?

Not anymore. Thanks for bringing this up. If you could, please verify that #17 fixes your issue?

In case you'd like background: The Racket FFI allows you to specify enumerated types with symbols, so 'VK_SUCCESS would be translated to 0 when it passes the Racket-C boundary. Somewhere along the line I decided I didn't want Racket to introduce hidden behavior, so I defined Vulkan result types as fixed integers and not as a Racket-flavored enumerated type. check-vkResult didn't get the memo.

Yep, It works. Thank you.