Instructions of Wine vkd3d -- How to Debug & Run Personal Demos

I’d like to show great thanks to my mentor, Henri Verbeet here. He has helped me a great deal!

Some tips while using vkd3d

1. Add Path

To add for example your personal demo to the vkd3d build system, you’d add “demos/xxx” to the “vkd3d_demos” variable in Makefile.am, and add lines like this:

demos_rectangle_CFLAGS = $(DEMOS_CFLAGS)
demos_rectangle_LDADD = $(DEMOS_LDADD)

inside the “if BUILD_DEMOS” block. (Much like the existing “demos_triangle_CFLAGS” and “demos_triangle_LDADD” for the triangle demo.)

After running “make”, if the build was successful, there should then be a “demos/xxx” in the build directory.

2. Debug

The main vkd3d debug mechanisms are the VKD3D_DEBUG and VKD3D_SHADER_DEBUG environment variables. (There are some other environment variables as well; they’re described in the README, but can be ignored for now.) If you e.g. wanted to see what vkd3d calls the triangle demo is making, you’d run it like this:

VKD3D_DEBUG=trace demos/triangle

and it would print debug output for libvkd3d to stderr. Similarly:

VKD3D_SHADER_DEBUG=trace demos/triangle

will print debug output for libvkd3d-shader, and

VKD3D_DEBUG=trace VKD3D_SHADER_DEBUG=trace demos/triangle &> trace.log

will print debug output for both, and redirect it to a file called “trace.log”. The possible values for these environment variables (“err” ,“fixme”, “warn”, “trace”) correspond to the ERR/FIXME/WARN/TRACE macros in the vkd3d source code. “Higher” debug levels include the output of lower levels. So e.g. VKD3D_DEBUG=warn will output ERR, FIXME, and WARN lines, while VKD3D_DEBUG=trace will output everything.

Of course it’s also possible to use more specialised external tools like e.g. gdb, valgrind or RenderDoc. For example:

gdb --args /bin/bash demos/triangle

would cause gdb to run the triangle demo, and you could then e.g. “break vkd3d_create_device” to set a breakpoint on vkd3d_create_device().

3. Run

Actually, you don’t need to run the actual executables, and can just use the wrapper scripts.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值