From 241a8956c4179b0f15fa1482fb32d5a43dba5c30 Mon Sep 17 00:00:00 2001 From: Istvan Kiss Date: Thu, 21 Nov 2024 13:38:40 +0100 Subject: [PATCH] WIP --- .wordlist.txt | 2 -- docs/how-to/hip_runtime_api/opengl_interop.rst | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.wordlist.txt b/.wordlist.txt index b8bd9c9a50..47de710ac9 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -90,7 +90,6 @@ libc libstdc lifecycle linearizing -literalinclude LOC LUID ltrace @@ -114,7 +113,6 @@ Numa Nsight ocp omnitrace -opengl overindex overindexing oversubscription diff --git a/docs/how-to/hip_runtime_api/opengl_interop.rst b/docs/how-to/hip_runtime_api/opengl_interop.rst index e843d103b4..9478a6ad59 100644 --- a/docs/how-to/hip_runtime_api/opengl_interop.rst +++ b/docs/how-to/hip_runtime_api/opengl_interop.rst @@ -42,22 +42,32 @@ the window's framebuffer in a cycle until the window is not closed. The more recent OpenGL functions are loaded with `OpenGL loader `_, as these are not loaded by default on all platforms. The use of a custom loader is shown in the following example + + .. .. literalinclude:: ../../tools/example_codes/opengl_interop.hip :start-after: // [Sphinx opengl functions load start] :end-before: // [Sphinx opengl functions load end] :language: cpp + .. + The OpenGL buffer is imported to HIP in the following way: +.. + .. literalinclude:: ../../tools/example_codes/opengl_interop.hip :start-after: // [Sphinx buffer register and get start] :end-before: // [Sphinx buffer register and get end] :language: cpp +.. + The imported pointer is manipulated in the sinewave kernel as shown in the following example: +.. + .. literalinclude:: ../../tools/example_codes/opengl_interop.hip :start-after: /// [Sphinx sinewave kernel start] :end-before: /// [Sphinx sinewave kernel end] @@ -68,10 +78,16 @@ following example: :end-before: // [Sphinx buffer use in kernel end] :language: cpp +.. + The HIP graphics resource that is imported from the OpenGL buffer has to be unmap and unregister in the following way: +.. + .. literalinclude:: ../../tools/example_codes/opengl_interop.hip :start-after: // [Sphinx unregister start] :end-before: // [Sphinx unregister end] :language: cpp + +..