Browse Source

Fix VRAM leak in compositor effect demo (#1115)

Raymond DiDonato 10 months ago
parent
commit
a87fded4cf

+ 1 - 1
compute/post_shader/post_process_grayscale.gd

@@ -19,7 +19,7 @@ func _notification(what: int) -> void:
 	if what == NOTIFICATION_PREDELETE:
 	if what == NOTIFICATION_PREDELETE:
 		if shader.is_valid():
 		if shader.is_valid():
 			# Freeing our shader will also free any dependents such as the pipeline!
 			# Freeing our shader will also free any dependents such as the pipeline!
-			RenderingServer.free_rid(shader)
+			rd.free_rid(shader)
 
 
 
 
 #region Code in this region runs on the rendering thread.
 #region Code in this region runs on the rendering thread.

+ 1 - 1
compute/post_shader/post_process_shader.gd

@@ -58,7 +58,7 @@ func _notification(what: int) -> void:
 	if what == NOTIFICATION_PREDELETE:
 	if what == NOTIFICATION_PREDELETE:
 		if shader.is_valid():
 		if shader.is_valid():
 			# Freeing our shader will also free any dependents such as the pipeline!
 			# Freeing our shader will also free any dependents such as the pipeline!
-			RenderingServer.free_rid(shader)
+			rd.free_rid(shader)
 
 
 
 
 #region Code in this region runs on the rendering thread.
 #region Code in this region runs on the rendering thread.