From 4390cb4db4804be263fa360a3b684b7bd34f2437 Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Tue, 30 Jan 2007 20:47:32 +0000 Subject: [PATCH] Use the shader model from DisplayInformation if it is better than the Cg shader model detection. --- .../src/glstuff/glGraphicsStateGuardian_src.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 319cdaace2..aa5415abf8 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -1115,6 +1115,22 @@ reset() { } cg_profile_to_shader_model++; } + + // DisplayInformation may have better shader model detection + { + GraphicsPipe *pipe; + DisplayInformation *display_information; + + pipe = this -> get_pipe ( ); + if (pipe) { + display_information = pipe -> get_display_information ( ); + if (display_information) { + if (display_information -> get_shader_model ( ) > _shader_model) { + _shader_model = display_information -> get_shader_model ( ); + } + } + } + } _auto_detect_shader_model = _shader_model; CGprofile vertex_profile;