nvidia/cuda/gs-texture: Add accessors for internals

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2021-04-26 00:16:28 +02:00 committed by Xaymar
parent e678570bba
commit ebdda0162f
2 changed files with 14 additions and 1 deletions

View file

@ -131,3 +131,13 @@ void nvidia::cuda::gstexture::unmap()
_pointer = nullptr; _pointer = nullptr;
_stream.reset(); _stream.reset();
} }
std::shared_ptr<gs::texture> nvidia::cuda::gstexture::get_texture()
{
return _texture;
}
::nvidia::cuda::graphics_resource_t nvidia::cuda::gstexture::get()
{
return _resource;
}

View file

@ -35,10 +35,13 @@ namespace nvidia::cuda {
std::shared_ptr<nvidia::cuda::stream> _stream; std::shared_ptr<nvidia::cuda::stream> _stream;
public: public:
gstexture(std::shared_ptr<gs::texture> texture);
~gstexture(); ~gstexture();
gstexture(std::shared_ptr<gs::texture> texture);
array_t map(std::shared_ptr<nvidia::cuda::stream> stream); array_t map(std::shared_ptr<nvidia::cuda::stream> stream);
void unmap(); void unmap();
std::shared_ptr<gs::texture> get_texture();
::nvidia::cuda::graphics_resource_t get();
}; };
} // namespace nvidia::cuda } // namespace nvidia::cuda