diff --git a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp index c50132980..4d8bccd55 100644 --- a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp +++ b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp @@ -565,9 +565,9 @@ D3D12Descriptor D3D12ShaderDebug::FindDescriptor(WrappedID3D12Device *device, ShaderVariable D3D12ShaderDebug::GetResourceInfo(WrappedID3D12Device *device, D3D12_DESCRIPTOR_RANGE_TYPE descType, - const DXBCDXILDebug::BindingSlot &slot, - uint32_t mipLevel, const DXBC::ShaderType shaderType, - int &dim, bool isDXIL) + const DXDebug::BindingSlot &slot, uint32_t mipLevel, + const DXBC::ShaderType shaderType, int &dim, + bool isDXIL) { ShaderVariable result("", 0U, 0U, 0U, 0U); @@ -845,7 +845,7 @@ ShaderVariable D3D12ShaderDebug::GetResourceInfo(WrappedID3D12Device *device, ShaderVariable D3D12ShaderDebug::GetSampleInfo(WrappedID3D12Device *device, D3D12_DESCRIPTOR_RANGE_TYPE descType, - const DXBCDXILDebug::BindingSlot &slot, + const DXDebug::BindingSlot &slot, const DXBC::ShaderType shaderType, const char *opString) { @@ -933,13 +933,13 @@ public: uint32_t mipLevel, int &dim); bool CalculateSampleGather(DXBCBytecode::OpcodeType opcode, - DXBCDXILDebug::SampleGatherResourceData resourceData, - DXBCDXILDebug::SampleGatherSamplerData samplerData, - const ShaderVariable &uv, const ShaderVariable &ddxCalc, - const ShaderVariable &ddyCalc, const int8_t texelOffsets[3], - int multisampleIndex, float lodOrCompareValue, - const uint8_t swizzle[4], DXBCDXILDebug::GatherChannel gatherChannel, - const char *opString, ShaderVariable &output); + DXDebug::SampleGatherResourceData resourceData, + DXDebug::SampleGatherSamplerData samplerData, const ShaderVariable &uv, + const ShaderVariable &ddxCalc, const ShaderVariable &ddyCalc, + const int8_t texelOffsets[3], int multisampleIndex, + float lodOrCompareValue, const uint8_t swizzle[4], + DXDebug::GatherChannel gatherChannel, const char *opString, + ShaderVariable &output); private: DXBC::ShaderType GetShaderType() { return m_dxbc ? m_dxbc->m_Type : DXBC::ShaderType::Pixel; } @@ -1424,11 +1424,11 @@ ShaderVariable D3D12DebugAPIWrapper::GetResourceInfo(DXBCBytecode::OperandType t } bool D3D12DebugAPIWrapper::CalculateSampleGather( - DXBCBytecode::OpcodeType opcode, DXBCDXILDebug::SampleGatherResourceData resourceData, - DXBCDXILDebug::SampleGatherSamplerData samplerData, const ShaderVariable &uv, + DXBCBytecode::OpcodeType opcode, DXDebug::SampleGatherResourceData resourceData, + DXDebug::SampleGatherSamplerData samplerData, const ShaderVariable &uv, const ShaderVariable &ddxCalc, const ShaderVariable &ddyCalc, const int8_t texelOffsets[3], int multisampleIndex, float lodOrCompareValue, const uint8_t swizzle[4], - DXBCDXILDebug::GatherChannel gatherChannel, const char *opString, ShaderVariable &output) + DXDebug::GatherChannel gatherChannel, const char *opString, ShaderVariable &output) { using namespace DXBCBytecode; diff --git a/renderdoc/driver/d3d12/d3d12_shaderdebug.h b/renderdoc/driver/d3d12/d3d12_shaderdebug.h index 15def9f5e..4291acefc 100644 --- a/renderdoc/driver/d3d12/d3d12_shaderdebug.h +++ b/renderdoc/driver/d3d12/d3d12_shaderdebug.h @@ -24,18 +24,18 @@ #pragma once +#include "driver/shaders/dxbc/dx_debug.h" #include "driver/shaders/dxbc/dxbc_common.h" -#include "driver/shaders/dxbc/dxbcdxil_debug.h" #include "d3d12_manager.h" namespace D3D12ShaderDebug { -using namespace DXBCDXILDebug; +using namespace DXDebug; -typedef DXBCDXILDebug::SampleGatherResourceData SampleGatherResourceData; -typedef DXBCDXILDebug::SampleGatherSamplerData SampleGatherSamplerData; -typedef DXBCDXILDebug::BindingSlot BindingSlot; -typedef DXBCDXILDebug::GatherChannel GatherChannel; +typedef DXDebug::SampleGatherResourceData SampleGatherResourceData; +typedef DXDebug::SampleGatherSamplerData SampleGatherSamplerData; +typedef DXDebug::BindingSlot BindingSlot; +typedef DXDebug::GatherChannel GatherChannel; typedef DXBCBytecode::SamplerMode SamplerMode; // Helpers used by DXBC and DXIL debuggers to interact with GPU and resources @@ -52,16 +52,15 @@ bool CalculateSampleGather(bool dxil, WrappedID3D12Device *device, int sampleOp, uint32_t instruction, const char *opString, ShaderVariable &output); D3D12Descriptor FindDescriptor(WrappedID3D12Device *device, D3D12_DESCRIPTOR_RANGE_TYPE descType, - const DXBCDXILDebug::BindingSlot &slot, - const DXBC::ShaderType shaderType); + const DXDebug::BindingSlot &slot, const DXBC::ShaderType shaderType); ShaderVariable GetResourceInfo(WrappedID3D12Device *device, D3D12_DESCRIPTOR_RANGE_TYPE descType, - const DXBCDXILDebug::BindingSlot &slot, uint32_t mipLevel, + const DXDebug::BindingSlot &slot, uint32_t mipLevel, const DXBC::ShaderType shaderType, int &dim, bool isDXIL); ShaderVariable GetSampleInfo(WrappedID3D12Device *device, D3D12_DESCRIPTOR_RANGE_TYPE descType, - const DXBCDXILDebug::BindingSlot &slot, - const DXBC::ShaderType shaderType, const char *opString); + const DXDebug::BindingSlot &slot, const DXBC::ShaderType shaderType, + const char *opString); ShaderVariable GetRenderTargetSampleInfo(WrappedID3D12Device *device, const DXBC::ShaderType shaderType, const char *opString); diff --git a/renderdoc/driver/shaders/dxbc/dxbcdxil_debug.cpp b/renderdoc/driver/shaders/dxbc/dx_debug.cpp similarity index 97% rename from renderdoc/driver/shaders/dxbc/dxbcdxil_debug.cpp rename to renderdoc/driver/shaders/dxbc/dx_debug.cpp index ba2c99dc2..2a7c34c58 100644 --- a/renderdoc/driver/shaders/dxbc/dxbcdxil_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dx_debug.cpp @@ -22,9 +22,9 @@ * THE SOFTWARE. ******************************************************************************/ -#include "dxbcdxil_debug.h" +#include "dx_debug.h" -namespace DXBCDXILDebug +namespace DXDebug { // "NaN has special handling. If one source operand is NaN, then the other source operand is // returned. If both are NaN, any NaN representation is returned." @@ -187,16 +187,16 @@ void get_sample_position(uint32_t sampleIndex, uint32_t sampleCount, float *posi #undef _SMP } -}; // namespace DXBCDXILDebug +}; // namespace DXDebug #if ENABLED(ENABLE_UNIT_TESTS) #include #include "catch/catch.hpp" -using namespace DXBCDXILDebug; +using namespace DXDebug; -TEST_CASE("DXBCDXIL debugging helpers", "[program]") +TEST_CASE("DXBC DXIL shader debugging helpers", "[program]") { const float posinf = std::numeric_limits::infinity(); const float neginf = -std::numeric_limits::infinity(); diff --git a/renderdoc/driver/shaders/dxbc/dxbcdxil_debug.h b/renderdoc/driver/shaders/dxbc/dx_debug.h similarity index 99% rename from renderdoc/driver/shaders/dxbc/dxbcdxil_debug.h rename to renderdoc/driver/shaders/dxbc/dx_debug.h index d9e8a0124..9bdd72d11 100644 --- a/renderdoc/driver/shaders/dxbc/dxbcdxil_debug.h +++ b/renderdoc/driver/shaders/dxbc/dx_debug.h @@ -35,7 +35,7 @@ enum ResourceDimension; enum SamplerMode; }; -namespace DXBCDXILDebug +namespace DXDebug { typedef DXBC::ResourceRetType ResourceRetType; typedef DXBCBytecode::ResourceDimension ResourceDimension; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_common.h b/renderdoc/driver/shaders/dxbc/dxbc_common.h index 468869f7d..ef5a0c1e0 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_common.h +++ b/renderdoc/driver/shaders/dxbc/dxbc_common.h @@ -29,7 +29,7 @@ #include "api/replay/rdcpair.h" #include "api/replay/rdcstr.h" #include "api/replay/shader_types.h" -#include "dxbcdxil_debug.h" +#include "dx_debug.h" struct DXBCContainerDebugger : public ShaderDebugger { diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp index 649b8b41f..b959ae465 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp @@ -33,7 +33,7 @@ #include "dxbc_container.h" using namespace DXBCBytecode; -using namespace DXBCDXILDebug; +using namespace DXDebug; namespace DXBCDebug { @@ -3529,7 +3529,7 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, "Shader debugging %d: %s\nNon-multisampled texture being passed to sample_pos", nextInstruction - 1, op.str.c_str())); } - DXBCDXILDebug::get_sample_position(sampleIndex, sampleCount, result.value.f32v.data()); + DXDebug::get_sample_position(sampleIndex, sampleCount, result.value.f32v.data()); } // apply swizzle diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.h b/renderdoc/driver/shaders/dxbc/dxbc_debug.h index 3734607a4..6cd31a411 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.h +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.h @@ -26,8 +26,8 @@ #pragma once #include "common/common.h" +#include "dx_debug.h" #include "dxbc_bytecode.h" -#include "dxbcdxil_debug.h" namespace DXBC { @@ -48,12 +48,12 @@ enum DXGI_FORMAT; namespace DXBCDebug { -using namespace DXBCDXILDebug; +using namespace DXDebug; -typedef DXBCDXILDebug::SampleGatherResourceData SampleGatherResourceData; -typedef DXBCDXILDebug::SampleGatherSamplerData SampleGatherSamplerData; -typedef DXBCDXILDebug::BindingSlot BindingSlot; -typedef DXBCDXILDebug::GatherChannel GatherChannel; +typedef DXDebug::SampleGatherResourceData SampleGatherResourceData; +typedef DXDebug::SampleGatherSamplerData SampleGatherSamplerData; +typedef DXDebug::BindingSlot BindingSlot; +typedef DXDebug::GatherChannel GatherChannel; BindingSlot GetBindingSlotForDeclaration(const DXBCBytecode::Program &program, const DXBCBytecode::Declaration &decl); diff --git a/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj b/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj index b1a7ba9a5..68605e2e0 100644 --- a/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj +++ b/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj @@ -101,7 +101,7 @@ - + @@ -118,7 +118,7 @@ - + diff --git a/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj.filters b/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj.filters index b68866c9d..8b9fff8e6 100644 --- a/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj.filters +++ b/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj.filters @@ -15,7 +15,7 @@ - + @@ -37,7 +37,7 @@ - +