Browse Source

Fix an error reported by DirectX in debug mode.
Can't pass 0 for SetSamplerState (..., D3DSAMP_MAXANISOTROPY, ... )

aignacio_sf 20 years ago
parent
commit
680b7878e4
1 changed files with 3 additions and 1 deletions
  1. 3 1
      panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

+ 3 - 1
panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

@@ -244,7 +244,9 @@ apply_texture(int i, TextureContext *tc) {
   uint aniso_degree = tex->get_anisotropic_degree();
   uint aniso_degree = tex->get_anisotropic_degree();
   Texture::FilterType ft = tex->get_magfilter();
   Texture::FilterType ft = tex->get_magfilter();
 
 
-  _d3d_device->SetSamplerState(i, D3DSAMP_MAXANISOTROPY, aniso_degree);
+  if (aniso_degree >= 1) {
+    _d3d_device->SetSamplerState(i, D3DSAMP_MAXANISOTROPY, aniso_degree);
+  }
 
 
   D3DTEXTUREFILTERTYPE new_mag_filter;
   D3DTEXTUREFILTERTYPE new_mag_filter;
   if (aniso_degree <= 1) {
   if (aniso_degree <= 1) {