mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 08:50:13 +01:00
ir_variable: Add method to get string representing interpolation qualifier
This commit is contained in:
parent
cc22c5a544
commit
950ceb2bd6
2 changed files with 27 additions and 0 deletions
17
ir.cpp
17
ir.cpp
|
|
@ -738,6 +738,23 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name)
|
|||
}
|
||||
|
||||
|
||||
const char *
|
||||
ir_variable::interpolation_string() const
|
||||
{
|
||||
if (!this->shader_in && !this->shader_out)
|
||||
return "";
|
||||
|
||||
switch (this->interpolation) {
|
||||
case ir_var_smooth: return "smooth";
|
||||
case ir_var_flat: return "flat";
|
||||
case ir_var_noperspective: return "noperspective";
|
||||
}
|
||||
|
||||
assert(!"Should not get here.");
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
ir_function_signature::ir_function_signature(const glsl_type *return_type)
|
||||
: return_type(return_type), is_defined(false)
|
||||
{
|
||||
|
|
|
|||
10
ir.h
10
ir.h
|
|
@ -177,6 +177,16 @@ public:
|
|||
return var;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the string value for the interpolation qualifier
|
||||
*
|
||||
* \return
|
||||
* If none of \c shader_in or \c shader_out is set, an empty string will
|
||||
* be returned. Otherwise the string that would be used in a shader to
|
||||
* specify \c mode will be returned.
|
||||
*/
|
||||
const char *interpolation_string() const;
|
||||
|
||||
const char *name;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue