Skip to content

Commit

Permalink
* Added Techniques/DataViewers/ModelViewer.gg and TextureViewer.gg to…
Browse files Browse the repository at this point in the history
… be quick viewers that also let you modify the data in a compute shader and then resave. In the future when you drag a model or texture onto the gigi viewer it will open these graphs by default to allow quick viewing of asset files.

* Updated Agility SDK to 1.614.1
* Added build number to displayed version number
* DX12 code gen fixes and improvements
* -nopixcapture viewer option to disable pix capturing. Currently needed when using AMD GPU Reshape.
* fixed a problem with RT acceleration structure scratch buffer not being large enough sometimes (viewer and DX12 codegen)
* Fixed tangent calculations in the FBX loader path in the viewer.
  • Loading branch information
Atrix256 committed Nov 27, 2024
1 parent ff062f2 commit d784578
Show file tree
Hide file tree
Showing 122 changed files with 1,741 additions and 864 deletions.
18 changes: 13 additions & 5 deletions GigiCompilerLib/Backends/DX12/nodes/node_resource_texture.inl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
// Copyright (c) 2024 Electronic Arts Inc. All rights reserved. //
///////////////////////////////////////////////////////////////////////////////

static std::string SanitizeFilenameForCpp(const std::string& fileName)
{
std::string ret = fileName;
StringReplaceAll(ret, "\\\\", "\\"); // This is a bit ugly, but trying to prevent double escaping
StringReplaceAll(ret, "\\", "\\\\");
return ret;
}

static void MakeStringReplacementForNode(std::unordered_map<std::string, std::ostringstream>& stringReplacementMap, RenderGraph& renderGraph, const RenderGraphNode_Resource_Texture& node)
{
if (!ResourceNodeIsUsed(node))
Expand Down Expand Up @@ -139,15 +147,15 @@ static void MakeStringReplacementForNode(std::unordered_map<std::string, std::os
"\n else if (formatInfo.channelType == DX12Utils::DXGI_FORMAT_Info::ChannelType::_float)"
"\n desiredType = DX12Utils::TextureCache::Type::F32;"
"\n else"
"\n Context::LogFn(LogLevel::Error, \"Unhandled channel type for image: " << node.loadFileName << "\");"
"\n Context::LogFn(LogLevel::Error, \"Unhandled channel type for image: " << SanitizeFilenameForCpp(node.loadFileName) << "\");"
"\n"
"\n char loadedTextureFileName[1024];"
"\n sprintf_s(loadedTextureFileName, \"%lsassets/" << node.loadFileName << "\", s_techniqueLocation.c_str());"
"\n sprintf_s(loadedTextureFileName, \"%lsassets/" << SanitizeFilenameForCpp(node.loadFileName) << "\", s_techniqueLocation.c_str());"
"\n"
"\n loadedTextureSlices.push_back(DX12Utils::TextureCache::GetAs(loadedTextureFileName, " << (node.loadFileNameAsSRGB ? "true" : "false") << ", desiredType, formatInfo.sRGB, formatInfo.channelCount));"
"\n DX12Utils::TextureCache::Texture& loadedTexture = loadedTextureSlices[0];"
"\n if(!loadedTexture.Valid())"
"\n Context::LogFn(LogLevel::Error, \"Could not load image: " << node.loadFileName << "\");"
"\n Context::LogFn(LogLevel::Error, \"Could not load image: " << SanitizeFilenameForCpp(node.loadFileName) << "\");"
"\n"
"\n unsigned int size[3] = { (unsigned int)loadedTexture.width, (unsigned int)loadedTexture.height, 1 };"
;
Expand Down Expand Up @@ -187,13 +195,13 @@ static void MakeStringReplacementForNode(std::unordered_map<std::string, std::os
"\n \"Back\""
"\n };"
"\n"
"\n sprintf_s(indexedFileName, \"%lsassets/" << node.loadFileName << "\", s_techniqueLocation.c_str(), c_cubeMapNames[textureIndex]);"
"\n sprintf_s(indexedFileName, \"%lsassets/" << SanitizeFilenameForCpp(node.loadFileName) << "\", s_techniqueLocation.c_str(), c_cubeMapNames[textureIndex]);"
;
}
else
{
stringReplacementMap["/*$(EnsureResourcesCreated)*/"] <<
"\n sprintf_s(indexedFileName, \"%lsassets/" << node.loadFileName << "\", s_techniqueLocation.c_str(), textureIndex);"
"\n sprintf_s(indexedFileName, \"%lsassets/" << SanitizeFilenameForCpp(node.loadFileName) << "\", s_techniqueLocation.c_str(), textureIndex);"
;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#endif

// Gigi Modification Begin/*$(if:DX12.AgilitySDKRequired:true)*/
extern "C" { __declspec(dllexport) extern const UINT D3D12SDKVersion = 613; }
extern "C" { __declspec(dllexport) extern const UINT D3D12SDKVersion = 614; }
extern "C" { __declspec(dllexport) extern const char* D3D12SDKPath = ".\\AgilitySDK\\bin\\"; }
/*$(endif)*/
#include "DX12Utils/FileCache.h"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit d784578

Please sign in to comment.