2017-12-11 01:43:15 +01:00
|
|
|
#pragma once
|
|
|
|
|
2017-12-15 19:11:10 +01:00
|
|
|
#include "../dxvk/dxvk_device.h"
|
|
|
|
|
|
|
|
#include "../dxbc/dxbc_util.h"
|
2017-12-11 01:43:15 +01:00
|
|
|
|
|
|
|
#include "d3d11_include.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
2018-05-30 13:33:48 +02:00
|
|
|
template<typename T>
|
|
|
|
UINT CompactSparseList(T* pData, UINT Mask) {
|
|
|
|
uint32_t count = 0;
|
|
|
|
|
2021-08-13 18:48:40 +02:00
|
|
|
for (uint32_t id : bit::BitMask(Mask))
|
2018-05-30 13:33:48 +02:00
|
|
|
pData[count++] = pData[id];
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2018-04-13 13:46:45 +02:00
|
|
|
HRESULT DecodeSampleCount(
|
2017-12-19 16:01:50 +01:00
|
|
|
UINT Count,
|
|
|
|
VkSampleCountFlagBits* pCount);
|
2018-03-05 02:21:34 +01:00
|
|
|
|
|
|
|
VkSamplerAddressMode DecodeAddressMode(
|
|
|
|
D3D11_TEXTURE_ADDRESS_MODE mode);
|
2017-12-19 16:01:50 +01:00
|
|
|
|
2017-12-11 01:43:15 +01:00
|
|
|
VkCompareOp DecodeCompareOp(
|
2017-12-21 16:54:20 +01:00
|
|
|
D3D11_COMPARISON_FUNC Mode);
|
2017-12-11 01:43:15 +01:00
|
|
|
|
2021-03-13 20:01:27 +01:00
|
|
|
VkConservativeRasterizationModeEXT DecodeConservativeRasterizationMode(
|
|
|
|
D3D11_CONSERVATIVE_RASTERIZATION_MODE Mode);
|
|
|
|
|
2018-08-09 23:33:36 +02:00
|
|
|
VkFormatFeatureFlags GetBufferFormatFeatures(
|
|
|
|
UINT BindFlags);
|
|
|
|
|
|
|
|
VkFormatFeatureFlags GetImageFormatFeatures(
|
|
|
|
UINT BindFlags);
|
2018-11-08 18:49:52 +01:00
|
|
|
|
|
|
|
VkFormat GetPackedDepthStencilFormat(
|
|
|
|
DXGI_FORMAT Format);
|
2018-08-09 21:49:31 +02:00
|
|
|
|
2022-08-07 14:59:05 +02:00
|
|
|
/**
|
|
|
|
* \brief Translates D3D11 shader stage to corresponding Vulkan stage
|
|
|
|
*
|
|
|
|
* \param [in] ProgramType DXBC program type
|
|
|
|
* \returns Corresponding Vulkan shader stage
|
|
|
|
*/
|
|
|
|
constexpr VkShaderStageFlagBits GetShaderStage(DxbcProgramType ProgramType) {
|
|
|
|
switch (ProgramType) {
|
|
|
|
case DxbcProgramType::VertexShader: return VK_SHADER_STAGE_VERTEX_BIT;
|
|
|
|
case DxbcProgramType::HullShader: return VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
|
|
|
|
case DxbcProgramType::DomainShader: return VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT;
|
|
|
|
case DxbcProgramType::GeometryShader: return VK_SHADER_STAGE_GEOMETRY_BIT;
|
|
|
|
case DxbcProgramType::PixelShader: return VK_SHADER_STAGE_FRAGMENT_BIT;
|
|
|
|
case DxbcProgramType::ComputeShader: return VK_SHADER_STAGE_COMPUTE_BIT;
|
|
|
|
default: return VkShaderStageFlagBits(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-11 01:43:15 +01:00
|
|
|
}
|