Skip to content

Commit

Permalink
RGA 1.2 code changes.
Browse files Browse the repository at this point in the history
Change-Id: I20646e0c56105cb432a7d3fa9c87ba594396b1e6
  • Loading branch information
AmitBM committed Aug 17, 2017
1 parent 7ad1309 commit 75841d6
Show file tree
Hide file tree
Showing 50 changed files with 1,424 additions and 787 deletions.
4 changes: 3 additions & 1 deletion Build/JenkinsConfiguration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// "P4ROOT" is passed in to this build script from Jenkins
// "SOLUTION" is passed in to this build script from Jenkins
// "ARCH" is passed in to this build script from Jenkins (must be "x64" or "x86")
// "ARCHIVE_NAME" is passed in to this build script from Jenkins

Define "RGAPATH" "[P4ROOT]\RGA"
Define "BUILDPATH" "[RGAPATH]\BuildOutput"
Expand Down Expand Up @@ -34,10 +35,11 @@ Image
XCopy "[OUTPUT_PATH]\Release_Static\bin\[ARCH]\amdspv.exe" "[ZIPDIRRGA]\bin\[ARCH]\amdspv.exe*"
XCopy "[OUTPUT_PATH]\Release_Static\bin\[ARCH]\spvgen.dll" "[ZIPDIRRGA]\bin\[ARCH]\spvgen.dll*"
XCopy "[OUTPUT_PATH]\Release_Static\bin\[ARCH]\shae.exe" "[ZIPDIRRGA]\bin\[ARCH]\shae.exe*"
XCopy "[OUTPUT_PATH]\Release_Static\bin\[ARCH]\RGADX11.exe" "[ZIPDIRRGA]\bin\[ARCH]\RGADX11.exe*"
XCopy "C:\Program Files (x86)\Windows Kits\10\bin\[ARCH]\d3dcompiler_47.dll" "[ZIPDIRRGA]\bin\[ARCH]\d3dcompiler_47.dll*"
// Copy the VC++ Redistributable package binaries
XCopy "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\[ARCH]\Microsoft.VC140.CRT\concrt140.dll" "[ZIPDIRRGA]\bin\concrt140.dll*"
XCopy "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\[ARCH]\Microsoft.VC140.CRT\msvcp140.dll" "[ZIPDIRRGA]\bin\msvcp140.dll*"
XCopy "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\[ARCH]\Microsoft.VC140.CRT\vccorlib140.dll" "[ZIPDIRRGA]\bin\vccorlib140.dll*"
XCopy "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\[ARCH]\Microsoft.VC140.CRT\vcruntime140.dll" "[ZIPDIRRGA]\bin\vcruntime140.dll*"
Zip "[BUILDPATH]\RGA.[DATE].[BUILD].zip" "[ZIPDIRRGA]\bin"
Zip "[BUILDPATH]\[ARCHIVE_NAME].[BUILD]_[DATE].zip" "[ZIPDIRRGA]\bin"
1 change: 1 addition & 0 deletions Build/VS2015/RadeonGPUAnalyzerCLI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\Common\Src\DeviceInfo\DeviceInfoUtils.cpp" />
<ClCompile Include="..\..\RadeonGPUAnalyzerCLI\src\kcCLICommander.cpp" />
<ClCompile Include="..\..\RadeonGPUAnalyzerCLI\src\kcCLICommanderCL.cpp" />
<ClCompile Include="..\..\RadeonGPUAnalyzerCLI\src\kcCLICommanderDX.cpp" />
<ClCompile Include="..\..\RadeonGPUAnalyzerCLI\src\kcCLICommanderOpenGL.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions Build/VS2015/RadeonGPUAnalyzerCLI.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
<ClCompile Include="..\..\..\Common\Src\DeviceInfo\DeviceInfoUtils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\RadeonGPUAnalyzerCLI\src\kcCLICommander.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\RadeonGPUAnalyzerCLI\src\kcConfig.h">
Expand Down
1 change: 1 addition & 0 deletions Build/VS2015/rga_copy_x64.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if not exist %OUTPUT_DIR% mkdir %OUTPUT_DIR%
rem Copy core files:
XCopy /r /d /y "..\..\Core\OpenGL\VirtualContext\Release\win64\VirtualContext.exe" "%OUTPUT_DIR%\x64\"
XCopy /r /d /y "..\..\Core\ShaderAnalysis\Windows\x86\shae.exe" "%OUTPUT_DIR%\x64\"
XCopy /r /d /y "..\..\Core\DX\DX10\bin\RGADX11.exe" "%OUTPUT_DIR%\x64\"

