/// <summary>
        /// Loads the fields info for the current shader being loaded
        /// </summary>
        private void LoadFieldsInfo()
        {
            IReadOnlyList <FieldInfo> shaderFields = ShaderType.GetFields().ToArray();

            if (shaderFields.Any(fieldInfo => fieldInfo.IsStatic))
            {
                throw new InvalidOperationException("Empty shader body");
            }

            // Descriptor for the buffer for captured scalar/vector variables
            DescriptorRanges.Add(new DescriptorRange1(DescriptorRangeType.ConstantBufferView, 1, _ConstantBuffersCount++));

            // Inspect the captured fields
            foreach (FieldInfo fieldInfo in shaderFields)
            {
                LoadFieldInfo(fieldInfo);
            }
        }