On Sun, Sep 26, 2010 at 12:41 PM, Stefan Dösinger <stefandoesin...@gmx.at> wrote: > > Am 26.09.2010 um 19:51 schrieb Travis Athougies: > >> + data = compute_shader_fullscreen9(device, vshader_passthru, >> pshader, quad_geometry, >> + D3DFMT_A8R8G8B8, 1, 1); >> + >> + ok(data[0] == D3DCOLOR_ARGB(0, 0, 255, 255), >> + "swizzle_test: Got color %08x (should be 0x0000FFFF)\n", >> data[0]); > You leak the returned data here. >
Ok woops. Can't believe I missed that > On the big picture of this, I don't like the void * blob returned from > compute_shader_fullscreen. As far as I can see the only position dependent > aspect of HLSL is vpos(or rather, the HLSL equivalent). For all others it > would be OK to return a ARGB color. > The reason why I don't return just one value here is (a) because the data might either be in DWORD or float format and (b) some tests use more than just 1 pixel, so they need access to all their pixels. >> + /* The Direct3D 9 docs state that we cannot lock a render target >> surface, >> + instead we must copy the render target onto this surface to lock it >> */ > I think you can, if you create it with D3DUSAGE_DYNAMIC | > D3DUSAGE_RENDERTARGET. If you want the backbuffer to be lockable you'll need > some device creation flag whose name I forgot. There is the lockable boolean argument that I think might work. I will look into using this On Sun, Sep 26, 2010 at 12:41 PM, Stefan Dösinger <stefandoesin...@gmx.at> wrote: > > Am 26.09.2010 um 19:51 schrieb Travis Athougies: > >> + data = compute_shader_fullscreen9(device, vshader_passthru, >> pshader, quad_geometry, >> + D3DFMT_A8R8G8B8, 1, 1); >> + >> + ok(data[0] == D3DCOLOR_ARGB(0, 0, 255, 255), >> + "swizzle_test: Got color %08x (should be 0x0000FFFF)\n", >> data[0]); > You leak the returned data here. > > On the big picture of this, I don't like the void * blob returned from > compute_shader_fullscreen. As far as I can see the only position dependent > aspect of HLSL is vpos(or rather, the HLSL equivalent). For all others it > would be OK to return a ARGB color. > >> + /* The Direct3D 9 docs state that we cannot lock a render target >> surface, >> + instead we must copy the render target onto this surface to lock it >> */ > I think you can, if you create it with D3DUSAGE_DYNAMIC | > D3DUSAGE_RENDERTARGET. If you want the backbuffer to be lockable you'll need > some device creation flag whose name I forgot. > > > > -- Travis Athougies