public void ValidateAllPresent(VertexFormat expectedVertexLocations) { if (expectedVertexLocations == VertexFormat.Plain) { LocationValidation.ValidateSingleVertex(Location_Position, nameof(Location_Position), true); } else if (expectedVertexLocations == VertexFormat.WithColor) { LocationValidation.ValidateSingleVertex(Location_Position, nameof(Location_Position), true); LocationValidation.ValidateSingleVertex(Location_Color, nameof(Location_Color), true); } else if (expectedVertexLocations == VertexFormat.WithTexture) { LocationValidation.ValidateSingleVertex(Location_Position, nameof(Location_Position), true); LocationValidation.ValidateSingleVertex(Location_Texture, nameof(Location_Texture), true); } else if (expectedVertexLocations == VertexFormat.WithColorAndTexture) { LocationValidation.ValidateSingleVertex(Location_Position, nameof(Location_Position), true); LocationValidation.ValidateSingleVertex(Location_Texture, nameof(Location_Texture), true); LocationValidation.ValidateSingleVertex(Location_Color, nameof(Location_Color), true); } else { throw new InvalidOperationException(expectedVertexLocations + " vertexLocations not supported."); } }
private void ValidateSingle(KnownFragmentShaderUniform uniform) { if (uniform == KnownFragmentShaderUniform.Dimension) { LocationValidation.ValidateSingleUniform(Location_iResolution, nameof(Location_iResolution), false); } else if (uniform == KnownFragmentShaderUniform.Time) { LocationValidation.ValidateSingleUniform(Location_iTime, nameof(Location_iTime), false); } else if (uniform == KnownFragmentShaderUniform.Mouse) { LocationValidation.ValidateSingleUniform(Location_iMouse, nameof(Location_iMouse), false); } else if (uniform == KnownFragmentShaderUniform.Texture) { LocationValidation.ValidateSingleUniform(Location_iTexture, nameof(Location_iTexture), false); } else if (uniform == KnownFragmentShaderUniform.CursorPosition) { LocationValidation.ValidateSingleUniform(Location_iCursorPosition, nameof(Location_iCursorPosition), false); } else if (uniform == KnownFragmentShaderUniform.CursorMovement) { LocationValidation.ValidateSingleUniform(Location_iCursorMovement, nameof(Location_iCursorMovement), false); } }