Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why receiving textures done with CPU copying? #50

Open
microdee opened this issue Sep 18, 2019 · 0 comments
Open

Why receiving textures done with CPU copying? #50

microdee opened this issue Sep 18, 2019 · 0 comments

Comments

@microdee
Copy link

microdee commented Sep 18, 2019

I'm talking about this line:

RHIUpdateTexture2D(Params->Texture2DResource->GetTexture2DRHI(), 0, *Params->UpdateRegions, mapped.RowPitch, (uint8*)pixel);
and
HRESULT hr = g_pImmediateContext->Map(t_texTemp, 0, D3D11_MAP_READ, 0, &mapped);
and
description.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE;

Doing this defeats the purpose of Spout in the first place. Is there any reason why not just copy resource like this:?

ID3D11Texture2D* t_dst = (ID3D11Texture2D*)SenderStruct->Texture2DResource->GetTexture2DRHI()->GetNativeResource();
g_pImmediateContext->CopyResource(t_dst, t_texTemp);

and then call it a day? I'm not sure if texTemp is even necessary anymore if we don't do staging and CPU access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant