#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_HLSLINPUTSIGNATURESERIALIZR_H #define NUCLEX_GRAPHICS_INTROSPECTION_HLSLINPUTSIGNATURESERIALIZR_H #include "Nuclex/Graphics/Config.h" #include "Nuclex/Graphics/Introspection/ShaderMetadata.h" #include "MiniReader.h" #include #include namespace Nuclex { namespace Graphics { namespace Introspection { // ------------------------------------------------------------------------------------------- // /// Reads the input signature chunk from a compiled HLSL shader /// /// This could also be achieved via D3DReflect(), but that method requires an extra DLL /// (d3dcompiler_xx.dll) to be shipped and is not available to WinRT / Metro games. /// Doing it by hand is just a little bit more complicated and lets us obtain this /// information in a platform independent manner. /// class HlslInputSignatureSerializer { /// Parses the input signature chunk in the compiled shader bytecode /// Reader through which the input signature will be read /// Structure the data will be stored in public: static void Read(const MiniReader &reader, ShaderMetadata &metadata); /// Parses a parameter from a shader's input signature chunk /// Reader positioned at the start of the chunk /// Reader from which the parameter will be read /// Structure that will be filled private: static void readInputParameter( const MiniReader &reader, MiniReader ¶meterReader, InputParameter &inputParameterMetadata ); }; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Graphics::Introspection #endif // NUCLEX_GRAPHICS_INTROSPECTION_HLSLINPUTSIGNATURESERIALIZR_H