Switch to an enum library that doesn't murder IntelliSense.

This commit is contained in:
Skyth 2024-11-27 12:40:37 +03:00
parent 96d6e0ceda
commit 195afa9a5f
4 changed files with 18 additions and 20 deletions

View file

@ -122,7 +122,7 @@ find_package(zstd CONFIG REQUIRED)
find_package(Stb REQUIRED) find_package(Stb REQUIRED)
find_package(unofficial-concurrentqueue REQUIRED) find_package(unofficial-concurrentqueue REQUIRED)
find_package(imgui CONFIG REQUIRED) find_package(imgui CONFIG REQUIRED)
find_path(CONJURE_ENUM_INCLUDE_DIRS "conjure_enum.hpp") find_package(magic_enum CONFIG REQUIRED)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12)
add_custom_command(TARGET UnleashedRecomp POST_BUILD add_custom_command(TARGET UnleashedRecomp POST_BUILD
@ -158,6 +158,7 @@ target_link_libraries(UnleashedRecomp PRIVATE
unofficial::concurrentqueue::concurrentqueue unofficial::concurrentqueue::concurrentqueue
Synchronization Synchronization
imgui::imgui imgui::imgui
magic_enum::magic_enum
) )
target_include_directories(UnleashedRecomp PRIVATE target_include_directories(UnleashedRecomp PRIVATE
@ -165,7 +166,6 @@ target_include_directories(UnleashedRecomp PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/api ${CMAKE_CURRENT_SOURCE_DIR}/api
${SWA_THIRDPARTY_ROOT}/ddspp ${SWA_THIRDPARTY_ROOT}/ddspp
${Stb_INCLUDE_DIR} ${Stb_INCLUDE_DIR}
${CONJURE_ENUM_INCLUDE_DIRS}
) )
target_precompile_headers(UnleashedRecomp PUBLIC ${SWA_PRECOMPILED_HEADERS}) target_precompile_headers(UnleashedRecomp PUBLIC ${SWA_PRECOMPILED_HEADERS})

View file

@ -36,6 +36,10 @@
#include "shader/resolve_msaa_depth_8x.hlsl.dxil.h" #include "shader/resolve_msaa_depth_8x.hlsl.dxil.h"
#include "shader/resolve_msaa_depth_8x.hlsl.spirv.h" #include "shader/resolve_msaa_depth_8x.hlsl.spirv.h"
#ifdef ASYNC_PSO_DEBUG
#include <magic_enum.hpp>
#endif
extern "C" extern "C"
{ {
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
@ -2743,11 +2747,6 @@ static RenderPipeline* CreateGraphicsPipelineInRenderThread(PipelineState pipeli
pipeline->setName(std::format("{} {} {:X}", pipeline->setName(std::format("{} {} {:X}",
pipelineState.vertexShader->name, pipelineState.pixelShader != nullptr ? pipelineState.pixelShader->name : "<none>", hash)); pipelineState.vertexShader->name, pipelineState.pixelShader != nullptr ? pipelineState.pixelShader->name : "<none>", hash));
auto enumToString = []<typename T>(T value)
{
return FIX8::conjure_enum<T>::enum_to_string(value);
};
std::lock_guard lock(g_debugMutex); std::lock_guard lock(g_debugMutex);
g_pipelineDebugText = std::format( g_pipelineDebugText = std::format(
"PipelineState {:X}:\n" "PipelineState {:X}:\n"
@ -2784,25 +2783,25 @@ static RenderPipeline* CreateGraphicsPipelineInRenderThread(PipelineState pipeli
pipelineState.instancing, pipelineState.instancing,
pipelineState.zEnable, pipelineState.zEnable,
pipelineState.zWriteEnable, pipelineState.zWriteEnable,
enumToString(pipelineState.srcBlend), magic_enum::enum_name(pipelineState.srcBlend),
enumToString(pipelineState.destBlend), magic_enum::enum_name(pipelineState.destBlend),
enumToString(pipelineState.cullMode), magic_enum::enum_name(pipelineState.cullMode),
enumToString(pipelineState.zFunc), magic_enum::enum_name(pipelineState.zFunc),
pipelineState.alphaBlendEnable, pipelineState.alphaBlendEnable,
enumToString(pipelineState.blendOp), magic_enum::enum_name(pipelineState.blendOp),
pipelineState.slopeScaledDepthBias, pipelineState.slopeScaledDepthBias,
pipelineState.depthBias, pipelineState.depthBias,
enumToString(pipelineState.srcBlendAlpha), magic_enum::enum_name(pipelineState.srcBlendAlpha),
enumToString(pipelineState.destBlendAlpha), magic_enum::enum_name(pipelineState.destBlendAlpha),
enumToString(pipelineState.blendOpAlpha), magic_enum::enum_name(pipelineState.blendOpAlpha),
pipelineState.colorWriteEnable, pipelineState.colorWriteEnable,
enumToString(pipelineState.primitiveTopology), magic_enum::enum_name(pipelineState.primitiveTopology),
pipelineState.vertexStrides[0], pipelineState.vertexStrides[0],
pipelineState.vertexStrides[1], pipelineState.vertexStrides[1],
pipelineState.vertexStrides[2], pipelineState.vertexStrides[2],
pipelineState.vertexStrides[3], pipelineState.vertexStrides[3],
enumToString(pipelineState.renderTargetFormat), magic_enum::enum_name(pipelineState.renderTargetFormat),
enumToString(pipelineState.depthStencilFormat), magic_enum::enum_name(pipelineState.depthStencilFormat),
pipelineState.sampleCount, pipelineState.sampleCount,
pipelineState.enableAlphaToCoverage, pipelineState.enableAlphaToCoverage,
pipelineState.specConstants) pipelineState.specConstants)

View file

@ -30,7 +30,6 @@
#include <o1heap.h> #include <o1heap.h>
#include <cstddef> #include <cstddef>
#include <wrl/client.h> #include <wrl/client.h>
#include <conjure_enum.hpp>
using Microsoft::WRL::ComPtr; using Microsoft::WRL::ComPtr;

View file

@ -20,6 +20,6 @@
"name": "imgui", "name": "imgui",
"features": [ "sdl2-binding" ] "features": [ "sdl2-binding" ]
}, },
"conjure-enum" "magic-enum"
] ]
} }