### Godot version

4.0.2

### System information

Windows 10

### Issue description

I have a meshinstance3d with a shader attached, and this is inside a subviewport. ( I instanced a bunch to make the memory rise faster, for testing purposes ).
The shader uses render_mode wireframe.
Whenever the object is onscreen, the memory will increase continuously! If the object goes offscreen, it will stop.
If I remove render_mode wireframe from the shader, the memory won't increase.
If I set debug_mode to wireframe on the subviewport, the memory won't increase.

Edit: I originally thought a subviewport was required, but it isn't. It happens even when there are no subviewports being used!


### Steps to reproduce

Open the attached project, and run the test.tscn
Watch as your memory continues to go up.
It stops if you either remove render_mode wireframe from the shader, or if you set the subviewport debug_mode to wireframe.
It also stops if the object isn't onscreen.

### Minimal reproduction project

[subViewportWireframeBug.zip](https://github.com/godotengine/godot/files/11267138/subViewportWireframeBug.zip)

#include "pipeline_cache_rd.h"
#include "core/os/memory.h"
RID PipelineCacheRD::_generate_version(RD::VertexFormatID p_vertex_format_id, RD::FramebufferFormatID p_framebuffer_format_id, bool p_wireframe, uint32_t p_render_pass, uint32_t p_bool_specializations) {