ConfettiFX / The-Forge

The Forge Cross-Platform Rendering Framework PC Windows, Steamdeck (native), Ray Tracing, macOS / iOS, Android, XBOX, PS4, PS5, Switch, Quest 2
Apache License 2.0
4.8k stars 501 forks source link

Texture updates broken #109

Closed jdswebb closed 5 years ago

jdswebb commented 5 years ago

See:

https://github.com/ConfettiFX/The-Forge/blob/master/Common_3/Renderer/ResourceLoader.cpp#L1022

pImage is created but never assigned to the update description.

jdswebb commented 5 years ago

After I fixed the above issue on my local TF build, I've encountered another issue related texture updates/creation with DX12 specifically.

If you create an empty texture by setting the pDesc on the TextureLoadDesc, this line will overwrite the start state on the description with either a SRV/UAV state:

https://github.com/ConfettiFX/The-Forge/blob/a06e0ee2cf3ad22aa816fcbfaa5ffcfa98a32f24/Common_3/Renderer/ResourceLoader.cpp#L904

updateTexture() then fails as the copy queue can not do auto-promotion from that state to COPY_DEST. All other texture creation methods seem to leave the newly created texture in either the COPY_DEST or COMMON state so updateTexture() calls work.

Maybe this is all intended behaviour though - I've worked around it by either first transitioning the state on the graphics queue first or removing this line that overwrites the start state.

wolfgangfengel commented 5 years ago

@jdswebb Did we actually fix this? Please close in case we did ..

jdswebb commented 5 years ago

It doesn't look like anything changed that would fix this browsing the source. I'm not using updateTexture any more so I can't verify that for sure without making a new repro case.

wolfgangfengel commented 5 years ago

is fixed now.