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

Big Muscle

Member Since 13 Feb 2013
Offline Last Active May 03 2013 03:17 PM
-----

Posts I've Made

In Topic: Resizing primitives in vertex buffer

17 March 2013 - 02:27 PM

Yeah, vertex layout is known. Draw is classic device->Draw. I have no problem to modify the vertex buffer. The only problem is how to correctly and fastly compute the new coordinates (the request is to add 8 pixels to each edge of rendered primitive).


In Topic: Why there is more D3D10/11Device::Draw (and some other functions) implementat...

28 February 2013 - 09:12 AM

 Yes, the old functions come back (as I remember correctly it was something like Draw<0> is executed e.g. 500x, then function was swapped). Weird thing is that it does not happen always. Currently I wanted to track down how often the functions are swapped but it does not occur now :-/

 

However, some time ago, I was using following snippet running as background thread:

 

while(true)
{
   if(device->Draw != myDraw)
      rehook();

   Sleep(xxx);
}

 

it just hooks Draw function still around. If sleep is not used then it works "correctly" (there is still possible race condition but very rare) - but consumes 100% CPU.. When there is Sleep (with > 0 ms) then it does not work, so the functions are swapped very often. Also, it is not something like "if(some_condition_is_true) Draw<0> else Draw<1>", The function pointer is changed directly in the device object's virtual address table.


In Topic: Help with shader disassembling

13 February 2013 - 01:43 PM

so still something wrong, sometimes the value is incorrect.


In Topic: Help with shader disassembling

13 February 2013 - 12:47 PM

Yes! +2 works with correct RGBA offset! thanks!


In Topic: Help with shader disassembling

13 February 2013 - 05:45 AM

I tried to dump that buffer and it seems to be stored there, but not as pure alpha, but rather (1.0 - alpha). The blend state is following if it depends:

 

blendStateDesc.RenderTarget[0].BlendEnable = TRUE
blendStateDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE

blendStateDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA

blendStateDesc.RenderTarget[0].BlendOp =  D3D11_BLEND_OP_ADD

blendStateDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE

blendStateDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA6
blendStateDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD

blendStateDesc.RenderTarget[0].RenderTargetWriteMask = 15

 

Now I need to find the correct index in constant buffer as it is on different position than I computed. I would expect that R-G-B-A has offsets 0-4-8-12, so alpha value is at offset 12. But here it seems to be at 8, so I think I have overlooked something in the shader assembly.


PARTNERS