optimiz3 / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

Deferred context does not render anything #804

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
hello, i'm trying to use multithreaded rendering in dx11, so i started without 
any threads, just make one deferred context, and try to render triangle with it

the code is here https://gist.github.com/998406 
i modifed SlimDX MiniTri sample this way -> make deferred context with

var deferredContext = new DeviceContext(device);

next i bind shader to it and render it

deferredContext.ClearState();
deferredContext.InputAssembler.InputLayout = layout;
deferredContext.InputAssembler.PrimitiveTopology = 
PrimitiveTopology.TriangleList;
deferredContext.InputAssembler.SetVertexBuffers(0, new 
VertexBufferBinding(vertices2, 32, 0));

 for (int i = 0; i < technique.Description.PassCount; ++i){
                              pass.Apply(deferredContext);
                              deferredContext.Draw(3, 0);}

then try to get command list and execute it

CommandList dc_cl = deferredContext.FinishCommandList(false);
device.ImmediateContext.ExecuteCommandList(dc_cl, true);

what i'm expecting to see is 2 triangles but it only render immdeiate context, 
but if i clear screen in deffered context like 
deferredContext.ClearRenderTargetView(renderView, Color.Tomato); my screen now 
in tomato color, but still no triangles

also when i added this deferred context PIX stop working, witch means that i'm 
doing something terrible wrong

Original issue reported on code.google.com by Neonai...@gmail.com on 3 Jun 2011 at 2:57

GoogleCodeExporter commented 8 years ago
Not sure if you fixed this yet, but if you get rid of the ClearState() call and 
then set both FinishCommandList's and ExecuteCommandList's boolean parameters 
to true, you see both triangles on the screen.

I'm not entirely sure why this is the case; I'm not too familiar with the 
multithreading portions of D3D11. You might have to ask on a native forum for 
more information on how that works.

Anyway, this isn't a SlimDX bug, so I'm closing this issue.

Original comment by Mike.Popoloski on 7 Jun 2011 at 4:05