bkaradzic / bgfx

Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
https://bkaradzic.github.io/bgfx/overview.html
BSD 2-Clause "Simplified" License
14.88k stars 1.93k forks source link

Warnings for improper texture flags #1518

Open attilaz opened 5 years ago

attilaz commented 5 years ago

createFrameBuffer functions requires texture with BGFX_TEXTURERT* flags. https://github.com/bkaradzic/bgfx/blob/master/include/bgfx/bgfx.h#L2897 https://github.com/bkaradzic/bgfx/blob/master/include/bgfx/bgfx.h#L2913

setImage function requires texture with BGFX_TEXTURE_COMPUTE_WRITE ( it seems ) https://github.com/bkaradzic/bgfx/blob/master/include/bgfx/bgfx.h#L3840

It would be better to a have a warning at the function call than having an error at bgfx::renderFrame. Also docs should give some info about this.

attilaz commented 5 years ago

Another misuse was that I used bgfx::setTexture for compute dispatch, which almost worked flawlessly with d3d11 backend ( problem was that bind flags were not used for sampler ). A warning could helped to debug this easier.