Skip to content

Commit

Permalink
Fix line numbers in D3DCompiler messages for D3D9 when debug info is …
Browse files Browse the repository at this point in the history
…disabled
  • Loading branch information
crosire committed Jan 9, 2021
1 parent 7efb02f commit 1dd5207
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/d3d9/runtime_d3d9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,12 @@ bool reshade::d3d9::runtime_d3d9::init_effect(size_t index)

// Add specialization constant defines to source code
const std::string hlsl =
effect.preamble +
"#define COLOR_PIXEL_SIZE 1.0 / " + std::to_string(_width) + ", 1.0 / " + std::to_string(_height) + "\n"
"#define DEPTH_PIXEL_SIZE COLOR_PIXEL_SIZE\n"
"#define SV_DEPTH_PIXEL_SIZE DEPTH_PIXEL_SIZE\n"
"#define SV_TARGET_PIXEL_SIZE COLOR_PIXEL_SIZE\n" +
"#define SV_TARGET_PIXEL_SIZE COLOR_PIXEL_SIZE\n"
"#line 1\n" + // Reset line number, so it matches what is shown when viewing the generated code
effect.preamble +
effect.module.hlsl;

// Overwrite position semantic in pixel shaders
Expand Down

0 comments on commit 1dd5207

Please sign in to comment.