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.

91 lines
3.1 KiB

  1. #ifndef RENDERBUFFER_G_H
  2. #define RENDERBUFFER_G_H
  3. #ifdef COMPILER_MSVC
  4. #pragma once
  5. #endif
  6. #include "resourcefile/resourcefile.h"
  7. #include "resourcefile/resourcetype.h"
  8. //-----------------------------------------------------------------------------
  9. // Forward declarations
  10. //-----------------------------------------------------------------------------
  11. struct RenderInputLayoutField2_t;
  12. struct RenderBufferDesc_t;
  13. struct RenderBufferBits_t;
  14. //-----------------------------------------------------------------------------
  15. // Enum definitions
  16. //-----------------------------------------------------------------------------
  17. schema enum RenderBufferType_t
  18. {
  19. RENDER_BUFFER_TYPE_STATIC = 0, // GPU can read from it only, CPU can only write once
  20. RENDER_BUFFER_TYPE_SEMISTATIC , // GPU can read, writes are infrequent from CPU
  21. RENDER_BUFFER_TYPE_STAGING, // GPU can write, CPU can read
  22. RENDER_BUFFER_TYPE_GPU_ONLY, // GPU can read/write, CPU cannot read/write (used for GPU-generated data)
  23. RENDER_BUFFER_TYPE_COUNT,
  24. RENDER_BUFFER_TYPE_COUNT_PLUS_1, // Ignore the man behind the curtain (used to silence a warning in rendersystem)
  25. };
  26. schema enum RenderBufferClass_t
  27. {
  28. RENDER_BUFFER_CLASS_VERTEX_BUFFER = 0,// (explicit)
  29. RENDER_BUFFER_CLASS_INDEX_BUFFER,
  30. RENDER_BUFFER_CLASS_RESERVED_VALUE_1, // These are for internal use only
  31. RENDER_BUFFER_CLASS_RESERVED_VALUE_2,
  32. };
  33. schema enum RenderSlotType_t
  34. {
  35. RENDER_SLOT_INVALID = -1,
  36. RENDER_SLOT_PER_VERTEX = 0,
  37. RENDER_SLOT_PER_INSTANCE = 1,
  38. };
  39. schema enum MaxInputLayoutSemanticNameSize_t
  40. {
  41. RENDER_INPUT_LAYOUT_FIELD_SEMANTIC_NAME_SIZE2 = 32,
  42. };
  43. //-----------------------------------------------------------------------------
  44. // Structure definitions
  45. //-----------------------------------------------------------------------------
  46. schema struct RenderInputLayoutField2_t
  47. {
  48. uint8 m_SemanticName[32];
  49. int32 m_nSemanticIndex; // TODO: Change to ColorFormat_t and make bitmap/colorformat.h depend on ColorFormat.sch
  50. int32 m_nFormat;
  51. int32 m_nOffset;
  52. int32 m_nSlot;
  53. uint8 m_nSlotType; // See RenderSlotType_t
  54. uint8 m_Padding[3];
  55. int32 m_nInstanceStepRate;
  56. };
  57. schema struct RenderBufferDesc_t
  58. {
  59. int32 m_nElementCount;
  60. uint16 m_nElementSizeInBytes; // Assume no single element is over 65k in size
  61. uint8 m_nBufferType; // See RenderBufferType_t
  62. uint8 m_nBufferClass; // See RenderBufferClass_t
  63. CResourceArray< RenderInputLayoutField2_t > m_InputLayoutFields; // Unused for index buffers
  64. };
  65. //! uncacheableStruct = RenderBufferDesc_t
  66. schema struct RenderBufferBits_t
  67. {
  68. // Empty like texture bits... Just a bag of bits with no reflection data...
  69. };
  70. class CRenderBufferBits; // Forward declaration of associated runtime class
  71. DEFINE_RESOURCE_CLASS_TYPE( RenderBufferBits_t, CRenderBufferBits, RESOURCE_TYPE_RENDER_BUFFER );
  72. typedef const ResourceBinding_t< CRenderBufferBits > *HRenderBuffer;
  73. typedef CStrongHandle< CRenderBufferBits > HRenderBufferStrong;
  74. #define RENDER_BUFFER_HANDLE_INVALID ( (HRenderBuffer)0 )
  75. #endif // RENDERBUFFER_G_H