mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Refactor ShaderVariable use and non-32-bit precision. Closes #2466
This commit is contained in:
@@ -364,6 +364,25 @@ struct TypeConversion<double, false>
|
||||
static PyObject *ConvertToPy(const double &in) { return PyFloat_FromDouble(in); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TypeConversion<rdhalf, false>
|
||||
{
|
||||
static int ConvertFromPy(PyObject *in, rdhalf &out)
|
||||
{
|
||||
if(!PyFloat_Check(in))
|
||||
return SWIG_TypeError;
|
||||
|
||||
out.set(float(PyFloat_AsDouble(in)));
|
||||
|
||||
if(PyErr_Occurred())
|
||||
return SWIG_OverflowError;
|
||||
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
static PyObject *ConvertToPy(const rdhalf &in) { return PyFloat_FromDouble((float)in); }
|
||||
};
|
||||
|
||||
// partial specialisation for enums, we just convert as their underlying type,
|
||||
// whatever integer size that happens to be
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user