Kyty/source/emulator/include/Emulator/Graphics/Objects/RenderTexture.h

56 lines
1.7 KiB
C
Raw Normal View History

2022-02-14 01:58:44 +00:00
#ifndef EMULATOR_INCLUDE_EMULATOR_GRAPHICS_OBJECTS_RENDERTEXTURE_H_
#define EMULATOR_INCLUDE_EMULATOR_GRAPHICS_OBJECTS_RENDERTEXTURE_H_
2021-12-01 09:29:27 +00:00
#include "Kyty/Core/Common.h"
#include "Emulator/Common.h"
2022-02-14 01:58:44 +00:00
#include "Emulator/Graphics/Objects/GpuMemory.h"
2021-12-01 09:29:27 +00:00
#ifdef KYTY_EMU_ENABLED
namespace Kyty::Libs::Graphics {
2022-02-14 01:58:44 +00:00
enum class RenderTextureFormat : uint64_t
{
2022-04-08 10:41:59 +00:00
Unknown,
R8G8B8A8Unorm,
B8G8R8A8Unorm
2022-02-14 01:58:44 +00:00
};
class RenderTextureObject: public GpuObject
2021-12-01 09:29:27 +00:00
{
public:
static constexpr int PARAM_FORMAT = 0;
static constexpr int PARAM_WIDTH = 1;
static constexpr int PARAM_HEIGHT = 2;
static constexpr int PARAM_TILED = 3;
static constexpr int PARAM_NEO = 4;
2021-12-29 08:09:27 +00:00
static constexpr int PARAM_PITCH = 5;
2021-12-01 09:29:27 +00:00
2022-02-14 01:58:44 +00:00
explicit RenderTextureObject(RenderTextureFormat pixel_format, uint32_t width, uint32_t height, bool tiled, bool neo, uint32_t pitch)
2021-12-01 09:29:27 +00:00
{
2022-02-14 01:58:44 +00:00
params[PARAM_FORMAT] = static_cast<uint64_t>(pixel_format);
2021-12-01 09:29:27 +00:00
params[PARAM_WIDTH] = width;
params[PARAM_HEIGHT] = height;
params[PARAM_TILED] = tiled ? 1 : 0;
params[PARAM_NEO] = neo ? 1 : 0;
2021-12-29 08:09:27 +00:00
params[PARAM_PITCH] = pitch;
2021-12-01 09:29:27 +00:00
check_hash = true;
2022-02-14 01:58:44 +00:00
type = Graphics::GpuMemoryObjectType::RenderTexture;
2021-12-01 09:29:27 +00:00
}
2022-02-20 10:04:12 +00:00
bool Equal(const uint64_t* other) const override;
2021-12-01 09:29:27 +00:00
2022-02-20 10:04:12 +00:00
[[nodiscard]] create_func_t GetCreateFunc() const override;
2022-03-21 09:23:27 +00:00
[[nodiscard]] create_from_objects_func_t GetCreateFromObjectsFunc() const override;
2022-02-20 10:04:12 +00:00
[[nodiscard]] write_back_func_t GetWriteBackFunc() const override { return nullptr; };
[[nodiscard]] delete_func_t GetDeleteFunc() const override;
[[nodiscard]] update_func_t GetUpdateFunc() const override;
2021-12-01 09:29:27 +00:00
};
} // namespace Kyty::Libs::Graphics
#endif // KYTY_EMU_ENABLED
2022-02-14 01:58:44 +00:00
#endif /* EMULATOR_INCLUDE_EMULATOR_GRAPHICS_OBJECTS_RENDERTEXTURE_H_ */