Skip to content

Commit

Permalink
xrRender_R1: added ability to enable or force fixed-function pipeline…
Browse files Browse the repository at this point in the history
… usage instead of shaders
  • Loading branch information
Xottab-DUTY committed Apr 20, 2023
1 parent 937f660 commit 1eb1afc
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Layers/xrRender/Blender_Recorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class CBlender_Compile
LPCSTR detail_texture;
R_constant_setup* detail_scaler;

bool bFFP;
bool bEditor;
bool bDetail;
bool bDetail_Diffuse;
Expand Down
6 changes: 4 additions & 2 deletions src/Layers/xrRender/ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,17 @@ Shader* CResourceManager::_cpp_Create(

// Access to template
C.BT = B;
C.bEditor = FALSE;
C.bFFP = false;
C.bEditor = false;
C.bDetail = FALSE;
#ifdef _EDITOR
if (!C.BT)
{
ELog.Msg(mtError, "Can't find shader '%s'", s_shader);
return 0;
}
C.bEditor = TRUE;
C.bFFP = true;
C.bEditor = true;
#else
UNUSED(s_shader);
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/Layers/xrRender/xrRender_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,8 @@ void xrRender_initconsole()
// 2 - forced hardware skinning (renderer can not override)
CMD4(CCC_Integer, "r1_software_skinning", &ps_r1_SoftwareSkinning, 0, 2);

CMD3(CCC_Mask, "r1_ffp", &ps_r1_flags, R1FLAG_FFP);

// R2
CMD4(CCC_Float, "r2_ssa_lod_a", &ps_r2_ssaLOD_A, 16, 96);
CMD4(CCC_Float, "r2_ssa_lod_b", &ps_r2_ssaLOD_B, 32, 64);
Expand Down
1 change: 1 addition & 0 deletions src/Layers/xrRender/xrRender_console.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ extern ECORE_API int ps_r1_SoftwareSkinning; // r1-only
enum
{
R1FLAG_DLIGHTS = (1 << 0),
R1FLAG_FFP = (1 << 1), // don't use shaders, only fixed-function pipeline or software processing
};

// R2
Expand Down
3 changes: 3 additions & 0 deletions src/Layers/xrRenderPC_R1/FStaticRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ void CRender::create()

m_skinning = -1;

// Fixed-function pipeline
o.ffp = !!strstr(Core.Params, "-force_ffp") || ps_r1_flags.test(R1FLAG_FFP);

// disasm
o.disasm = (strstr(Core.Params, "-disasm")) ? TRUE : FALSE;
o.forceskinw = (strstr(Core.Params, "-skinw")) ? TRUE : FALSE;
Expand Down
1 change: 1 addition & 0 deletions src/Layers/xrRenderPC_R1/FStaticRender.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class CRender : public D3DXRenderBase
u32 forceskinw : 1; // config
u32 no_detail_textures : 1; // config
u32 no_ram_textures : 1; // don't keep textures in RAM
u32 ffp : 1; // don't use shaders, only fixed-function pipeline or software processing
} o;

public:
Expand Down
2 changes: 2 additions & 0 deletions src/Layers/xrRender_R2/r2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ void CRender::create()
Msg("* Managed textures disabled");
#endif

o.ffp = false;

// options (smap-pool-size)
if (strstr(Core.Params, "-smap1024"))
o.smapsize = 1024;
Expand Down
1 change: 1 addition & 0 deletions src/Layers/xrRender_R2/r2.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class CRender final : public D3DXRenderBase

u32 nullrt : 1;
u32 no_ram_textures : 1; // don't keep textures in RAM
u32 ffp : 0; // don't use shaders, only fixed-function pipeline or software processing

u32 distortion : 1;
u32 distortion_enabled : 1;
Expand Down

1 comment on commit 1eb1afc

@Xottab-DUTY
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.