mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-02 17:30:29 +01:00
swr/rast: Move knob defaults to generated cpp file
Reduces amount of compile churn when testing different default values Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
parent
05e4ff33f5
commit
dc7b3c95a4
2 changed files with 14 additions and 7 deletions
|
|
@ -95,6 +95,13 @@ void KnobBase::autoExpandEnvironmentVariables(std::string& text)
|
|||
//========================================================
|
||||
// Static Data Members
|
||||
//========================================================
|
||||
% for knob in knobs:
|
||||
% if knob[1]['type'] == 'std::string':
|
||||
${knob[1]['type']} GlobalKnobs::Knob_${knob[0]}::m_default = "${repr(knob[1]['default'])[1:-1]}";
|
||||
% else:
|
||||
${knob[1]['type']} GlobalKnobs::Knob_${knob[0]}::m_default = ${knob[1]['default']};
|
||||
% endif
|
||||
% endfor
|
||||
GlobalKnobs g_GlobalKnobs;
|
||||
|
||||
//========================================================
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ private:
|
|||
T m_Value;
|
||||
};
|
||||
|
||||
#define DEFINE_KNOB(_name, _type, _default) \\
|
||||
#define DEFINE_KNOB(_name, _type) \\
|
||||
|
||||
struct Knob_##_name : Knob<_type> \\
|
||||
|
||||
|
|
@ -80,7 +80,11 @@ private:
|
|||
|
||||
static const char* Name() { return "KNOB_" #_name; } \\
|
||||
|
||||
static _type DefaultValue() { return (_default); } \\
|
||||
static _type DefaultValue() { return (m_default); } \\
|
||||
|
||||
private: \\
|
||||
|
||||
static _type m_default; \\
|
||||
|
||||
} _name;
|
||||
|
||||
|
|
@ -105,11 +109,7 @@ struct GlobalKnobs
|
|||
% endfor
|
||||
% endif
|
||||
//
|
||||
% if knob[1]['type'] == 'std::string':
|
||||
DEFINE_KNOB(${knob[0]}, ${knob[1]['type']}, "${repr(knob[1]['default'])[1:-1]}");
|
||||
% else:
|
||||
DEFINE_KNOB(${knob[0]}, ${knob[1]['type']}, ${knob[1]['default']});
|
||||
% endif
|
||||
DEFINE_KNOB(${knob[0]}, ${knob[1]['type']});
|
||||
|
||||
% endfor
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue