Skip to content

Commit

Permalink
Merge branch 'dev/lvengesanam/implement_missing_texture_apis' into 'm…
Browse files Browse the repository at this point in the history
…ain'

Implement APIs that updates texture data

See merge request lightspeedrtx/bridge-remix-nv!138
  • Loading branch information
lvengesanam committed Jan 16, 2025
2 parents 7c3687b + 8f68888 commit 7c58986
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/client/d3d9_cubetexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,13 @@ HRESULT Direct3DCubeTexture9_LSS::UnlockRect(D3DCUBEMAP_FACES FaceType, UINT Lev

HRESULT Direct3DCubeTexture9_LSS::AddDirtyRect(D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect) {
LogFunctionCall();

UID currentUID = 0;
{
ClientMessage c(Commands::IDirect3DCubeTexture9_AddDirtyRect, getId());
currentUID = c.get_uid();
c.send_data(FaceType);
c.send_data(sizeof(RECT), (void*) pDirtyRect);
}
return S_OK;
WAIT_FOR_OPTIONAL_SERVER_RESPONSE("AddDirtyRect()", D3DERR_INVALIDCALL, currentUID);
}
5 changes: 4 additions & 1 deletion src/client/d3d9_volumetexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ HRESULT Direct3DVolumeTexture9_LSS::UnlockBox(UINT Level) {

HRESULT Direct3DVolumeTexture9_LSS::AddDirtyBox(CONST D3DBOX* pDirtyBox) {
LogFunctionCall();

UID currentUID = 0;
{
ClientMessage c(Commands::IDirect3DVolumeTexture9_AddDirtyBox, getId());
currentUID = c.get_uid();
c.send_data(sizeof(D3DBOX), (void*) pDirtyBox);
}
return S_OK;
WAIT_FOR_OPTIONAL_SERVER_RESPONSE("AddDirtyBox()", D3DERR_INVALIDCALL, currentUID);
}
18 changes: 18 additions & 0 deletions src/server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,16 @@ void ProcessDeviceCommandQueue() {
break;
}
case IDirect3DVolumeTexture9_AddDirtyBox:
{
GET_HND(pHandle);
PULL_U(Level);
PULL_OBJ(D3DBOX, pBox);
const auto& pVolumeTexture = (IDirect3DVolumeTexture9*) gpD3DResources[pHandle];
const auto hresult = pVolumeTexture->AddDirtyBox(IN pBox);
SEND_OPTIONAL_SERVER_RESPONSE(hresult, currentUID);
assert(SUCCEEDED(hresult));
break;
}

/*
* IDirect3DCubeTexture9 interface
Expand Down Expand Up @@ -2293,7 +2302,16 @@ void ProcessDeviceCommandQueue() {
break;
}
case IDirect3DCubeTexture9_AddDirtyRect:
{
GET_HND(pCubeTextureHandle);
PULL(D3DCUBEMAP_FACES, FaceType);
PULL_OBJ(RECT, pDirtyRect);
const auto& pCubeTexture = (IDirect3DCubeTexture9*) gpD3DResources[pCubeTextureHandle];
const auto hresult = pCubeTexture->AddDirtyRect(IN FaceType, IN pDirtyRect);
SEND_OPTIONAL_SERVER_RESPONSE(hresult, currentUID);
assert(SUCCEEDED(hresult));
break;
}

/*
* IDirect3DVertexBuffer9 interface
Expand Down

0 comments on commit 7c58986

Please sign in to comment.