IF "%2"=="-internal" (
ECHO Copying internal vulkan backend
Expand Down
1 change: 1 addition & 0 deletions Build/VS2015/rga_copy_x86.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if not exist %OUTPUT_DIR% mkdir %OUTPUT_DIR%
rem Copy core files:
XCopy /r /d /y "..\..\Core\OpenGL\VirtualContext\Release\win32\VirtualContext.exe" "%OUTPUT_DIR%\x86\"
XCopy /r /d /y "..\..\Core\ShaderAnalysis\Windows\x86\shae.exe" "%OUTPUT_DIR%\x86\"
XCopy /r /d /y "..\..\Core\DX\DX10\bin\RGADX11.exe" "%OUTPUT_DIR%\x64\"

IF "%2"=="-internal" (
ECHO Copying internal vulkan backend
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")

endif()

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CONFIGURATION_TYPES "Debug")
else()
set(CMAKE_CONFIGURATION_TYPES "Release")
endif()

# Continue to the following subdirectories
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/../Common/Src/AMDTBaseTools CMAKE_CURRENT_BINARY_DIR}/../Common/Src/AMDTBaseTools)
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/../Common/Src/AMDTOSWrappers CMAKE_CURRENT_BINARY_DIR}/../Common/Src/AMDTOSWrappers)
Expand Down
Binary file added Core/DX/DX10/bin/RGADX11.exe
Binary file not shown.
Binary file modified Core/OpenGL/VirtualContext/Release/lnx64/VirtualContext
100644 → 100755
Binary file not shown.
Binary file modified Core/OpenGL/VirtualContext/Release/win32/VirtualContext.exe
Binary file not shown.
Binary file modified Core/OpenGL/VirtualContext/Release/win64/VirtualContext.exe
Binary file not shown.
Binary file modified Core/Vulkan/rev_1_0_0/Release/lnx32/amdspv
Binary file not shown.
Binary file modified Core/Vulkan/rev_1_0_0/Release/lnx32/spvgen.so
Binary file not shown.
Binary file modified Core/Vulkan/rev_1_0_0/Release/lnx64/amdspv
Binary file not shown.
Binary file modified Core/Vulkan/rev_1_0_0/Release/lnx64/spvgen.so
Binary file not shown.
Binary file modified Core/Vulkan/rev_1_0_0/Release/win32/amdspv.exe
Binary file not shown.
Binary file modified Core/Vulkan/rev_1_0_0/Release/win32/spvgen.dll
Binary file not shown.
Binary file modified Core/Vulkan/rev_1_0_0/Release/win64/amdspv.exe
Binary file not shown.
Binary file modified Core/Vulkan/rev_1_0_0/Release/win64/spvgen.dll
Binary file not shown.
10 changes: 6 additions & 4 deletions Installer/RGA-Installer.aip
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|Radeon GPU Analyzer]." ValueLocId="*"/>
<ROW Property="ARPCONTACT" Value="https://github.com/GPUOpen-Tools/"/>
<ROW Property="Manufacturer" Value="GPUOpen"/>
<ROW Property="ProductCode" Value="1033:{2E71B8E9-E679-432E-9482-7BF1520FDD46} " Type="16"/>
<ROW Property="ProductCode" Value="1033:{1865EBB9-699C-44D1-8225-40427B409CC8} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="Radeon GPU Analyzer"/>
<ROW Property="ProductVersion" Value="1.1.0" Type="32"/>
<ROW Property="ProductVersion" Value="1.2.0" Type="32"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
<ROW Property="UpgradeCode" Value="{72FDBDB3-E5E3-4772-9396-EB5196A89D80}"/>
<ROW Property="WindowsType9X" MultiBuildValue="x64_Release_Static:Windows 9x/ME" ValueLocId="-"/>
Expand All @@ -31,6 +31,7 @@
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
<ROW Component="ProductInformation" ComponentId="{5A879851-1BA2-49ED-8103-9FBEBBA01CDB}" Directory_="APPDIR" Attributes="4" KeyPath="Version"/>
<ROW Component="RGADX11.exe" ComponentId="{95F2AF66-093B-4D79-A9A1-BFED9287C0FA}" Directory_="x64_Dir" Attributes="256" KeyPath="RGADX11.exe"/>
<ROW Component="VirtualContext.exe" ComponentId="{834746B9-C33C-4BF1-930C-2314F65BEB29}" Directory_="x64_Dir" Attributes="256" KeyPath="VirtualContext.exe"/>
<ROW Component="amdspv.exe" ComponentId="{9E26F4EB-D690-4A14-A4AA-3C882D14D270}" Directory_="x64_Dir" Attributes="256" KeyPath="amdspv.exe"/>
<ROW Component="concrt140.dll" ComponentId="{CE6568E7-655F-414F-9129-D3586D4BC171}" Directory_="APPDIR" Attributes="256" KeyPath="concrt140.dll"/>
Expand All @@ -43,14 +44,15 @@
<ROW Component="vcruntime140.dll" ComponentId="{895AD771-AFDA-4199-BB28-3B838BC3EE4A}" Directory_="APPDIR" Attributes="256" KeyPath="vcruntime140.dll"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="ProductInformation VirtualContext.exe amdspv.exe concrt140.dll d3dcompiler_47.dll msvcp140.dll rgax64.exe shae.exe spvgen.dll vccorlib140.dll vcruntime140.dll"/>
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="ProductInformation RGADX11.exe VirtualContext.exe amdspv.exe concrt140.dll d3dcompiler_47.dll msvcp140.dll rgax64.exe shae.exe spvgen.dll vccorlib140.dll vcruntime140.dll"/>
<ATTRIBUTE name="CurrentFeature" value="MainFeature"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">
<ROW File="RGADX11.exe" Component_="RGADX11.exe" FileName="RGADX11.exe" Attributes="0" SourcePath="..\Build\Output\Release_Static\bin\x64\RGADX11.exe" SelfReg="false" DigSign="true"/>
<ROW File="VirtualContext.exe" Component_="VirtualContext.exe" FileName="VIRTUA~1.EXE|VirtualContext.exe" Attributes="0" SourcePath="..\Build\Output\Release_Static\bin\x64\VirtualContext.exe" SelfReg="false" NextFile="concrt140.dll" DigSign="true"/>
<ROW File="amdspv.exe" Component_="amdspv.exe" FileName="amdspv.exe" Attributes="0" SourcePath="..\Build\Output\Release_Static\bin\x64\amdspv.exe" SelfReg="false" NextFile="shae.exe" DigSign="true"/>
<ROW File="concrt140.dll" Component_="concrt140.dll" FileName="CONCRT~1.DLL|concrt140.dll" Attributes="1" SourcePath="..\BuildOutput\bin\concrt140.dll" SelfReg="false" NextFile="msvcp140.dll"/>
<ROW File="d3dcompiler_47.dll" Component_="d3dcompiler_47.dll" FileName="D3DCOM~1.DLL|d3dcompiler_47.dll" Attributes="0" SourcePath="..\BuildOutput\bin\x64\d3dcompiler_47.dll" SelfReg="false"/>
<ROW File="d3dcompiler_47.dll" Component_="d3dcompiler_47.dll" FileName="D3DCOM~1.DLL|d3dcompiler_47.dll" Attributes="0" SourcePath="..\BuildOutput\bin\x64\d3dcompiler_47.dll" SelfReg="false" NextFile="RGADX11.exe"/>
<ROW File="msvcp140.dll" Component_="msvcp140.dll" FileName="msvcp140.dll" Attributes="1" SourcePath="..\BuildOutput\bin\msvcp140.dll" SelfReg="false" NextFile="vccorlib140.dll"/>
<ROW File="rgax64.exe" Component_="rgax64.exe" FileName="rga.exe" Attributes="0" SourcePath="..\Build\Output\Release_Static\bin\rga.exe" SelfReg="false" NextFile="amdspv.exe" DigSign="true"/>
<ROW File="shae.exe" Component_="shae.exe" FileName="shae.exe" Attributes="0" SourcePath="..\Build\Output\Release_Static\bin\x64\shae.exe" SelfReg="false" NextFile="spvgen.dll" DigSign="true"/>
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ The Radeon Software Crimson Edition or AMD Catalyst release must be installed to

