reflect: make reflect errors non-exhaustive

This commit is contained in:
chyyran 2022-11-27 23:37:45 -05:00
parent 9e2c914e57
commit 9cad2b9128
4 changed files with 7 additions and 10 deletions

View file

@ -54,6 +54,7 @@ Please report an issue if you run into a shader that works in RetroArch, but not
* Sampler objects are used rather than `glTexParameter`.
* Sampler inputs and outputs are not renamed. This is useful for debugging shaders in RenderDoc.
* UBO and Push Constant Buffer sizes are padded to 16-byte boundaries.
*
* Direct3D 11
* The staging buffer is not kept around when loading static textures (LUTs).
* HDR10 support is not part of the shader runtime and is not supported.

View file

@ -1,6 +1,7 @@
use crate::reflect::semantics::MemberOffset;
use thiserror::Error;
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum ShaderCompileError {
#[cfg(feature = "unstable-rust-pipeline")]
@ -32,6 +33,7 @@ pub enum SemanticsErrorKind {
InvalidTypeForSemantic(String),
}
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum ShaderReflectError {
#[cfg(feature = "unstable-rust-pipeline")]

View file

@ -1,5 +1,5 @@
use gl::types::GLint;
use librashader_reflect::reflect::semantics::{BindingStage, MemberOffset};
use librashader_reflect::reflect::semantics::BindingStage;
#[derive(Debug)]
pub enum VariableLocation {
@ -22,14 +22,6 @@ pub struct UniformLocation<T> {
}
impl UniformLocation<GLint> {
// pub fn is_fragment_valid(&self) -> bool {
// self.fragment >= 0
// }
//
// pub fn is_vertex_valid(&self) -> bool {
// self.vertex >= 0
// }
pub fn is_valid(&self, stage: BindingStage) -> bool {
let mut validity = false;
if stage.contains(BindingStage::FRAGMENT) {

View file

@ -1,4 +1,6 @@
//! Re-exports for usage of librashader in consuming libraries.
//!
//! Runtime implementations should depend directly on constituent crates.
pub mod presets {
pub use librashader_presets::*;
}