Re: Returning calculation results from pixel shader



Why don't you create a R32F lockable RT-texture
(your gf6 card should allow that), render to
it, and get it's data back by calling
IDirect3DDevice9::GetRenderTargetData?

But I do... now ;-)
Thanks for the hint. I was not aware of the GetRenderTargetData. It
works just fine now.
If I may; I have a folow up on this. Perhaps I am misunderstanding the
graphicsStream.Read. Currently I am doing this for reading out data.

private void readResult(float[,] errorValues)
device.GetRenderTargetData(renderSurface, readSurface);
GraphicsStream gs = readTexture.LockRectangle(0, LockFlags.ReadOnly);
float[,] tmp = (float[,])gs.Read(typeof(float), new int[] { dataWidth,
dataHeight });

for (int x = 0; x < dataWidth; x++)
for (int y = 0; y < dataHeight; y++)
errorValues[x, y] = tmp[x, y];

It seems rather wastefull to have a loop like that to read data out.
Besides.. have the data not allready been moved once from the gpu to
systemmemory, and now I am moving them from system to system?

.



Relevant Pages

  • Re: Returning calculation results from pixel shader
    ... (your gf6 card should allow that), render to it, and get it's data back by calling ... Jan Bruns ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Capricious Video playback with DShow
    ... If you're using XP and simply calling the IFilterGraph Render method on your ... The default XP renderer (VMR 7) appears to need some set-up that I'm not ... >> I've succeed in playing video into a window using DShow. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: asp.net page template *inheritance)
    ... because Render is an instance method - you were ... calling it by using the class name: 'PageBase'. ... > Imports System.Web.UI ...
    (microsoft.public.dotnet.framework.aspnet)
  • Cakephp & Smarty problem
    ... class SmartyView { ... and problem when calling this method (_render) it always returns white chars but template file is'nt empty ... do i have to set something in cakephp configuration or in php.ini? ...
    (comp.lang.php)
  • Re: Sun killing Solaris?
    ... Now calling me a liar as well, ... and one of the principle reasons customers visit SunSolve." ... Yes, it's a hint. ...
    (comp.unix.solaris)