ShaderWrapper.h 639 B

1234567891011121314151617181920212223242526272829
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2026 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. #ifdef JPH_USE_CPU_COMPUTE
  6. JPH_NAMESPACE_BEGIN
  7. namespace HLSLToCPP { struct uint3; }
  8. /// Wraps a compute shader to allow calling it from C++
  9. class ShaderWrapper
  10. {
  11. public:
  12. /// Destructor
  13. virtual ~ShaderWrapper() = default;
  14. /// Bind buffer to shader
  15. virtual void Bind(const char *inName, void *inData, uint64 inSize) = 0;
  16. /// Execute a single shader thread
  17. virtual void Main(const HLSLToCPP::uint3 &inThreadID) = 0;
  18. };
  19. JPH_NAMESPACE_END
  20. #endif // JPH_USE_CPU_COMPUTE