From 53d814e66c3441412444b8b547bfcb870d1a027b Mon Sep 17 00:00:00 2001 From: DevPoodle Date: Mon, 3 Mar 2025 21:51:36 -0800 Subject: [PATCH] Add reminder to free RID's in compute shader tutorial --- tutorials/shaders/compute_shaders.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tutorials/shaders/compute_shaders.rst b/tutorials/shaders/compute_shaders.rst index fa6adbcc4e6..3e5c9e0b101 100644 --- a/tutorials/shaders/compute_shaders.rst +++ b/tutorials/shaders/compute_shaders.rst @@ -366,6 +366,16 @@ the data and print the results to our console. GD.Print("Input: ", string.Join(", ", input)); GD.Print("Output: ", string.Join(", ", output)); +Freeing memory +------------------ + +The ``buffer``, ``pipeline``, and ``uniform_set`` variables we've been using are +each an :ref:`class_RID`. Because RenderingDevice is meant to be a lower-level +API, RIDs aren't freed automatically. This means that once you're done using +``buffer`` or any other RID, you are responsible for freeing its memory +manually using the RenderingDevice's +:ref:`free_rid()` method. + With that, you have everything you need to get started working with compute shaders.