-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor ShaderProfile to allow for pipeline extensibility #4992
Conversation
Refactored shader creation into a single function call.
Refactor ShaderProfile to not try to mimic an Enum.
@KonajuGames @dellis1972 - Let's be sure to squash merge this one. |
The unit tests for shader compiling all passed which is good. Want @dellis1972 to at least take a look at it first, but we should look to merge this soon. |
@tomspilman looks ok. Any chance you can give a basic example of how to extend for a new platform? Just for reference. i.e what files need to be added etc. |
Sure. This same technique will be used for all the hardware specific conversions... shaders, textures, audio. In the case of shaders you just need to create one new class that derives from
The same sort of technique will be used for texture processing:
That is it... the system will pick up the new profile and query it when trying to convert textures/shaders/audio for the new platform (or platforms) it supports. You can see how just adding a new instance of a class is a much easier extension system than having to modify |
@tomspilman thanks looks like a good change to me. |
Merging. |
…4992) * Refactored the ShaderProfile enum into extensible class. * Added Enumeration<T> for easier creation of enumeration types. Refactored shader creation into a single function call. * Helper for deleting files without exceptions. * Missed in previous commit. * Added XB1 and Vita to platforms. * Added new LoadedTypeCollection<T> helper. Refactor ShaderProfile to not try to mimic an Enum.
This PR is the first baby step towards making the content pipeline more easily extendable for new platforms.
Here I refactored the existing
enum ShaderProfile
into a class that knows how to perform various platform specific steps of the effect compiling process.This also introduces a helper class
LoadedTypeCollection<T>
which scans loaded assemblies for types of a particular base class. We use this to gather the different instances ofShaderProfile
which in the future could live in different pipeline extension assemblies.This same technique will be applied to audio and texture processing next.