## Build Instructions ##

Before starting, run the UpdateCommon.py script, which fetches the solution's dependencies.

### Building on Windows ###
There are two ways to build RGA on Windows:

Expand All @@ -48,8 +50,9 @@ There are two ways to build RGA on Windows:

cmake.exe -G "Visual Studio 14 2015 Win64" –DCMAKE_BUILD_TYPE=Release (or: Debug) <full path to the RGA repo directory>

Before starting, run the UpdateCommon.py script, which fetches the solution's dependencies.

If you are intending to analyze DirectX shaders using RGA, copy the x64 version of Microsoft's D3D compiler to a subdirectory
named "x64" under the RGA executable's directory (for example, D3DCompiler_47.dll).

Note that after switching CMake build configurations, you might need to delete the old files that were previously generated by CMake. Therefore,
it is recommended to work with separate output directories, one for each build configuration.

Expand Down
2 changes: 1 addition & 1 deletion RadeonGPUAnalyzerBackend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project (RadeonGPUAnalyzerBackend)

# The version number
set (RadeonGPUAnalyzerBackend_VERSION_MAJOR 1)
set (RadeonGPUAnalyzerBackend_VERSION_MINOR 0)
set (RadeonGPUAnalyzerBackend_VERSION_MINOR 2)

# Project-specific preprocessor directives
add_definitions(-DRGA_BACKEND_EXPORTS)
Expand Down
2 changes: 1 addition & 1 deletion RadeonGPUAnalyzerBackend/include/beBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class RGA_BACKEND_DECLDIR Backend : public TSingleton<Backend>
//
// Public member functions
//
beStatus Initialize(BuiltProgramKind ProgramKind, LoggingCallBackFuncP callback, const string& sDllModule = "");
beStatus Initialize(BuiltProgramKind ProgramKind, LoggingCallBackFuncP callback);

