Skip to content

Commit

Permalink
Merge pull request #67 from vertver/backend-fixes
Browse files Browse the repository at this point in the history
Backend fixes (D3D12 and Vulkan)
  • Loading branch information
dzhdanNV authored May 19, 2024
2 parents 2e437e4 + 9d6e885 commit f11d4c5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
5 changes: 5 additions & 0 deletions Source/Shared/D3DExt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ Ext::~Ext() {
}

void Ext::InitializeNVExt(const nri::DeviceBase* deviceBase, bool isNVAPILoadedInApp, bool isImported) {
if (GetModuleHandleA("renderdoc.dll") != nullptr) {
REPORT_WARNING(deviceBase, "NVAPI is disabled, because RenderDoc library has been loaded.");
return;
}

m_DeviceBase = deviceBase;
m_IsImported = isImported;

Expand Down
33 changes: 17 additions & 16 deletions Source/VK/ConversionVK.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,50 +102,51 @@ constexpr VkPipelineStageFlags2 GetPipelineStageFlags(StageBits stageBits) {
}

constexpr VkShaderStageFlags GetShaderStageFlags(StageBits stage) {
VkShaderStageFlags stageFlags = 0;

if (stage & StageBits::VERTEX_SHADER)
return VK_SHADER_STAGE_VERTEX_BIT;
stageFlags |= VK_SHADER_STAGE_VERTEX_BIT;

if (stage & StageBits::TESS_CONTROL_SHADER)
return VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
stageFlags |= VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;

if (stage & StageBits::TESS_EVALUATION_SHADER)
return VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT;
stageFlags |= VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT;

if (stage & StageBits::GEOMETRY_SHADER)
return VK_SHADER_STAGE_GEOMETRY_BIT;
stageFlags |= VK_SHADER_STAGE_GEOMETRY_BIT;

if (stage & StageBits::FRAGMENT_SHADER)
return VK_SHADER_STAGE_FRAGMENT_BIT;
stageFlags |= VK_SHADER_STAGE_FRAGMENT_BIT;

if (stage & StageBits::COMPUTE_SHADER)
return VK_SHADER_STAGE_COMPUTE_BIT;
stageFlags |= VK_SHADER_STAGE_COMPUTE_BIT;

if (stage & StageBits::RAYGEN_SHADER)
return VK_SHADER_STAGE_RAYGEN_BIT_KHR;
stageFlags |= VK_SHADER_STAGE_RAYGEN_BIT_KHR;

if (stage & StageBits::MISS_SHADER)
return VK_SHADER_STAGE_MISS_BIT_KHR;
stageFlags |= VK_SHADER_STAGE_MISS_BIT_KHR;

if (stage & StageBits::INTERSECTION_SHADER)
return VK_SHADER_STAGE_INTERSECTION_BIT_KHR;
stageFlags |= VK_SHADER_STAGE_INTERSECTION_BIT_KHR;

if (stage & StageBits::CLOSEST_HIT_SHADER)
return VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR;
stageFlags |= VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR;

if (stage & StageBits::ANY_HIT_SHADER)
return VK_SHADER_STAGE_ANY_HIT_BIT_KHR;
stageFlags |= VK_SHADER_STAGE_ANY_HIT_BIT_KHR;

if (stage & StageBits::CALLABLE_SHADER)
return VK_SHADER_STAGE_CALLABLE_BIT_KHR;
stageFlags |= VK_SHADER_STAGE_CALLABLE_BIT_KHR;

if (stage & StageBits::MESH_CONTROL_SHADER)
return VK_SHADER_STAGE_TASK_BIT_EXT;
stageFlags |= VK_SHADER_STAGE_TASK_BIT_EXT;

if (stage & StageBits::MESH_EVALUATION_SHADER)
return VK_SHADER_STAGE_MESH_BIT_EXT;
stageFlags |= VK_SHADER_STAGE_MESH_BIT_EXT;

// Should be unreachable
return VK_SHADER_STAGE_ALL;
return stageFlags;
}

inline VkFormat GetVkFormat(Format format, bool demoteSrgb = false) {
Expand Down

0 comments on commit f11d4c5

Please sign in to comment.