mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-05 07:39:17 +00:00
ShaderGen: use cbuffers for D3D
This commit is contained in:
parent
fe9fcfdd07
commit
b0878c54b2
3 changed files with 7 additions and 26 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue