2019-12-16 04:28:01 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "d3d9_include.h"
|
|
|
|
#include "d3d9_format.h"
|
|
|
|
#include "../dxvk/dxvk_device.h"
|
|
|
|
#include "../dxvk/dxvk_context.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
class D3D9FormatHelper {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
D3D9FormatHelper(const Rc<DxvkDevice>& device);
|
|
|
|
|
2020-02-29 15:00:15 +01:00
|
|
|
void Flush();
|
|
|
|
|
2020-02-10 19:26:54 +01:00
|
|
|
void ConvertFormat(
|
|
|
|
D3D9_CONVERSION_FORMAT_INFO conversionFormat,
|
|
|
|
const Rc<DxvkImage>& dstImage,
|
|
|
|
VkImageSubresourceLayers dstSubresource,
|
2021-06-12 12:14:18 +02:00
|
|
|
const DxvkBufferSlice& srcSlice);
|
2019-12-16 04:28:01 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2020-02-24 07:39:25 +01:00
|
|
|
void ConvertGenericFormat(
|
|
|
|
D3D9_CONVERSION_FORMAT_INFO videoFormat,
|
|
|
|
const Rc<DxvkImage>& dstImage,
|
|
|
|
VkImageSubresourceLayers dstSubresource,
|
2021-06-12 12:14:18 +02:00
|
|
|
const DxvkBufferSlice& srcSlice,
|
2020-03-02 04:58:28 +01:00
|
|
|
VkFormat bufferFormat,
|
2020-08-07 10:52:25 +02:00
|
|
|
uint32_t specConstantValue,
|
|
|
|
VkExtent2D macroPixelRun);
|
2020-02-10 19:26:54 +01:00
|
|
|
|
2019-12-16 04:28:01 +01:00
|
|
|
enum BindingIds : uint32_t {
|
|
|
|
Image = 0,
|
|
|
|
Buffer = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
void InitShaders();
|
|
|
|
|
|
|
|
Rc<DxvkShader> InitShader(SpirvCodeBuffer code);
|
|
|
|
|
2020-02-29 15:00:15 +01:00
|
|
|
void FlushInternal();
|
|
|
|
|
2019-12-16 04:28:01 +01:00
|
|
|
Rc<DxvkDevice> m_device;
|
|
|
|
Rc<DxvkContext> m_context;
|
|
|
|
|
2020-02-29 15:00:15 +01:00
|
|
|
size_t m_transferCommands = 0;
|
|
|
|
|
2020-02-10 19:26:54 +01:00
|
|
|
std::array<Rc<DxvkShader>, D3D9ConversionFormat_Count> m_shaders;
|
2019-12-16 04:28:01 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|