Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

ucfchuck

Member Since 22 Jul 2008
Offline Last Active Jan 10 2013 11:47 AM
-----

Posts I've Made

In Topic: migrating from dx10 to 11 gives me an undebug-able error

14 December 2012 - 04:00 PM

D3D11: ERROR: ID3D11DeviceContext::DrawIndexed: Draw cannot be invoked while a bound Resource is currently mapped. The Resource bound at Pixel Shader Resource slot (0) is still mapped. [ EXECUTION ERROR #364: DEVICE_DRAW_BOUND_RESOURCE_MAPPED ]

D3D11: ERROR: ID3D11DeviceContext::Draw: Draw cannot be invoked while a bound Resource is currently mapped. The Resource bound at Pixel Shader Resource slot (0) is still mapped. [ EXECUTION ERROR #364: DEVICE_DRAW_BOUND_RESOURCE_MAPPED ]

D3D11: ERROR: ID3D11DeviceContext::DrawIndexed: Draw cannot be invoked while a bound Resource is currently mapped. The Resource bound at Pixel Shader Resource slot (0) is still mapped. [ EXECUTION ERROR #364: DEVICE_DRAW_BOUND_RESOURCE_MAPPED ]

D3D11: CORRUPTION: ID3D11DeviceContext::Unmap: Two threads were found to be executing functions associated with the same Device at the same time. This will cause corruption of memory. Appropriate thread synchronization needs to occur external to the Direct3D API. 2420 and 2432 are the implicated thread ids. [ MISCELLANEOUS CORRUPTION #28: CORRUPTED_MULTITHREADING ]

First-chance exception at 0x75a4c41f in WPControlPanel.exe: 0x0000087D: 0x87d.

D3D11: ERROR: ID3D11DeviceContext::Draw: Draw cannot be invoked while a bound Resource is currently mapped. The Resource bound at Pixel Shader Resource slot (0) is still mapped. [ EXECUTION ERROR #364: DEVICE_DRAW_BOUND_RESOURCE_MAPPED ]


so it is a threading issue. i have a draw function spinning on the main thread and a separate consumer thread trying to pull frames from a usb device as fast as possible which then loads it into the texture. this never was an issue with dx10, it seemed to just wait for one to let go of the resource, seems dx11 does not deal with multiple threads pulling a resource from the device context at the same time. hopefully this is the cause of both exceptions, i think i can just double buffer it into a separate texture and then copyresource on the draw call with a lock to minimize stall time.

In Topic: migrating from dx10 to 11 gives me an undebug-able error

13 December 2012 - 06:56 PM

yes the texture was created with dynamic usage.


no i did not have the debug enabled, but now that i do, i am getting sehexceptions at random places, from the clear render target view, map, write, and unmap,

not in any specific order or consistent place, just literally at random from one of those places. though it is hitting a different exception much faster than it was before. with the debug on i get through about 50-100 frames before it throws the seh exceptions and crashes. weird that it would crash on new exceptions that didnt show up before?

In Topic: migrating from dx10 to 11 gives me an undebug-able error

13 December 2012 - 03:53 PM

ok so im not sure i have really narrowed it down to this point as the try catch block does not catch the exception, but when i do not allow the texture to be written to, then it stops crashing. the map function is as follows,


try

{

// if everything is in order then send data to graphics memory.

if (pTexture != null)

{

DataBox mappedTex = null;

//assign and lock the resource

mappedTex = g_pd3dDevice.ImmediateContext.MapSubresource(pTexture, 0, pTexture.Description.Height * pTexture.Description.Width*4, D3D11.MapMode.WriteDiscard, D3D11.MapFlags.None);

// if unable to hold texture

if (!mappedTex.Data.CanWrite)

{ throw new InvalidOperationException("Cannot Write to the Texture"); }

// write new data to the texture

mappedTex.Data.WriteRange<byte>(NewData);

// unlock the resource

g_pd3dDevice.ImmediateContext.UnmapSubresource(pTexture, 0);

}

}

catch (Exception P)

{

MessageBox.Show("texheight = " + pTexture.Description.Height + " \n" + "texwidth = " + pTexture.Description.Width + "\n" + "data size = " + NewData.Length);

throw;

}




could this be some kind of threading issue with the ImmediateContext ? there was some issue with having to move from a datarectangle to a databox as well.


In Topic: Displaying large images in DX10

20 September 2012 - 10:58 AM

im not very well versed, but first are you using some kind of 10 on 9 cause last i heard (granted it was several years ago) directx10 couldn't run on xp, and second a 256 mb card wont be able to handle a 32bpp 10k x 10k texture at once, you would have to upload and draw in pieces in a semi synchronous way if it were to work at all( like upload and draw a 2500x2500 texture, then change its coordinates and do it again 15 times and then swap the backbuffer?), i think, but again im not well versed enough with that pipeline to know how it allocates storage between textures and output, but once you are through the shaders even a 1080p 32bpp screen is only like 8mB, so i would think it should fit. otherwise i think it is possible to run the shaders in software on the cpu instead of on the gpu, but again i am not sure what xp would do with that.

In Topic: AMD APU 6520g fails on texture map from size

20 September 2012 - 10:34 AM

ok cool i moved texsizefix to a global and plugged this in everywhere i change the dimensions of the texture, to try and minimize the locking time on the texture resource, and it works great.

DataRectangle tempTex = null;
tempTex = pTexture.Map(0, D3D10.MapMode.WriteDiscard, D3D10.MapFlags.None);
pTexture.Unmap(0);
texsizefix = tempTex.Pitch / 4; // div by 4 as the returned value is for r8g8b8a8

thanks guys

PARTNERS