mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
ShaderGen: use cbuffers for D3D
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user