|
@@ -1122,8 +1122,10 @@ namespace CamelotEngine
|
|
|
GpuLogicalIndexUse* GpuProgramParameters::_getIntConstantLogicalIndexUse(size_t logicalIndex, size_t requestedSize, UINT16 variability)
|
|
GpuLogicalIndexUse* GpuProgramParameters::_getIntConstantLogicalIndexUse(size_t logicalIndex, size_t requestedSize, UINT16 variability)
|
|
|
{
|
|
{
|
|
|
if (mIntLogicalToPhysical == nullptr)
|
|
if (mIntLogicalToPhysical == nullptr)
|
|
|
|
|
+ {
|
|
|
CM_EXCEPT(InvalidParametersException,
|
|
CM_EXCEPT(InvalidParametersException,
|
|
|
"This is not a low-level parameter parameter object");
|
|
"This is not a low-level parameter parameter object");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
GpuLogicalIndexUse* indexUse = 0;
|
|
GpuLogicalIndexUse* indexUse = 0;
|
|
|
CM_LOCK_MUTEX(mIntLogicalToPhysical->mutex)
|
|
CM_LOCK_MUTEX(mIntLogicalToPhysical->mutex)
|
|
@@ -1267,8 +1269,10 @@ namespace CamelotEngine
|
|
|
GpuConstantDefinitionIterator GpuProgramParameters::getConstantDefinitionIterator(void) const
|
|
GpuConstantDefinitionIterator GpuProgramParameters::getConstantDefinitionIterator(void) const
|
|
|
{
|
|
{
|
|
|
if (mNamedConstants == nullptr)
|
|
if (mNamedConstants == nullptr)
|
|
|
|
|
+ {
|
|
|
CM_EXCEPT(InvalidParametersException,
|
|
CM_EXCEPT(InvalidParametersException,
|
|
|
"This params object is not based on a program with named parameters.");
|
|
"This params object is not based on a program with named parameters.");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return mNamedConstants->map.begin();
|
|
return mNamedConstants->map.begin();
|
|
|
|
|
|
|
@@ -1277,8 +1281,10 @@ namespace CamelotEngine
|
|
|
const GpuNamedConstants& GpuProgramParameters::getConstantDefinitions() const
|
|
const GpuNamedConstants& GpuProgramParameters::getConstantDefinitions() const
|
|
|
{
|
|
{
|
|
|
if (mNamedConstants == nullptr)
|
|
if (mNamedConstants == nullptr)
|
|
|
|
|
+ {
|
|
|
CM_EXCEPT(InvalidParametersException,
|
|
CM_EXCEPT(InvalidParametersException,
|
|
|
"This params object is not based on a program with named parameters.");
|
|
"This params object is not based on a program with named parameters.");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return *mNamedConstants;
|
|
return *mNamedConstants;
|
|
|
}
|
|
}
|
|
@@ -1286,8 +1292,10 @@ namespace CamelotEngine
|
|
|
const GpuConstantDefinition& GpuProgramParameters::getConstantDefinition(const String& name) const
|
|
const GpuConstantDefinition& GpuProgramParameters::getConstantDefinition(const String& name) const
|
|
|
{
|
|
{
|
|
|
if (mNamedConstants == nullptr)
|
|
if (mNamedConstants == nullptr)
|
|
|
|
|
+ {
|
|
|
CM_EXCEPT(InvalidParametersException,
|
|
CM_EXCEPT(InvalidParametersException,
|
|
|
"This params object is not based on a program with named parameters.");
|
|
"This params object is not based on a program with named parameters.");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
// locate, and throw exception if not found
|
|
// locate, and throw exception if not found
|
|
@@ -1304,8 +1312,11 @@ namespace CamelotEngine
|
|
|
if (mNamedConstants == nullptr)
|
|
if (mNamedConstants == nullptr)
|
|
|
{
|
|
{
|
|
|
if (throwExceptionIfNotFound)
|
|
if (throwExceptionIfNotFound)
|
|
|
|
|
+ {
|
|
|
CM_EXCEPT(InvalidParametersException,
|
|
CM_EXCEPT(InvalidParametersException,
|
|
|
"Named constants have not been initialised, perhaps a compile error.");
|
|
"Named constants have not been initialised, perhaps a compile error.");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1313,8 +1324,11 @@ namespace CamelotEngine
|
|
|
if (i == mNamedConstants->map.end())
|
|
if (i == mNamedConstants->map.end())
|
|
|
{
|
|
{
|
|
|
if (throwExceptionIfNotFound)
|
|
if (throwExceptionIfNotFound)
|
|
|
|
|
+ {
|
|
|
CM_EXCEPT(InvalidParametersException,
|
|
CM_EXCEPT(InvalidParametersException,
|
|
|
"Parameter called " + name + " does not exist. ");
|
|
"Parameter called " + name + " does not exist. ");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
@@ -1659,8 +1673,10 @@ namespace CamelotEngine
|
|
|
GpuProgramParameters::findFloatAutoConstantEntry(size_t logicalIndex)
|
|
GpuProgramParameters::findFloatAutoConstantEntry(size_t logicalIndex)
|
|
|
{
|
|
{
|
|
|
if (mFloatLogicalToPhysical == nullptr)
|
|
if (mFloatLogicalToPhysical == nullptr)
|
|
|
|
|
+ {
|
|
|
CM_EXCEPT(InvalidParametersException,
|
|
CM_EXCEPT(InvalidParametersException,
|
|
|
"This is not a low-level parameter parameter object");
|
|
"This is not a low-level parameter parameter object");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return _findRawAutoConstantEntryFloat(
|
|
return _findRawAutoConstantEntryFloat(
|
|
|
_getFloatConstantPhysicalIndex(logicalIndex, 0, GPV_GLOBAL));
|
|
_getFloatConstantPhysicalIndex(logicalIndex, 0, GPV_GLOBAL));
|
|
@@ -1671,8 +1687,10 @@ namespace CamelotEngine
|
|
|
GpuProgramParameters::findIntAutoConstantEntry(size_t logicalIndex)
|
|
GpuProgramParameters::findIntAutoConstantEntry(size_t logicalIndex)
|
|
|
{
|
|
{
|
|
|
if (mIntLogicalToPhysical == nullptr)
|
|
if (mIntLogicalToPhysical == nullptr)
|
|
|
|
|
+ {
|
|
|
CM_EXCEPT(InvalidParametersException,
|
|
CM_EXCEPT(InvalidParametersException,
|
|
|
"This is not a low-level parameter parameter object");
|
|
"This is not a low-level parameter parameter object");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return _findRawAutoConstantEntryInt(
|
|
return _findRawAutoConstantEntryInt(
|
|
|
_getIntConstantPhysicalIndex(logicalIndex, 0, GPV_GLOBAL));
|
|
_getIntConstantPhysicalIndex(logicalIndex, 0, GPV_GLOBAL));
|
|
@@ -1684,8 +1702,10 @@ namespace CamelotEngine
|
|
|
GpuProgramParameters::findAutoConstantEntry(const String& paramName)
|
|
GpuProgramParameters::findAutoConstantEntry(const String& paramName)
|
|
|
{
|
|
{
|
|
|
if (mNamedConstants == nullptr)
|
|
if (mNamedConstants == nullptr)
|
|
|
|
|
+ {
|
|
|
CM_EXCEPT(InvalidParametersException,
|
|
CM_EXCEPT(InvalidParametersException,
|
|
|
"This params object is not based on a program with named parameters.");
|
|
"This params object is not based on a program with named parameters.");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
const GpuConstantDefinition& def = getConstantDefinition(paramName);
|
|
const GpuConstantDefinition& def = getConstantDefinition(paramName);
|
|
|
if (def.isFloat())
|
|
if (def.isFloat())
|