Radium-Engine icon indicating copy to clipboard operation
Radium-Engine copied to clipboard

Update texture data

Open hiergaut opened this issue 3 years ago • 9 comments

Check if you branch history is PR compatible

  • Your branch need to be up to date with origin/master AND to have linear history (i.e. no merge commit).
  • Update your git repository git fetch origin if origin is this remote
  • Check with the script provided in scripts/is-history-pr-compatible.sh
  • You must use clang-format style These checks are enforced by github workflow actions Please refer to the corresponding log in case of failure

UPDATE the form below to describe your PR.

  • Please check if the PR fulfills these requirements
  • [ ] The commit message follows our guidelines
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been added / updated (for bug fixes / features)

Be aware that the PR request cannot be accepted if it doesn't pass the Continuous Integration tests.

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) Added feature of updating texture data (cpu) for any thread and auto update the (gpu) data during the rendering loop.

  • What is the current behavior? (You can also link to an open issue here) No texture update is possible from a different thread as rendered thread.

  • What is the new behavior (if this is a feature change)? You can update texture everywhere in your code.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?) updateData(const void*data) -> updateData(void *data) before : The function updateData performed the updateGL cpu -> gpu with const user pointer. (not internal data, textureParameter.texels). now : The function updateData performs the update of internal data pointer (only cpu). The update of gpu representation will be done later during the rendering loop.

  • Other information:

hiergaut avatar Jul 27 '22 19:07 hiergaut

Codecov Report

Merging #982 (3a73540) into release-candidate (6bdcc74) will decrease coverage by 0.08%. The diff coverage is 26.00%.

:exclamation: Current head 3a73540 differs from pull request most recent head d471254. Consider uploading reports for the commit d471254 to get more accurate results

@@                  Coverage Diff                  @@
##           release-candidate     #982      +/-   ##
=====================================================
- Coverage              43.99%   43.90%   -0.09%     
=====================================================
  Files                    335      335              
  Lines                  22364    22408      +44     
=====================================================
  Hits                    9838     9838              
- Misses                 12526    12570      +44     
Impacted Files Coverage Δ
src/Engine/Data/Texture.hpp 50.00% <0.00%> (-5.56%) :arrow_down:
src/Engine/RadiumEngine.cpp 62.29% <0.00%> (-1.20%) :arrow_down:
src/Engine/RadiumEngine.hpp 100.00% <ø> (ø)
src/Engine/Rendering/Renderer.cpp 52.19% <ø> (ø)
src/Gui/BaseApplication.cpp 0.00% <0.00%> (ø)
src/Core/Tasks/TaskQueue.cpp 27.05% <8.33%> (-4.28%) :arrow_down:
src/Engine/Data/Texture.cpp 26.77% <35.29%> (-1.54%) :arrow_down:
src/Core/Asset/Camera.cpp 96.80% <0.00%> (ø)
src/Engine/Data/TextureManager.cpp 6.66% <0.00%> (ø)
src/Engine/Data/EnvironmentTexture.cpp 72.88% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Jul 27 '22 20:07 codecov[bot]

Thanks for your feedback, I'll implement the mentioned points probably in the evening.

hiergaut avatar Jul 28 '22 07:07 hiergaut

Thanks for your feedback, I have added the missing comments now.

hiergaut avatar Jul 30 '22 09:07 hiergaut

@hiergaut Can you please add tests to this PR, to cover the new classes added (can be inspired from the example). Current coverage change is -2%.

nmellado avatar Sep 14 '22 12:09 nmellado

I have a serious problem, I can not rebase, there is a conflict that I do not understand the origin. I only added a test, I do not understand why git is so angry with me. Could someone help me to solve this problem together to solve this problem alone in the future ?

hiergaut avatar Sep 22 '22 20:09 hiergaut

New proposal using taskQueue to handle gpuTasks, by the engine. This new proposal misses some doc and polish. If ok with the idea, and after accepting this PR, some work can be done to move other gpu sync task to the engine task queue.

dlyr avatar Oct 14 '22 14:10 dlyr

Please, can you make both examples ("TexturedQuad", "TexturedQuadDynamic") work without having a segmentation fault during the registerTask with the new implemented method (TaskQueue) ? I would like to do some comparison tests with the previous implem. The "TexturedQuadDynamic" example being very representative of what I can have in my application (raw data stream on different threads).

hiergaut avatar Oct 16 '22 20:10 hiergaut

@hiergaut my bad I forgot one file in my last commit, now should be ok, if not please report where the segfault occurs.

dlyr avatar Oct 17 '22 04:10 dlyr

@hiergaut are you fine with this proposal ? Can you confirm the final version works for you ?

nmellado avatar Oct 26 '22 12:10 nmellado

It works on my side @nmellado, sorry for the late reply, I didn't remember receiving a notification email for your request, or I deleted the email by mistake.

hiergaut avatar Nov 08 '22 13:11 hiergaut