gfx icon indicating copy to clipboard operation
gfx copied to clipboard

Specify clear color value

Open sayan1an opened this issue 2 years ago • 2 comments

Could you please overload gfxClearTexture/BackBuffer with user specified color value.

sayan1an avatar Jul 22 '22 19:07 sayan1an

So the reason there isn't a clear color parameter is because you actually have to supply the clear color upon creating the texture object in D3D12 and then always clear to that same color value (or you'll get some validation warnings).

You can write your own compute shader though to clear to whatever color you want, is that an ok workaround for you?

gboisse avatar Jul 25 '22 14:07 gboisse

Providing a pre-determined clear value should also work. However, gfxCreateTexture2D doesn't seem to have an overload that takes a clear-values. I have several render targets for which I would like to set a different clear-value for each.

sayan1an avatar Jul 25 '22 17:07 sayan1an

Hi, this should be fixed with https://github.com/gboisse/gfx/pull/78.

gboisse avatar Sep 14 '23 16:09 gboisse

Closing as fixed.

gboisse avatar Sep 19 '23 10:09 gboisse