Ocular Engine
Ocular::Graphics::D3D11UncompiledShaderResourceLoader Class Reference

#include <D3D11UncompiledShaderResourceLoader.hpp>

Inheritance diagram for Ocular::Graphics::D3D11UncompiledShaderResourceLoader:

Public Member Functions

virtual bool loadResource (Core::Resource *&resource, Core::File const &file, std::string const &mappingName) override
- Public Member Functions inherited from Ocular::Core::AResourceLoader
 AResourceLoader (std::string const &extension, ResourceType type)
virtual std::string getSupportedFileType () const
virtual bool loadSubResource (Resource *&resource, File const &file, std::string const &mappingName)
virtual bool exploreResource (File const &file)
ResourceType getResourceType () const

Protected Member Functions

bool getD3DDevice ()
bool compileVertexShader (Core::File const &file, LPCWSTR source, ShaderProgram *program)
void compileGeometryShader (Core::File const &file, LPCWSTR source, ShaderProgram *program)
void compileFragmentShader (Core::File const &file, LPCWSTR source, ShaderProgram *program)
void compilePreTessellationShader (Core::File const &file, LPCWSTR source, ShaderProgram *program)
void compilePostTessellationShader (Core::File const &file, LPCWSTR source, ShaderProgram *program)
bool isEntryPointError (ID3DBlob *errorLog) const
- Protected Member Functions inherited from Ocular::Core::AResourceLoader
bool isFileValid (Core::File const &file) const

Additional Inherited Members

- Protected Attributes inherited from Ocular::Core::AResourceLoader
std::string m_SupportedExtension
ResourceType m_Type

Detailed Description

Resource loader for all uncompiled D3D11 shader files. This loader maps to the '.hlsl' extension.

Each file is checked for individual shader programs (one of each type), and then the individual shaders are combined into a single ShaderProgram resource.

A file may have all shader types present, or only one. For any non-present shaders, the ShaderProgram will be assigned a NULL value. The supported shader types for D3D11 are:

Fragment (Pixel)
Pre-Tessellation (Hull)
Post-Tessellation (Domain)

When checking for the presence of particular shaders, the following entry points are tested:

Shader Type Entry Points
Vertex VertexMain, VertMain, VSMain, MainVS
Geometry GeometryMain, GSMain, MainGS
Fragment FragmentMain, FragMain, FSMain, MainFS, PixelMain, PixMain, PSMain, MainPS
Pre-Tessellation PreTessellationMain, PreTessMain, HullMain, HSMain, MainHS
Post-Tessellation PostTessellationMain, PostTessMain, DomainMain, DSMain, MainDS

All shaders are assumed to be valid Shader Model 5 (D3D 11 and 11.1).

For pre-compiled binary shaders (.cso), see the D3D11CompiledShaderResourceLoader class.

Member Function Documentation

bool Ocular::Graphics::D3D11UncompiledShaderResourceLoader::loadResource ( Core::Resource *&  resource,
Core::File const &  file,
std::string const &  mappingName 

Reimplemented from Ocular::Core::AResourceLoader.

The documentation for this class was generated from the following files: