Jump to content
This is not recommended for shared computers
Sign in anonymously
Don't add me to the active users list
Yesterday, 04:55 AM
21 July 2016 - 02:28 PM
It all works like a charm now, thanks.
Also good to know that when moving the d3d11, I need to still approach it like it did initially now.
20 July 2016 - 03:17 PM
A first attempt, basically only setting SysMemPitch didn't do the trick, same values for the source and dest resources:
// create buffer with the right data
inputDesc.Usage = D3D11_USAGE_DEFAULT;
inputDesc.ByteWidth = sizeof(float) * pM * pN;
inputDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
inputDesc.CPUAccessFlags = 0;
inputDesc.StructureByteStride = sizeof(float);
inputDesc.MiscFlags = 0; //D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
float *tempArrayA = new float[pM*pN];
for(int i=0;i<pM*pN;++i) tempArrayA[i] = pPrevSolution[i].y;
vinitDataA.SysMemPitch = sizeof(float) * pM;
vinitDataA.pSysMem = &tempArrayA;
ID3D11Buffer *inputBuffer = NULL;
HR(pDevice->CreateBuffer(&inputDesc, &vinitDataA, &inputBuffer));
This might mean that the particular piece of code isn't doing anything anyway... will dig in deeper.
If there's something else I've messed, please shout it out
Also good to mention, I also get this warning/error with the CopyResource:
D3D11 ERROR: ID3D11DeviceContext::CopyResource: Cannot invoke CopyResource when the Formats of each Resource are not the same or at least castable to each other,
I already figured out that 102400 = 160x160x4, where the texture has 160 width and 160 height and the buffer says '102400' width and '1' height.
Bytes and pixels mixed up ?!?! btw, I'm using DXGI_FORMAT_R32_FLOAT.
20 July 2016 - 10:21 AM
20 July 2016 - 10:19 AM
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC