1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-08 10:46:09 +01:00
dxvk/src/d3d9/d3d9_format_helpers.h

59 lines
1.4 KiB
C
Raw Normal View History

#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);
void Flush();
void ConvertFormat(
D3D9_CONVERSION_FORMAT_INFO conversionFormat,
const Rc<DxvkImage>& dstImage,
VkImageSubresourceLayers dstSubresource,
const Rc<DxvkBuffer>& srcBuffer);
private:
void ConvertGenericFormat(
D3D9_CONVERSION_FORMAT_INFO videoFormat,
const Rc<DxvkImage>& dstImage,
VkImageSubresourceLayers dstSubresource,
const Rc<DxvkBuffer>& srcBuffer,
VkFormat bufferFormat);
void ConvertVideoFormat(
D3D9_CONVERSION_FORMAT_INFO videoFormat,
const Rc<DxvkImage>& dstImage,
VkImageSubresourceLayers dstSubresource,
const Rc<DxvkBuffer>& srcBuffer);
enum BindingIds : uint32_t {
Image = 0,
Buffer = 1,
};
void InitShaders();
Rc<DxvkShader> InitShader(SpirvCodeBuffer code);
void FlushInternal();
Rc<DxvkDevice> m_device;
Rc<DxvkContext> m_context;
size_t m_transferCommands = 0;
std::array<Rc<DxvkShader>, D3D9ConversionFormat_Count> m_shaders;
};
}