Merge pull request #580 from andr3wmac/d3d9_shadow_fix

Fix crash in D3D9 shadowmap examples.
This commit is contained in:
Branimir Karadžić 2015-11-22 09:59:49 -08:00
commit 427e08c363
2 changed files with 4 additions and 4 deletions

View file

@ -133,7 +133,7 @@ int _main_(int _argc, char** _argv)
progShadow = loadProgram("vs_sms_shadow", "fs_sms_shadow");
progMesh = loadProgram("vs_sms_mesh", "fs_sms_mesh");
shadowMapTexture = bgfx::createTexture2D(shadowMapSize, shadowMapSize, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_COMPARE_LEQUAL);
shadowMapTexture = bgfx::createTexture2D(shadowMapSize, shadowMapSize, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT | BGFX_TEXTURE_COMPARE_LEQUAL);
bgfx::TextureHandle fbtextures[] = { shadowMapTexture };
shadowMapFB = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
}

View file

@ -1942,7 +1942,7 @@ int _main_(int _argc, char** _argv)
bgfx::TextureHandle fbtextures[] =
{
bgfx::createTexture2D(currentShadowMapSize, currentShadowMapSize, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_RT),
bgfx::createTexture2D(currentShadowMapSize, currentShadowMapSize, 1, bgfx::TextureFormat::D24S8),
bgfx::createTexture2D(currentShadowMapSize, currentShadowMapSize, 1, bgfx::TextureFormat::D24S8, BGFX_TEXTURE_RT),
};
s_rtShadowMap[ii] = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
}
@ -3096,7 +3096,7 @@ int _main_(int _argc, char** _argv)
bgfx::TextureHandle fbtextures[] =
{
bgfx::createTexture2D(currentShadowMapSize, currentShadowMapSize, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_RT),
bgfx::createTexture2D(currentShadowMapSize, currentShadowMapSize, 1, bgfx::TextureFormat::D24S8),
bgfx::createTexture2D(currentShadowMapSize, currentShadowMapSize, 1, bgfx::TextureFormat::D24S8, BGFX_TEXTURE_RT),
};
s_rtShadowMap[0] = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
}
@ -3111,7 +3111,7 @@ int _main_(int _argc, char** _argv)
bgfx::TextureHandle fbtextures[] =
{
bgfx::createTexture2D(currentShadowMapSize, currentShadowMapSize, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_RT),
bgfx::createTexture2D(currentShadowMapSize, currentShadowMapSize, 1, bgfx::TextureFormat::D24S8),
bgfx::createTexture2D(currentShadowMapSize, currentShadowMapSize, 1, bgfx::TextureFormat::D24S8, BGFX_TEXTURE_RT),
};
s_rtShadowMap[ii] = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
}