mono/MonoGame — pull request #1318 by tomspilman (2013-02-08 08:37:38+00:00)
Title: MGFX Integer And Boolean Types

This commit fixes #1222.

I've added support for boolean and integer types in the Effect/Shader runtime.

In this process I optimized away the garbage generation in ConstantBuffer.SetData() by making EffectParameter always use an array type... even for singular values. We also now do all type casting in EffectParameter.SetValue() instead of ConstantBuffer.SetData().

- EffectParameter now stores all values in Array types.
- ConstantBuffer.SetData() now assumes all parameters are Array types.
- Implemented SetValue/GetValue for boolean types in EffectParameter.
- Added exceptions when setting/getting the wrong type in EffectParameter.
- Removed EffectParameter.SetValue(object).

This changed several of the methods in EffectParameter. I tested it on Windows OpenGL, Windows DirectX, and Windows Store apps.

It could use testing on iOS and Android as well as any MonoGame projects that make a big use of custom shaders.