diff --git a/src/Layers/xrRender/R_Backend.h b/src/Layers/xrRender/R_Backend.h index 7e3d8c0452c..d985475ff08 100644 --- a/src/Layers/xrRender/R_Backend.h +++ b/src/Layers/xrRender/R_Backend.h @@ -581,6 +581,7 @@ class ECORE_API CBackend , tree(*this) , hemi(*this) #if defined(USE_DX11) + , LOD(*this) , constants(*this) , StateManager(*this) #endif diff --git a/src/Layers/xrRenderPC_R4/R_Backend_LOD.cpp b/src/Layers/xrRenderPC_R4/R_Backend_LOD.cpp index af39cd8dbbe..e08cd83368e 100644 --- a/src/Layers/xrRenderPC_R4/R_Backend_LOD.cpp +++ b/src/Layers/xrRenderPC_R4/R_Backend_LOD.cpp @@ -1,12 +1,16 @@ #include "stdafx.h" #include "r_backend_lod.h" -R_LOD::R_LOD() { unmap(); } +R_LOD::R_LOD(CBackend& cmd_list_in) : cmd_list(cmd_list_in) +{ + unmap(); +} + void R_LOD::set_LOD(float LOD) { if (c_LOD) { float factor = clampr(ceil(LOD * LOD * LOD * LOD * LOD * 8.0f), 1, 7); - RCache.set_c(c_LOD, factor); + cmd_list.set_c(c_LOD, factor); } } diff --git a/src/Layers/xrRenderPC_R4/R_Backend_LOD.h b/src/Layers/xrRenderPC_R4/R_Backend_LOD.h index 6b0364822b5..bb276941e45 100644 --- a/src/Layers/xrRenderPC_R4/R_Backend_LOD.h +++ b/src/Layers/xrRenderPC_R4/R_Backend_LOD.h @@ -7,11 +7,13 @@ class R_LOD R_constant* c_LOD; public: - R_LOD(); + explicit R_LOD(CBackend& cmd_list_in); void unmap() { c_LOD = 0; } void set_LOD(R_constant* C) { c_LOD = C; } void set_LOD(float LOD); + + CBackend& cmd_list; }; #endif // #ifndef R_BACKEND_LOD_H_INCLUDED