#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_GRAPHICS_INTROSPECTION_CONSTANTMETADATA_H #define NUCLEX_GRAPHICS_INTROSPECTION_CONSTANTMETADATA_H #include "Nuclex/Graphics/Config.h" #include "ConstantOrder.h" #include "ConstantType.h" #include #include #include #include namespace Nuclex { namespace Graphics { namespace Introspection { // ------------------------------------------------------------------------------------------- // /// Variable passed to the shader directly via a constant buffer /// /// /// Shaders execute many times in parallel on different inputs received from either /// vertex buffers (in case of vertex shaders) or from vertex shader outputs (in /// case of pixel shaders). /// /// /// There are some constants that stay the same across all these executions. For /// example, the camera position or light direction. These are stored in a constant /// buffers and get reused by the shader for at least an entire draw call. /// /// struct ConstantMetadata { /// Name the constant has been declared with in the shader public: std::string Name; /// Offset of the constant in the constant buffer public: std::size_t Offset; /// Size of the constant in bytes public: std::size_t Size; /// Order of the value in the constant, from scalar to matrix public: ConstantOrder::Enum Order; /// The data type of the constant public: ConstantType::Enum Type; /// Contains the default value of the constant public: std::vector DefaultValue; /// Number of columns in a matrix or elements in a vector public: std::size_t ColumnCount; /// Number of rows in a matrix public: std::size_t RowCount; }; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Graphics::Introspection #endif // NUCLEX_GRAPHICS_INTROSPECTION_CONSTANTMETADATA_H