Repository: godot
Issue: SubViewport & TileMap doesn't respect Visibility Layer / Canvas Cull Mask when Y Sort is enabled.
Labels: bug,topic:rendering,topic:2d

### Godot version

4.0.1-stable_win64

### System information

Windows 11

### Issue description

Enabling Y-Sort for a TileMap node causes it to show up in a SubViewport even when the visibility_layer and canvas_cull_mask don't match.

Should look like this:
![image](https://user-images.githubusercontent.com/1381261/226813424-d08a98b1-3b82-43f3-b31d-dbd7f5a9e099.png)

Get this with Y Sort toggled on:
![image](https://user-images.githubusercontent.com/1381261/226813471-564beff7-2f5d-4788-a2e7-172d2df3f712.png)


I've had a look at `tile_map.cpp` and it doesn't look like the `visibility_layer` is passed to the canvas_items it creates. tile_map overrides [set_light_mask](https://github.com/godotengine/godot/blob/master/scene/2d/tile_map.cpp#L3899) and passes this along, seems it would be appropriate to pass along the visibility_layer as well? 


I've patched this locally and seems to work but it involved making [set_visibility_layer](https://github.com/godotengine/godot/blob/master/scene/main/canvas_item.h#L239) and [set_visibility_layer_bit](https://github.com/godotengine/godot/blob/master/scene/main/canvas_item.h#L242) methods overridable in canvas_item.h.

The tile_map.cpp changes:
```
void TileMap::_update_visibility_layer_for_canvas_items() {
	for (unsigned int layer = 0; layer < layers.size(); layer++) {
		for (KeyValue<Vector2i, TileMapQuadrant> &E : layers[layer].quadrant_map) {
			TileMapQuadrant &q = E.value;
			for (const RID &ci : q.canvas_items) {
				RS::get_singleton()->canvas_item_set_visibility_layer(ci, get_visibility_layer());
			}
		}
		_rendering_update_layer(layer);
	}
}

void TileMap::set_visibility_layer(uint32_t p_visibility_layer) {
	// Set material for the whole tilemap.
	CanvasItem::set_visibility_layer(p_visibility_layer);

	TileMap::_update_visibility_layer_for_canvas_items();
}

void TileMap::set_visibility_layer_bit(uint32_t p_visibility_layer, bool p_enable) {
	CanvasItem::set_visibility_layer_bit(p_visibility_layer, p_enable);

	TileMap::_update_visibility_layer_for_canvas_items();
}
```

Not really confident with engine or c++ dev and contributing but happy to make a PR.

### Steps to reproduce

Given this scene tree:

![image](https://user-images.githubusercontent.com/1381261/226809834-6f06423c-b7b8-4722-bf18-912e2d429030.png)

and these settings:

Viewport (`SubViewportCullMaskSetTo2`):
![image](https://user-images.githubusercontent.com/1381261/226809891-40330624-dbe8-4733-953c-dc130320717e.png)

TileMap (`TileMapSetToVisibleOnLayer1`):
![image](https://user-images.githubusercontent.com/1381261/226809921-42ded7eb-5661-45eb-9a60-9128f2325e8a.png)

Parent Nodes (`Node2D_VisibleSetToLayer1And2` and `VisibleSetToLayer1And2`):
![image](https://user-images.githubusercontent.com/1381261/226809977-5f6cd386-a28f-4274-857d-c8c27b28804e.png)

The tilemap will still be present in the viewport texture of `ViewportTextureShowsTileMapAndSprite`

### Minimal reproduction project

[Tile Map Visibility Layer For Canvas Items.zip](https://github.com/godotengine/godot/files/11036580/Tile.Map.Visibility.Layer.For.Canvas.Items.zip)