Skip to content

Commit

Permalink
Merge branch 'dev/adunn/cube_tex' into 'main'
Browse files Browse the repository at this point in the history
[REMIX-2761] Add heuristic setting to allow cube textures through to remix

See merge request lightspeedrtx/dxvk-remix-nv!702
  • Loading branch information
AlexDunn committed Feb 22, 2024
2 parents 6061236 + 2da3e71 commit a722df5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/d3d9/d3d9_rtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,9 +858,10 @@ namespace dxvk {

D3D9CommonTexture* texture = GetCommonTexture(d3d9State().textures[stage]);

// Remix can only handle 2D textures - no cubemaps or volumes.
if (texture->GetType() != D3DRTYPE_TEXTURE)
// Remix can only handle 2D textures - no volumes.
if (texture->GetType() != D3DRTYPE_TEXTURE && (!allowCubemaps() || texture->GetType() != D3DRTYPE_CUBETEXTURE)) {
continue;
}

const XXH64_hash_t texHash = texture->GetSampleView(true)->image()->getHash();

Expand Down
1 change: 1 addition & 0 deletions src/d3d9/d3d9_rtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace dxvk {
D3D9Rtx(D3D9DeviceEx* d3d9Device, bool enableDrawCallConversion = true);

RTX_OPTION("rtx", bool, orthographicIsUI, true, "When enabled, draw calls that are orthographic will be considered as UI.");
RTX_OPTION("rtx", bool, allowCubemaps, false, "When enabled, cubemaps from the game are processed through Remix, but they may not render correctly.");
RTX_OPTION("rtx", bool, useVertexCapture, true, "When enabled, injects code into the original vertex shader to capture final shaded vertex positions. Is useful for games using simple vertex shaders, that still also set the fixed function transform matrices.");
RTX_OPTION("rtx", bool, useVertexCapturedNormals, true, "When enabled, vertex normals are read from the input assembler and used in raytracing. This doesn't always work as normals can be in any coordinate space, but can help sometimes.");
RTX_OPTION("rtx", bool, useWorldMatricesForShaders, true, "When enabled, Remix will utilize the world matrices being passed from the game via D3D9 fixed function API, even when running with shaders. Sometimes games pass these matrices and they are useful, however for some games they are very unreliable, and should be filtered out. If you're seeing precision related issues with shader vertex capture, try disabling this setting.");
Expand Down
1 change: 1 addition & 0 deletions src/dxvk/imgui/dxvk_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2099,6 +2099,7 @@ namespace dxvk {
if (ImGui::CollapsingHeader("Heuristics", collapsingHeaderClosedFlags)) {
ImGui::Indent();
ImGui::Checkbox("Orthographic Is UI", &D3D9Rtx::orthographicIsUIObject());
ImGui::Checkbox("Allow Cubemaps", &D3D9Rtx::allowCubemapsObject());
ImGui::Unindent();
}

Expand Down
1 change: 1 addition & 0 deletions src/util/config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ namespace dxvk {
"legacyindices,"
"geometrydescriptor,"
"vertexlayout" },
{ "rtx.allowCubemaps", "True" },
}} },
/* Kohan II */
{ R"(\\k2\.exe$)", {{
Expand Down

0 comments on commit a722df5

Please sign in to comment.