| 874 | } |
| 875 | |
| 876 | void RendererGL::PrepareRenderState(const float (&mat_project)[16], bool disable_zbuffer) |
| 877 | { |
| 878 | DAEDALUS_PROFILE( "RendererGL::PrepareRenderState" ); |
| 879 | |
| 880 | if ( disable_zbuffer ) |
| 881 | { |
| 882 | glDisable(GL_DEPTH_TEST); |
| 883 | glDepthMask(GL_FALSE); |
| 884 | } |
| 885 | else |
| 886 | { |
| 887 | // Decal mode |
| 888 | if( gRDPOtherMode.zmode == 3 ) |
| 889 | { |
| 890 | glPolygonOffset(-1.0, -1.0); |
| 891 | } |
| 892 | else |
| 893 | { |
| 894 | glPolygonOffset(0.0, 0.0); |
| 895 | } |
| 896 | |
| 897 | // Enable or Disable ZBuffer test |
| 898 | if ( (mTnL.Flags.Zbuffer & gRDPOtherMode.z_cmp) | gRDPOtherMode.z_upd ) |
| 899 | { |
| 900 | glEnable(GL_DEPTH_TEST); |
| 901 | } |
| 902 | else |
| 903 | { |
| 904 | glDisable(GL_DEPTH_TEST); |
| 905 | } |
| 906 | |
| 907 | glDepthMask(gRDPOtherMode.z_upd ? GL_TRUE : GL_FALSE); |
| 908 | } |
| 909 | |
| 910 | |
| 911 | u32 cycle_mode = gRDPOtherMode.cycle_type; |
| 912 | |
| 913 | // Initiate Blender |
| 914 | if(cycle_mode < CYCLE_COPY && gRDPOtherMode.force_bl) |
| 915 | { |
| 916 | InitBlenderMode(); |
| 917 | } |
| 918 | else |
| 919 | { |
| 920 | glDisable(GL_BLEND); |
| 921 | } |
| 922 | |
| 923 | ShaderConfiguration config; |
| 924 | MakeShaderConfigFromCurrentState(&config); |
| 925 | |
| 926 | const ShaderProgram * program = GetShaderForConfig(config); |
| 927 | if (program == NULL) |
| 928 | { |
| 929 | // There must have been some failure to compile the shader. Abort! |
| 930 | DBGConsole_Msg(0, "Couldn't generate a shader for mux %llx, cycle %d, alpha %d\n", config.Mux, config.CycleType, config.AlphaThreshold); |
| 931 | return; |
| 932 | } |
| 933 |
nothing calls this directly
no test coverage detected