00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "config_dxgsg9.h"
00016 #include "dxGraphicsStateGuardian9.h"
00017 #include "dxTextureContext9.h"
00018 #include "dxVertexBufferContext9.h"
00019 #include "dxIndexBufferContext9.h"
00020 #include "dxOcclusionQueryContext9.h"
00021 #include "dxShaderContext9.h"
00022 #include "dxGeomMunger9.h"
00023 #include "graphicsPipeSelection.h"
00024 #include "wdxGraphicsWindow9.h"
00025 #include "wdxGraphicsPipe9.h"
00026 #include "wdxGraphicsBuffer9.h"
00027 #include "pandaSystem.h"
00028
00029 #include "dconfig.h"
00030
00031 DToolConfigure(config_dxgsg9);
00032 NotifyCategoryDef(dxgsg9, ":display:gsg");
00033 NotifyCategoryDef(wdxdisplay9, "display");
00034
00035
00036
00037
00038 ConfigVariableBool dx_show_transforms
00039 ("dx-show-transforms", false);
00040
00041
00042 ConfigVariableBool dx_no_vertex_fog
00043 ("dx-no-vertex-fog", false);
00044
00045
00046 ConfigVariableBool dx_show_cursor_watermark
00047 ("dx-show-cursor-watermark",
00048 #ifdef _DEBUG
00049 true
00050 #else
00051 false
00052 #endif
00053 );
00054
00055
00056 ConfigVariableBool dx_use_triangle_mipgen_filter
00057 ("dx-use-triangle-mipgen-filter", false);
00058
00059 ConfigVariableBool dx_broken_max_index
00060 ("dx-broken-max-index", false,
00061 PRC_DESC("Configure this true if you have a buggy graphics driver that "
00062 "doesn't correctly implement the third parameter, NumVertices, "
00063 "of DrawIndexedPrimitive(). In particular, the NVIDIA Quadro "
00064 "driver version 6.14.10.7184 seems to treat this as a maximum "
00065 "vertex index, rather than a delta between the maximum and "
00066 "minimum vertex index. Turn this on if you are seeing stray "
00067 "triangles, or you are not seeing all of your triangles. Enabling "
00068 "this should work around this bug, at the cost of some additional "
00069 "rendering overhead on the GPU."));
00070
00071 ConfigVariableBool dx_broken_depth_bias
00072 ("dx-broken-depth-bias", true,
00073 PRC_DESC("Configure this true if your graphics driver claims to support "
00074 "D3DPRASTERCAPS_DEPTHBIAS, but doesn't appear to do anything "
00075 "useful when you set it. In fact, there's not much reason not "
00076 "to just leave this set, since the workaround seems to be "
00077 "sufficient for all cases."));
00078
00079 ConfigVariableDouble dx_depth_bias_scale
00080 ("dx-depth-bias-scale", 0.000001,
00081 PRC_DESC("If depth bias is not directly supported by the graphics driver "
00082 "(or if dx-broken-depth-bias is set true), this configures the "
00083 "amount by which we slide the viewport back to achieve the effect "
00084 "of a depth bias. It should generally be a small number."));
00085
00086 ConfigVariableBool dx_count_all_cards_memory
00087 ("dx-count-all-cards-memory", true,
00088 PRC_DESC("Set this to false to skip the counting of extra cards memory "
00089 "via DX7 calls."));
00090
00091 #ifndef NDEBUG
00092
00093
00094 ConfigVariableInt dx_force_backface_culling
00095 ("dx-force-backface-culling", 0);
00096 #endif
00097
00098 ConfigVariableBool dx_mipmap_everything
00099 ("dx-mipmap-everything", false);
00100 ConfigVariableBool dx_ignore_mipmaps
00101 ("dx-ignore-mipmaps", false);
00102
00103
00104 ConfigVariableBool dx_use_rangebased_fog
00105 ("dx-use-rangebased-fog", false);
00106 ConfigVariableBool dx_no_dithering
00107 ("dx-no-dithering", false);
00108 ConfigVariableBool dx_force_16bpp_zbuffer
00109 ("dx-force-16bpp-zbuffer", false);
00110 ConfigVariableBool dx_do_vidmemsize_check
00111 ("do-vidmemsize-check", true);
00112
00113
00114
00115
00116
00117
00118 ConfigVariableBool dx_preserve_fpu_state
00119 ("dx-preserve-fpu-state", true);
00120
00121 ConfigVariableInt dx_preferred_device_id
00122 ("dx-preferred-device-id", -1);
00123
00124 ConfigVariableBool dx_intel_compressed_texture_bug
00125 ("dx-intel-compressed-texture-bug", true,
00126 PRC_DESC("Set this true to work around a bug in the Intel driver "
00127 "igdumd32.dll, for at least the 965 Express chipset family, "
00128 "which breaks compressed texture images smaller "
00129 "than about 256x256 (even mipmap levels). The workaround is "
00130 "simply to disable compressed texture support when this "
00131 "driver is detected."));
00132
00133 #ifdef _DEBUG
00134 ConfigVariableDouble dx_global_miplevel_bias
00135 ("dx-global-miplevel-bias", 0.0);
00136 ConfigVariableBool dx_debug_view_mipmaps
00137 ("dx-debug-view-mipmaps", false);
00138 #endif
00139
00140 ConfigVariableBool dx_force_anisotropic_filtering
00141 ("dx-force-anisotropic-filtering", false);
00142
00143
00144
00145 ConfigVariableBool link_tristrips
00146 ("link-tristrips", false);
00147
00148
00149
00150 ConfigVariableBool dx_management
00151 ("dx-management", false);
00152
00153
00154
00155
00156 ConfigVariableBool dx_texture_management
00157 ("dx-texture-management", true);
00158
00159
00160
00161
00162 ConfigVariableBool dx_lru_management
00163 ("dx-lru-management", true);
00164
00165
00166
00167
00168 ConfigVariableInt dx_lru_maximum_pages
00169 ("dx-lru-maximum-pages", 8192);
00170
00171
00172
00173
00174 ConfigVariableInt dx_lru_free_memory_requirement
00175 ("dx-lru-free-memory-requirement", 12000000);
00176
00177
00178 ConfigVariableInt dx_lru_minimum_memory_requirement
00179 ("dx-lru-minimum-memory-requirement", 64000000);
00180
00181
00182
00183 ConfigVariableInt dx_lru_maximum_memory_requirement
00184 ("dx-lru-maximum-memory-requirement", 0);
00185
00186
00187
00188 ConfigVariableInt dx_lru_maximum_page_updates_per_frame
00189 ("dx-lru-maximum-page-updates-per-frame", 40);
00190
00191
00192 ConfigVariableBool dx_lru_debug
00193 ("dx-lru-debug", false);
00194
00195
00196
00197 ConfigVariableInt dx_lru_debug_frames_til_output
00198 ("dx-lru-debug-frames-til-output", 500);
00199
00200
00201 ConfigVariableBool dx_lru_debug_textures
00202 ("dx-lru-debug-textures", false);
00203
00204
00205 ConfigVariableBool dx_lru_debug_vertex_buffers
00206 ("dx-lru-debug-vertex-buffers", false);
00207
00208 ConfigVariableBool dx_use_dynamic_textures
00209 ("dx-use-dynamic-textures", true);
00210
00211
00212 ConfigVariableBool dx_use_multithread
00213 ("dx-use-multithread", false);
00214
00215
00216 ConfigVariableBool dx_use_puredevice
00217 ("dx-use-puredevice", false);
00218
00219
00220 ConfigVariableBool dx_disable_driver_management
00221 ("dx-disable-driver-management", false);
00222
00223
00224 ConfigVariableBool dx_disable_driver_management_ex
00225 ("dx-disable-driver-management-ex", false);
00226
00227
00228 ConfigVariableBool dx_use_nvperfhud
00229 ("dx-use-nvperfhud", false);
00230
00231 ConfigureFn(config_dxgsg9) {
00232 init_libdxgsg9();
00233 }
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243 void
00244 init_libdxgsg9() {
00245 static bool initialized = false;
00246 if (initialized) {
00247 return;
00248 }
00249 initialized = true;
00250
00251 DXGraphicsStateGuardian9::init_type();
00252 DXTextureContext9::init_type();
00253 DXVertexBufferContext9::init_type();
00254 DXIndexBufferContext9::init_type();
00255 DXOcclusionQueryContext9::init_type();
00256 DXShaderContext9::init_type();
00257 DXGeomMunger9::init_type();
00258
00259 wdxGraphicsPipe9::init_type();
00260 wdxGraphicsWindow9::init_type();
00261 wdxGraphicsBuffer9::init_type();
00262
00263 GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
00264 selection->add_pipe_type(wdxGraphicsPipe9::get_class_type(),
00265 wdxGraphicsPipe9::pipe_constructor);
00266
00267 PandaSystem *ps = PandaSystem::get_global_ptr();
00268 ps->add_system("DirectX9");
00269 }