DesktopVK - Texture/Sampler registers out of range when not explicitly assigned to a register slot
Author: TheKrumpetCreated Jun 8, 2025Updated Sep 24, 2026
Labelsbugscope: vulkanscope: shadersplatform: windows
Prerequisites
- I have verified this issue is present in the
developbranch - I have searched open and closed issues to ensure it has not already been reported.
MonoGame Version
MonoGame develop - DesktopVK
Which MonoGame platform are you using?
N/A
Operating System
Windows
Description
When writing a shader in DesktopVK, if you don't explicitly assign registers to textures and samplers then they get auto assigned registers outside of the allowed range, which causes the following error:
TextureCollection.cs
Steps to Reproduce
Write a shader without explicitly assigned registers:
// Breaks
Texture2D<float3> Texture;
SamplerState TextureSampler;
// Works
Texture2D<float3> Texture : register(t0);
SamplerState TextureSampler : register(s0);Minimal Example Repo
No response
Expected Behavior
Either -
- Using a texture parameter without an explicit register works without issue (either by restricting the output register range, or by extending the allowed register range on MonoGame's side)
- This issue is documented as a required step for a DesktopVK (and I'd assume DX12) shader.
Resulting Behavior
The shader program errors on apply.
Files
No response
Source: MonoGame/MonoGame