Lock() Texture bug due to video card limitation to 256*256 ?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

How does your code look like now?
3dsolar
Posts: 15
Joined: Wed Feb 06, 2008 9:36 am
Contact:

Post by 3dsolar »

We believe its linked to DirectX level we assume Irrlicht use level 0 in DurectX so we try now on OpenGL but we have another problem our function drawAll() do not work anymore under OpenGL init well but do not render maybe a problem of thread.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, show us the code. As much as possible.
3dsolar
Posts: 15
Joined: Wed Feb 06, 2008 9:36 am
Contact:

Post by 3dsolar »

can we send it to you privately first ? and then post solution to the forum ?
can we exchange by ICQ and email ?
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

<offtopic>
Well not truly offtopic, but anyways. The lock() "problem" shouldn't effect the program if you are using OpenGL since you don't really have to lock() a texture, and it just returns a pointer to the texture.
TheQuestion = 2B || !2B
3dsolar
Posts: 15
Joined: Wed Feb 06, 2008 9:36 am
Contact:

Why in irrlicht 1.3-1.4 function lock() use only 0 level

Post by 3dsolar »

Why in irrlicht 1.3-1.4 function lock() use only 0 level (first parametr in LockRect in DirectX mode) this could be the reason why we cant lock a texture of 512*512 with some wideo cards.

//! lock function
void* CD3D9Texture::lock()
{
if (!Texture)
return 0;

HRESULT hr;
D3DLOCKED_RECT rect;
if(!IsRenderTarget)
{
hr = Texture->LockRect(0, &rect, 0, 0);
}
else
{
D3DSURFACE_DESC desc;
Texture->GetLevelDesc(0, &desc);

...
...
...

}

if (FAILED(hr))
{
os:rinter::log("Could not lock DIRECT3D9 Texture.", ELL_ERROR);
return 0;
}

return rect.pBits;
}
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Because the main texture is to be read and/or changed? I think that level 0 is the texture from which the mipmaps are generated (and stored in higher levels). But in this case the high detail texture is locked and accessed. This behavior has been this way for a very long time and seems to be reasonable.
3dsolar
Posts: 15
Joined: Wed Feb 06, 2008 9:36 am
Contact:

Post by 3dsolar »

Yes read and changed we send a video feed to irrlicht to add 3d object to it and read it back.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, but the thing is that this call should be correct for this purpose.
How do you create the texture?
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Compile a debug version of your app. Follow the instructions in the DXSDK docs for enabling D3D Debug, go to DX control panel and enable D3D debug libs, crank the debug level up to max-1 and look at the debug output.
Post Reply