Skip to content

Commit

Permalink
R_constants: Set the geometry shader constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Nov 29, 2015
1 parent 5e0c02d commit 56981b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Layers/xrRender/blenders/Blender_Recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void CBlender_Compile::PassEnd ()
proto.vs = RImplementation.Resources->_CreateVS (pass_vs);
ctable.merge (&proto.ps->constants);
ctable.merge (&proto.vs->constants);
#if defined(USE_DX10) || defined(USE_DX11)
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
proto.gs = RImplementation.Resources->_CreateGS (pass_gs);
ctable.merge (&proto.gs->constants);
# ifdef USE_DX11
Expand Down
8 changes: 8 additions & 0 deletions src/Layers/xrRenderGL/glr_constants_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,47 +99,55 @@ class ECORE_API R_constants
ICF void set (R_constant* C, const Fmatrix& A) {
if (C->destination&RC_dest_pixel) { set(C, C->ps, A); }
if (C->destination&RC_dest_vertex) { set(C, C->vs, A); }
if (C->destination&RC_dest_geometry) { set(C, C->gs, A); }
}
ICF void set (R_constant* C, const Fvector4& A) {
if (C->destination&RC_dest_pixel) { set(C, C->ps, A); }
if (C->destination&RC_dest_vertex) { set(C, C->vs, A); }
if (C->destination&RC_dest_geometry) { set(C, C->gs, A); }
}
ICF void set (R_constant* C, float x, float y, float z, float w) {
if (C->destination&RC_dest_pixel) { set(C, C->ps, x, y, z, w); }
if (C->destination&RC_dest_vertex) { set(C, C->vs, x, y, z, w); }
if (C->destination&RC_dest_geometry) { set(C, C->gs, x, y, z, w); }
}

// scalars, non-array versions
ICF void set(R_constant* C, float A)
{
if (C->destination&RC_dest_pixel) { set(C, C->ps, A); }
if (C->destination&RC_dest_vertex) { set(C, C->vs, A); }
if (C->destination&RC_dest_geometry) { set(C, C->gs, A); }
}
ICF void set(R_constant* C, int A)
{
if (C->destination&RC_dest_pixel) { set(C, C->ps, A); }
if (C->destination&RC_dest_vertex) { set(C, C->vs, A); }
if (C->destination&RC_dest_geometry) { set(C, C->gs, A); }
}

// fp, array versions
ICF void seta (R_constant* C, u32 e, const Fmatrix& A) {
R_constant_load L;
if (C->destination&RC_dest_pixel) { L = C->ps; }
if (C->destination&RC_dest_vertex) { L = C->vs; }
if (C->destination&RC_dest_geometry) { L = C->gs; }
L.location += e;
set(C, L, A);
}
ICF void seta (R_constant* C, u32 e, const Fvector4& A) {
R_constant_load L;
if (C->destination&RC_dest_pixel) { L = C->ps; }
if (C->destination&RC_dest_vertex) { L = C->vs; }
if (C->destination&RC_dest_geometry) { L = C->gs; }
L.location += e;
set(C, L, A);
}
ICF void seta (R_constant* C, u32 e, float x, float y, float z, float w) {
R_constant_load L;
if (C->destination&RC_dest_pixel) { L = C->ps; }
if (C->destination&RC_dest_vertex) { L = C->vs; }
if (C->destination&RC_dest_geometry) { L = C->gs; }
L.location += e;
set(C, L, x, y, z, w);

Expand Down

0 comments on commit 56981b2

Please sign in to comment.