I'm working on getting QtWebkit working with the development branch of Torque3D. The webkit code works by drawing to a texture that can then be rendered on an object in game. I'm currently having problems getting the render to texture working. This is the code that is creating the textures: mTextureObjectA.set(mTexSize, mTexSize, GFXFormatR8G8B8X8, &GFXDynamicTextureProfile, avar("%s() - (line %d)", __FUNCTION__, __LINE__), 0); // was GFXDefaultStaticDiffuseProfile
mTextureObjectB.set(mTexSize, mTexSize, GFXFormatR8G8B8X8, &GFXDynamicTextureProfile, avar("%s() - (line %d)", __FUNCTION__, __LINE__), 0); // was GFXDefaultStaticDiffuseProfile The previous working webkit code used 'GFXDefaultStaticDiffuseProfile', which has been renamed in development to'GFXStaticTextureProfile'. However when I try to use that I get a crash when the code tries to lock the texture. Locking the texture calls ID3D11DeviceContext::Map, which throws this error: D3D11 ERROR: ID3D11DeviceContext::Map: Map cannot be called with MAP_WRITE_DISCARD access, because the Resource was not created with the D3D11_CPU_ACCESS_WRITE flag. [ RESOURCE_MANIPULATION ERROR #2097210: RESOURCE_MAP_INVALIDMAPTYPE]
D:\Torque\Torque3D\Engine\source\gfx\D3D11\gfxD3D11TextureObject.cpp(114,0): {Fatal} - GFXD3D11TextureObject::lock - Failed to map subresource. Having had a look through the D3D11 documentation I think I need the texture to be dynamic since webkit will be updating it. Hence why I've updated the texture profile to GFXDynamicTextureProfile. In GFXD3D11TextureManager::_innerCreateTexture() I'm now getting these errors when the texture is created: This is the D3D11_TEXTURE3D_DESC that has been created: