Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
863 B

  1. //================ Copyright (c) 1996-2009 Valve Corporation. All Rights Reserved. =================
  2. #include "cgutils.h"
  3. #include "tier0/dbg.h"
  4. struct DatatypeRec_t
  5. {
  6. CGtype type;
  7. CGparameterclass parameterClass;
  8. };
  9. static DatatypeRec_t s_datatypeClassname[] = {
  10. #define CG_DATATYPE_MACRO(name, compiler_name, enum_name, base_enum, nrows, ncols,classname) \
  11. { enum_name, classname },
  12. #include <Cg/cg_datatypes.h>
  13. #undef CG_DATATYPE_MACRO
  14. };
  15. CGparameterclass vcgGetTypeClass( CGtype type )
  16. {
  17. if( type <= CG_TYPE_START_ENUM || type > CG_TYPE_START_ENUM + sizeof( s_datatypeClassname ) / sizeof( s_datatypeClassname[0] ) )
  18. {
  19. return CG_PARAMETERCLASS_UNKNOWN;
  20. }
  21. else
  22. {
  23. DatatypeRec_t & rec = s_datatypeClassname[type - CG_TYPE_START_ENUM - 1];
  24. Assert( rec.type == type );
  25. return rec.parameterClass;
  26. }
  27. }