2023-02-28 01:15:26 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
2020-03-20 22:10:19 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "nvidia-cuda-stream.hpp"
|
|
|
|
#include "nvidia-cuda.hpp"
|
|
|
|
#include "obs/gs/gs-texture.hpp"
|
|
|
|
|
2022-08-29 10:29:44 +00:00
|
|
|
#include "warning-disable.hpp"
|
|
|
|
#include <cstddef>
|
|
|
|
#include <memory>
|
|
|
|
#include "warning-enable.hpp"
|
|
|
|
|
2021-06-16 10:16:35 +00:00
|
|
|
namespace streamfx::nvidia::cuda {
|
2020-03-20 22:10:19 +00:00
|
|
|
class gstexture {
|
2021-06-16 10:16:35 +00:00
|
|
|
std::shared_ptr<::streamfx::nvidia::cuda::cuda> _cuda;
|
|
|
|
std::shared_ptr<streamfx::obs::gs::texture> _texture;
|
|
|
|
graphics_resource_t _resource;
|
2020-03-20 22:10:19 +00:00
|
|
|
|
2021-06-16 10:16:35 +00:00
|
|
|
bool _is_mapped;
|
|
|
|
array_t _pointer;
|
|
|
|
std::shared_ptr<streamfx::nvidia::cuda::stream> _stream;
|
2020-03-20 22:10:19 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
~gstexture();
|
2021-06-08 02:38:24 +00:00
|
|
|
gstexture(std::shared_ptr<streamfx::obs::gs::texture> texture);
|
2020-03-20 22:10:19 +00:00
|
|
|
|
2021-06-16 10:16:35 +00:00
|
|
|
array_t map(std::shared_ptr<streamfx::nvidia::cuda::stream> stream);
|
2020-07-12 16:41:50 +00:00
|
|
|
void unmap();
|
2021-04-25 22:16:28 +00:00
|
|
|
|
2021-06-16 10:16:35 +00:00
|
|
|
std::shared_ptr<streamfx::obs::gs::texture> get_texture();
|
|
|
|
::streamfx::nvidia::cuda::graphics_resource_t get();
|
2020-03-20 22:10:19 +00:00
|
|
|
};
|
2021-06-16 10:16:35 +00:00
|
|
|
} // namespace streamfx::nvidia::cuda
|