Skip to content

Commit

Permalink
revert dx11SH_Texture.cpp changes, fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
olefirenque committed Feb 3, 2024
1 parent 6f1c24d commit 95534b8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
24 changes: 15 additions & 9 deletions src/Layers/xrRenderDX11/dx11SH_Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,23 @@ void CTexture::surface_set(ID3DBaseTexture* surf)
_RELEASE(srv_all);
CHK_DX(HW.pDevice->CreateShaderResourceView(pSurface, &ViewDesc, &srv_all));

if (desc.SampleDesc.Count <= 1)
ViewDesc.Texture2DArray.ArraySize = desc.ArraySize;
else
ViewDesc.Texture2DMSArray.ArraySize = desc.ArraySize;

srv_per_slice.resize(desc.ArraySize);
for (auto &x : srv_per_slice)
_RELEASE(x);

CHK_DX(HW.pDevice->CreateShaderResourceView(pSurface, &ViewDesc, srv_per_slice.data()));
for (u32 id = 0; id < desc.ArraySize; ++id)
{
_RELEASE(srv_per_slice[id]);

if (desc.SampleDesc.Count <= 1)
{
ViewDesc.Texture2DArray.ArraySize = 1;
ViewDesc.Texture2DArray.FirstArraySlice = id;
}
else
{
ViewDesc.Texture2DMSArray.ArraySize = 1;
ViewDesc.Texture2DMSArray.FirstArraySlice = id;
}
CHK_DX(HW.pDevice->CreateShaderResourceView(pSurface, &ViewDesc, &srv_per_slice[id]));
}
set_slice(-1);
}
else
Expand Down
6 changes: 3 additions & 3 deletions src/xrGame/cover_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void CCoverManager::compute_static_cover()
{
clear();
xr_delete(m_covers);

const CLevelGraph& graph = ai().level_graph();
const LevelGraph::CHeader& levelGraphHeader = graph.header();
const u32 levelVertexCount = levelGraphHeader.vertex_count();
Expand All @@ -85,7 +85,7 @@ void CCoverManager::compute_static_cover()
static xr_vector<std::optional<CCoverPoint>> quadTreeStaticStorage;
quadTreeStaticStorage.resize(levelVertexCount);
m_temp.resize(levelVertexCount);

xr_parallel_for(TaskRange<u32>(0, levelVertexCount), [&](const TaskRange<u32>& range)
{
for (u32 i = range.begin(); i != range.end(); ++i)
Expand All @@ -96,7 +96,7 @@ void CCoverManager::compute_static_cover()
const CLevelGraph::CLevelVertex& vertex = *graph.vertex(i);
const int highCover = vertex.high_cover(0) + vertex.high_cover(1) + vertex.high_cover(2) + vertex.high_cover(3);
const int lowCover = vertex.low_cover(0) + vertex.low_cover(1) + vertex.low_cover(2) + vertex.low_cover(3);

if (highCover || lowCover)
{
m_temp[i] = edge_vertex(i);
Expand Down

0 comments on commit 95534b8

Please sign in to comment.