/// dtor
/// If a Log stream is available, unreleased built programs may be diagnosed.
Expand Down
4 changes: 4 additions & 0 deletions RadeonGPUAnalyzerBackend/include/beInclude.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,13 @@ enum beStatus
beStatus_GLUnknownHardwareFamily,
beStatus_VulkanAmdspvLaunchFailure,
beStatus_VulkanAmdspvCompilationFailure,
beStatus_VulkanNoInputFile,
beStatus_FailedOutputVerification,
beStatus_VulkanMixedInputFiles,
beStatus_shaeCannotLocateAnalyzer,
beStatus_shaeIsaFileNotFound,
beStatus_shaeFailedToLaunch,
beStatus_dxDriverLaunchFailure,
beStatus_General_FAILED,
};

Expand Down
4 changes: 0 additions & 4 deletions RadeonGPUAnalyzerBackend/include/beProgramBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ class RGA_BACKEND_DECLDIR beProgramBuilder
}

protected:
/// Ctor
//virtual beProgramBuilder() = 0;

virtual beKA::beStatus Initialize(const std::string& sDllModule = "") = 0;

/// Stream for diagnostic output. set externally.
LoggingCallBackFuncP m_LogCallback;
Expand Down
22 changes: 14 additions & 8 deletions RadeonGPUAnalyzerBackend/include/beProgramBuilderDX.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ using namespace beKA;
class CElf;
class CElfSection;

class RGA_BACKEND_DECLDIR beProgramBuilderDX : public beProgramBuilder
class beProgramBuilderDX : public beProgramBuilder
{
public:

Expand Down Expand Up @@ -131,7 +131,14 @@ class RGA_BACKEND_DECLDIR beProgramBuilderDX : public beProgramBuilder
void ReleaseProgram();
beKA::beStatus GetDeviceTable(std::vector<GDT_GfxCardInfo>& table) override;
bool CompileOK(std::string& device);

public:
/// Ctor
beProgramBuilderDX();

/// Initialize the Builder
beKA::beStatus Initialize(const std::string& dxxModuleName, const std::string& compilerModuleName = "");

/// compile the specified source file
/// \param[in] sourceLanguage specify the source language- can be HLSL or DXAsm
/// \param[in] programSource the string of the source code
Expand Down Expand Up @@ -188,10 +195,12 @@ class RGA_BACKEND_DECLDIR beProgramBuilderDX : public beProgramBuilder
/// Sets the set of public device names.
void SetPublicDeviceNames(const std::set<std::string>& publicDeviceNames);

protected:
/// Ctor
beProgramBuilderDX();
beKA::beStatus Initialize(const std::string& sDllModule = "");
/// Retrieves the list of names of AMD display adapters installed on the system.
static bool GetSupportedDisplayAdapterNames(std::vector<std::string>& adapterNames);

/// Gets the full path to AMD DXX library for GPU adapter specified by "adapterID".
/// Returns the adapter name in "adapterName" and DXX lib path in "dxxModulePath".
static bool GetDXXModulePathForAdapter(int adapterID, std::string& adapterName, std::string& dxxModulePath);

private: // members
/// Interface with atidxx{32,64}.dll
Expand Down Expand Up @@ -245,9 +254,6 @@ class RGA_BACKEND_DECLDIR beProgramBuilderDX : public beProgramBuilder
void ClearFormerBuildOutputs();
void SetDeviceElf(const std::string& deviceName, const AmdDxGsaCompileShaderOutput& shaderOutput);
bool GetDeviceElfBinPair(const std::string& deviceName, CelfBinaryPair& elfBinPair) const;

// Friends.
friend class Backend;
};

#endif
6 changes: 3 additions & 3 deletions RadeonGPUAnalyzerBackend/include/beProgramBuilderOpenGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

struct OpenGLOptions : public beKA::CompileOptions
{
OpenGLOptions() : m_chipFamily(0), m_chipRevision(0), m_isAmdIsaBinariesRequired(true),
m_isAmdIsaDisassemblyRequired(true), m_isScStatsRequired(true)
OpenGLOptions() : m_chipFamily(0), m_chipRevision(0), m_isAmdIsaBinariesRequired(false),
m_isAmdIsaDisassemblyRequired(false), m_isScStatsRequired(false), m_isCfgRequired(false), m_isLiveRegisterAnalysisRequired(false)
{
CompileOptions::m_SourceLanguage = beKA::SourceLanguage_GLSL;
}
Expand Down Expand Up @@ -87,7 +87,7 @@ class RGA_BACKEND_DECLDIR beProgramBuilderOpenGL :

virtual bool CompileOK(std::string& device) override;

virtual beKA::beStatus Initialize(const std::string& sDllModule = "") override;
beKA::beStatus Initialize(const std::string& sDllModule = "");

beKA::beStatus Compile(const OpenGLOptions& vulkanOptions, bool& cancelSignal, gtString& compilerOutput);

Expand Down
5 changes: 4 additions & 1 deletion RadeonGPUAnalyzerBackend/include/beProgramBuilderVulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ struct VulkanOptions : public beKA::CompileOptions
// The target devices.
std::string m_targetDeviceName;

// The generic input file name.
std::string m_stagelessInputFile;

// The input shader file names.
beProgramPipeline m_pipelineShaders;

Expand Down Expand Up @@ -101,7 +104,7 @@ class RGA_BACKEND_DECLDIR beProgramBuilderVulkan : public

virtual bool CompileOK(std::string& device) override;

virtual beKA::beStatus Initialize(const std::string& sDllModule = "") override;
beKA::beStatus Initialize(const std::string& sDllModule = "");

beKA::beStatus Compile(const VulkanOptions& vulkanOptions, bool& cancelSignal, gtString& buildLog);

Expand Down
4 changes: 4 additions & 0 deletions RadeonGPUAnalyzerBackend/include/beUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class beUtils
// Deletes a physical file from the file system.
static void DeleteFile(const gtString& filePath);

// If "required" is true, checks if the "fileName" file exists and is not empty.
// If "requierd" is false, returns "true" unconditionally.
static bool isFilePresent(const std::string& fileName, bool required);

private:
// No instances for this class, as this is a static utility class.
beUtils();
Expand Down
42 changes: 1 addition & 41 deletions RadeonGPUAnalyzerBackend/src/beBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// Infra.
#include <AMDTOSAPIWrappers/Include/oaOpenGLRenderContext.h>
#include <AMDTOSWrappers/Include/osFilePath.h>
#include <AMDTOSWrappers/Include/osApplication.h>
#include <AMDTOSAPIWrappers/Include/oaDriver.h>
#include <AMDTOSWrappers/Include/osDebugLog.h>

Expand All @@ -45,11 +44,8 @@ Backend::Backend() : m_supportedPublicDevices()
m_driverVersionInfo.clear();
}

beKA::beStatus Backend::Initialize(BuiltProgramKind ProgramKind, LoggingCallBackFuncP callback, const string& sDllModule)
beKA::beStatus Backend::Initialize(BuiltProgramKind ProgramKind, LoggingCallBackFuncP callback)
{
#ifndef _WIN32
GT_UNREFERENCED_PARAMETER(sDllModule);
#endif
beKA::beStatus retVal = beStatus_General_FAILED;
m_LogCallback = callback;

Expand All @@ -71,7 +67,6 @@ beKA::beStatus Backend::Initialize(BuiltProgramKind ProgramKind, LoggingCallBack
}

#ifdef _WIN32

if (ProgramKind == BuiltProgramKind_DX)
{
// Initialize the DX backend.
Expand All @@ -92,42 +87,7 @@ beKA::beStatus Backend::Initialize(BuiltProgramKind ProgramKind, LoggingCallBack
m_beDX->AddDxSearchDir(dir);
}
}

if (m_beDX != NULL)
{
// Set the name of the module to be loaded.
std::string moduleToLoad;

if (sDllModule.empty())
{
// This solves the VS extension issue where devenv.exe looked for the D3D compiler
// at its own directory, instead of looking for it at CodeXL's binaries directory.
osFilePath defaultCompilerFilePath;

// Get CodeXL's binaries directory. Both the 32 and 64-bit versions of d3dcompiler are bundled with CodeXL.
// We use the 32-bit version by default
bool isOk = osGetCurrentApplicationDllsPath(defaultCompilerFilePath, OS_I386_ARCHITECTURE);

if (isOk)
{
// Create the full path to the default D3D compiler.
defaultCompilerFilePath.setFileName(SA_BE_STR_HLSL_optionsDefaultCompilerFileName);
defaultCompilerFilePath.setFileExtension(SA_BE_STR_HLSL_optionsDefaultCompilerFileExtension);
moduleToLoad = defaultCompilerFilePath.asString().asASCIICharArray();
}
}
else
{
// Use the given name.
moduleToLoad = sDllModule;
}

// Initialize the DX backend.
m_beDX->SetLog(callback);
retVal = m_beDX->Initialize(moduleToLoad);
}
}

#endif

return retVal;
Expand Down
Loading

0 comments on commit 75841d6

Please sign in to comment.