11/*
2- * Copyright (c ) 2018, Intel Corporation
2+ * Copyright (C ) 2018 Intel Corporation
33 *
4- * Permission is hereby granted, free of charge, to any person obtaining a
5- * copy of this software and associated documentation files (the "Software"),
6- * to deal in the Software without restriction, including without limitation
7- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8- * and/or sell copies of the Software, and to permit persons to whom the
9- * Software is furnished to do so, subject to the following conditions:
4+ * SPDX-License-Identifier: MIT
105 *
11- * The above copyright notice and this permission notice shall be included
12- * in all copies or substantial portions of the Software.
13- *
14- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20- * OTHER DEALINGS IN THE SOFTWARE.
216 */
227
238#include " runtime/command_stream/command_stream_receiver.h"
@@ -69,22 +54,22 @@ CommandStreamReceiver::~CommandStreamReceiver() {
6954
7055void CommandStreamReceiver::makeResident (GraphicsAllocation &gfxAllocation) {
7156 auto submissionTaskCount = this ->taskCount + 1 ;
72- if (gfxAllocation.residencyTaskCount < (int )submissionTaskCount) {
57+ if (gfxAllocation.residencyTaskCount [deviceIndex] < (int )submissionTaskCount) {
7358 this ->pushAllocationForResidency (&gfxAllocation);
7459 gfxAllocation.taskCount = submissionTaskCount;
75- if (gfxAllocation.residencyTaskCount == ObjectNotResident) {
60+ if (gfxAllocation.residencyTaskCount [deviceIndex] == ObjectNotResident) {
7661 this ->totalMemoryUsed += gfxAllocation.getUnderlyingBufferSize ();
7762 }
7863 }
79- gfxAllocation.residencyTaskCount = submissionTaskCount;
64+ gfxAllocation.residencyTaskCount [deviceIndex] = submissionTaskCount;
8065}
8166
8267void CommandStreamReceiver::processEviction () {
8368 this ->clearEvictionAllocations ();
8469}
8570
8671void CommandStreamReceiver::makeNonResident (GraphicsAllocation &gfxAllocation) {
87- if (gfxAllocation.residencyTaskCount != ObjectNotResident) {
72+ if (gfxAllocation.residencyTaskCount [deviceIndex] != ObjectNotResident) {
8873 makeCoherent (gfxAllocation);
8974 if (gfxAllocation.peekEvictable ()) {
9075 this ->pushAllocationForEviction (&gfxAllocation);
@@ -93,7 +78,7 @@ void CommandStreamReceiver::makeNonResident(GraphicsAllocation &gfxAllocation) {
9378 }
9479 }
9580
96- gfxAllocation.residencyTaskCount = ObjectNotResident;
81+ gfxAllocation.residencyTaskCount [deviceIndex] = ObjectNotResident;
9782}
9883
9984void CommandStreamReceiver::makeSurfacePackNonResident (ResidencyContainer *allocationsForResidency) {
0 commit comments