mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +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>
|
||||
|
||||
@@ -100,6 +100,7 @@ VA_IGNORE_REST_OF_FILE
|
||||
%ignore rdcfixedarray::operator[];
|
||||
%ignore rdcliteral;
|
||||
%ignore rdcpair;
|
||||
%ignore rdhalf;
|
||||
%ignore bytebuf;
|
||||
|
||||
// special handling for RENDERDOC_GetDefaultCaptureOptions to transform output parameter to a return value
|
||||
@@ -331,6 +332,7 @@ TEMPLATE_FIXEDARRAY_INSTANTIATE(rdcfixedarray, ResourceId, 8)
|
||||
TEMPLATE_FIXEDARRAY_INSTANTIATE(rdcfixedarray, bool, 4)
|
||||
TEMPLATE_FIXEDARRAY_INSTANTIATE(rdcfixedarray, bool, 8)
|
||||
TEMPLATE_FIXEDARRAY_INSTANTIATE(rdcfixedarray, float, 16)
|
||||
TEMPLATE_FIXEDARRAY_INSTANTIATE(rdcfixedarray, rdhalf, 16)
|
||||
TEMPLATE_FIXEDARRAY_INSTANTIATE(rdcfixedarray, int32_t, 16)
|
||||
TEMPLATE_FIXEDARRAY_INSTANTIATE(rdcfixedarray, uint32_t, 16)
|
||||
TEMPLATE_FIXEDARRAY_INSTANTIATE(rdcfixedarray, double, 16)
|
||||
|
||||
Reference in New Issue
Block a user