direct3d12_gpu.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. struct ID3D12Resource;
  5. struct ID3D12DescriptorHeap;
  6. struct ID3D12PipelineState;
  7. struct ID3D12StateObject;
  8. enum D3D12_RESOURCE_STATES;
  9. typedef void *HANDLE;
  10. typedef unsigned __int64 UINT64;
  11. struct D3D12Viewport {
  12. float TopLeftX;
  13. float TopLeftY;
  14. float Width;
  15. float Height;
  16. float MinDepth;
  17. float MaxDepth;
  18. };
  19. struct D3D12Rect {
  20. long left;
  21. long top;
  22. long right;
  23. long bottom;
  24. };
  25. struct D3D12VertexBufferView {
  26. __int64 BufferLocation;
  27. unsigned int SizeInBytes;
  28. unsigned int StrideInBytes;
  29. };
  30. struct D3D12IndexBufferView {
  31. __int64 BufferLocation;
  32. unsigned int SizeInBytes;
  33. int Format;
  34. };
  35. typedef struct {
  36. struct ID3D12PipelineState *pso;
  37. } gpu_pipeline_impl_t;
  38. typedef struct {
  39. uint8_t *data;
  40. int length;
  41. } gpu_shader_impl_t;
  42. typedef struct {
  43. struct ID3D12Resource *image;
  44. struct ID3D12DescriptorHeap *srv_descriptor_heap;
  45. struct ID3D12DescriptorHeap *rtv_descriptor_heap;
  46. } gpu_texture_impl_t;
  47. typedef struct {
  48. struct ID3D12Resource *buffer;
  49. struct D3D12VertexBufferView vertex_buffer_view;
  50. struct D3D12IndexBufferView index_buffer_view;
  51. int last_start;
  52. int last_count;
  53. } gpu_buffer_impl_t;
  54. typedef struct {
  55. struct ID3D12StateObject *dxr_state;
  56. struct ID3D12Resource *raygen_shader_table;
  57. struct ID3D12Resource *miss_shader_table;
  58. struct ID3D12Resource *hitgroup_shader_table;
  59. } gpu_raytrace_pipeline_impl_t;
  60. typedef struct {
  61. struct ID3D12Resource *bottom_level_accel[16];
  62. struct ID3D12Resource *top_level_accel;
  63. } gpu_raytrace_acceleration_structure_impl_t;