ShaderGen: use cbuffers for D3D

This commit is contained in:
degasus
2014-03-17 10:19:54 +01:00
parent fe9fcfdd07
commit b0878c54b2
3 changed files with 7 additions and 26 deletions

View File

@ -151,31 +151,10 @@ private:
std::vector<bool> constant_usage; // TODO: Is vector<bool> appropriate here?
};
template<class T>
static inline void WriteRegister(T& object, API_TYPE ApiType, const char *prefix, const u32 num)
{
if (ApiType == API_OPENGL)
return; // Nothing to do here
object.Write(" : register(%s%d)", prefix, num);
}
template<class T>
static inline void WriteLocation(T& object, API_TYPE ApiType)
{
if (ApiType == API_OPENGL)
return;
object.Write("uniform ");
}
template<class T>
static inline void DeclareUniform(T& object, API_TYPE api_type, const u32 num, const char* type, const char* name)
{
WriteLocation(object, api_type);
object.Write("%s %s ", type, name);
WriteRegister(object, api_type, "c", num);
object.Write(";\n");
object.Write("%s %s;\n", type, name);
}
/**