-
Notifications
You must be signed in to change notification settings - Fork 93
/
Copy pathGmmResourceInfo.cpp
1771 lines (1608 loc) · 75 KB
/
GmmResourceInfo.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*==============================================================================
Copyright(c) 2017 Intel Corporation
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files(the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and / or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
============================================================================*/
#include "Internal/Common/GmmLibInc.h"
#include <stdlib.h>
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmResourceInfoCommon::Create.
/// @see GmmLib::GmmResourceInfoCommon::Create()
///
/// @param[in] pCreateParams: Flags which specify what sort of resource to create
/// @return Pointer to GmmResourceInfo class.
/////////////////////////////////////////////////////////////////////////////////////
GMM_RESOURCE_INFO *GMM_STDCALL GmmResCreate(GMM_RESCREATE_PARAMS *pCreateParams, GMM_LIB_CONTEXT *pLibContext)
{
GMM_RESOURCE_INFO *pRes = NULL;
#if(!defined(__GMM_KMD__) && !defined(GMM_UNIFIED_LIB))
pRes = GmmResCreateThroughClientCtxt(pCreateParams);
return pRes;
#else
// GMM_RESOURCE_INFO...
if(pCreateParams->pPreallocatedResInfo)
{
pRes = new(pCreateParams->pPreallocatedResInfo) GmmLib::GmmResourceInfo(); // Use preallocated memory as a class
pCreateParams->Flags.Info.__PreallocatedResInfo =
pRes->GetResFlags().Info.__PreallocatedResInfo = 1; // Set both in case we can die before copying over the flags.
}
else
{
if((pRes = new GMM_RESOURCE_INFO) == NULL)
{
GMM_ASSERTDPF(0, "Allocation failed!");
goto ERROR_CASE;
}
}
if(pRes->Create(*pLibContext, *pCreateParams) != GMM_SUCCESS)
{
goto ERROR_CASE;
}
return (pRes);
ERROR_CASE:
if(pRes)
{
GmmResFree(pRes);
}
GMM_DPF_EXIT;
return (NULL);
#endif
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmResourceInfoCommon::opeartor=. Allocates a new class and
/// returns a pointer to it. The new class must be free'd explicitly by the client.
///
/// @see GmmLib::GmmResourceInfoCommon::operator=()
///
/// @param[in] pRes: Pointer to the GmmResourceInfo class that needs to be copied
/// @return Pointer to newly copied GmmResourceInfo class
/////////////////////////////////////////////////////////////////////////////////////
GMM_RESOURCE_INFO *GMM_STDCALL GmmResCopy(GMM_RESOURCE_INFO *pRes)
{
GMM_RESOURCE_INFO *pResCopy = NULL;
GMM_DPF_ENTER;
__GMM_ASSERTPTR(pRes, NULL);
#if(!defined(__GMM_KMD__) && !defined(GMM_UNIFIED_LIB))
pResCopy = GmmResCopyThroughClientCtxt(pRes);
return pResCopy;
#else
pResCopy = new GMM_RESOURCE_INFO;
if(!pResCopy)
{
GMM_ASSERTDPF(0, "Allocation failed.");
return NULL;
}
*pResCopy = *pRes;
// We are allocating new class, flag must be false to avoid leak at DestroyResource
pResCopy->GetResFlags().Info.__PreallocatedResInfo = 0;
GMM_DPF_EXIT;
return (pResCopy);
#endif
}
/////////////////////////////////////////////////////////////////////////////////////
/// Helps clients copy one GmmResourceInfo object to another
///
/// @param[in] pDst: Pointer to memory when pSrc will be copied.
/// @param[in] pSrc: Pointer to GmmResourceInfo class that needs to be copied
/////////////////////////////////////////////////////////////////////////////////////
void GMM_STDCALL GmmResMemcpy(void *pDst, void *pSrc)
{
#if(!defined(__GMM_KMD__) && !defined(GMM_UNIFIED_LIB))
GmmResMemcpyThroughClientCtxt(pDst, pSrc);
#else
GMM_RESOURCE_INFO *pResSrc = reinterpret_cast<GMM_RESOURCE_INFO *>(pSrc);
// Init memory correctly, in case the pointer is a raw memory pointer
GMM_RESOURCE_INFO *pResDst = new(pDst) GMM_RESOURCE_INFO();
*pResDst = *pResSrc;
#endif
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for ~GmmResourceInfoCommon. Frees the resource if it wasn't part of
/// ::GMM_RESCREATE_PARAMS::pPreallocatedResInfo.
/// @see GmmLib::GmmResourceInfoCommon::~GmmResourceInfoCommon()
///
/// @param[in] pRes: Pointer to the GmmResourceInfo class that needs to be freed
/////////////////////////////////////////////////////////////////////////////////////
void GMM_STDCALL GmmResFree(GMM_RESOURCE_INFO *pRes)
{
GMM_DPF_ENTER;
__GMM_ASSERTPTR(pRes, VOIDRETURN);
#if(!defined(__GMM_KMD__) && !defined(GMM_UNIFIED_LIB))
GmmResFreeThroughClientCtxt(pRes);
#else
if(pRes->GetResFlags().Info.__PreallocatedResInfo)
{
*pRes = GmmLib::GmmResourceInfo();
}
else
{
delete pRes;
pRes = NULL;
}
#endif
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetSystemMemPointer.
/// @see GmmLib::GmmResourceInfoCommon::GetSystemMemPointer()
///
/// @param[in] pRes: Pointer to the GmmResourceInfo class
/// @param[in] IsD3DDdiAllocation: Specifies where allocation was made by a D3D client
/// @return Pointer to system memory. NULL if not available.
/////////////////////////////////////////////////////////////////////////////////////
void *GMM_STDCALL GmmResGetSystemMemPointer(GMM_RESOURCE_INFO *pRes,
uint8_t IsD3DDdiAllocation)
{
GMM_DPF_ENTER;
__GMM_ASSERTPTR(pRes, NULL);
return pRes->GetSystemMemPointer(IsD3DDdiAllocation);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetSystemMemSize.
/// @see GmmLib::GmmResourceInfoCommon::GetSystemMemSize()
///
/// @param[in] pRes: Pointer to the GmmResourceInfo class
/// @return Size of memory.
/////////////////////////////////////////////////////////////////////////////////////
GMM_GFX_SIZE_T GMM_STDCALL GmmResGetSystemMemSize(GMM_RESOURCE_INFO *pRes)
{
__GMM_ASSERTPTR(pRes, ((GMM_GFX_SIZE_T)0));
return pRes->GetSystemMemSize();
}
/////////////////////////////////////////////////////////////////////////////////////
/// This function returns size of GMM_RESOURCE_INFO
///
/// @return size of class
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetSizeOfStruct(void)
{
return (sizeof(GMM_RESOURCE_INFO));
}
/////////////////////////////////////////////////////////////////////////////////////
/// This function returns resource flags
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[out] pFlags: Memory where resource flags will be copied
/////////////////////////////////////////////////////////////////////////////////////
void GMM_STDCALL GmmResGetFlags(GMM_RESOURCE_INFO *pGmmResource,
GMM_RESOURCE_FLAG *pFlags /*output*/)
{
GMM_DPF_ENTER;
__GMM_ASSERTPTR(pGmmResource, VOIDRETURN);
__GMM_ASSERTPTR(pFlags, VOIDRETURN);
*pFlags = GmmResGetResourceFlags(pGmmResource);
GMM_DPF_EXIT;
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetResourceType.
/// @see GmmLib::GmmResourceInfoCommon::GetResourceType()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Resource Type
/////////////////////////////////////////////////////////////////////////////////////
GMM_RESOURCE_TYPE GMM_STDCALL GmmResGetResourceType(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, RESOURCE_INVALID);
return pGmmResource->GetResourceType();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetResourceFormat.
/// @see GmmLib::GmmResourceInfoCommon::GetResourceFormat()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Resource Format
/////////////////////////////////////////////////////////////////////////////////////
GMM_RESOURCE_FORMAT GMM_STDCALL GmmResGetResourceFormat(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, GMM_FORMAT_INVALID);
return pGmmResource->GetResourceFormat();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetPaddedWidth.
/// @see GmmLib::GmmResourceInfoCommon::GetPaddedWidth()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[in] MipLevel: Requested mip level
/// @return Padded Width
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetPaddedWidth(GMM_RESOURCE_INFO *pGmmResource,
uint32_t MipLevel)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetPaddedWidth(MipLevel);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetPaddedHeight.
/// @see GmmLib::GmmResourceInfoCommon::GetPaddedHeight()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[in] MipLevel: Requested mip level
/// @return Padded Height
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetPaddedHeight(GMM_RESOURCE_INFO *pGmmResource,
uint32_t MipLevel)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetPaddedHeight(MipLevel);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetPaddedPitch.
/// @see GmmLib::GmmResourceInfoCommon::GetPaddedPitch()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[in] MipLevel: Requested mip level
/// @return Padded Pitch
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetPaddedPitch(GMM_RESOURCE_INFO *pGmmResource,
uint32_t MipLevel)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetPaddedPitch(MipLevel);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetBaseWidth. Truncates width to
/// 32-bit.
/// @see GmmLib::GmmResourceInfoCommon::GetBaseWidth()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Width
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetBaseWidth(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return GFX_ULONG_CAST(pGmmResource->GetBaseWidth());
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetBaseWidth.
/// @see GmmLib::GmmResourceInfoCommon::GetBaseWidth()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Width
/////////////////////////////////////////////////////////////////////////////////////
GMM_GFX_SIZE_T GMM_STDCALL GmmResGetBaseWidth64(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetBaseWidth();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetBaseAlignment.
/// @see GmmLib::GmmResourceInfoCommon::GetBaseAlignment()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Base Alignment
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetBaseAlignment(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetBaseAlignment();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetBaseHeight.
/// @see GmmLib::GmmResourceInfoCommon::GetBaseHeight()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Height
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetBaseHeight(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetBaseHeight();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GmmResGetDepth.
/// @see GmmLib::GmmResourceInfoCommon::GmmResGetDepth()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Depth
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetDepth(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetBaseDepth();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetMaxLod.
/// @see GmmLib::GmmResourceInfoCommon::GetMaxLod()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Max Lod
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetMaxLod(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetMaxLod();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetMipTailStartLod.SurfaceState
/// @see GmmLib::GmmResourceInfoCommon::GetMipTailStartLodSurfaceState()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Mip Tail Starts
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetSurfaceStateMipTailStartLod(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERT(pGmmResource);
return pGmmResource->GetMipTailStartLodSurfaceState();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetTileAddressMappingMode.SurfaceState
/// @see GmmLib::GmmResourceInfoCommon::GetTileAddressMappingModeSurfaceState()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Tile Address Mapping Mode
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetSurfaceStateTileAddressMappingMode(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERT(pGmmResource);
return pGmmResource->GetTileAddressMappingModeSurfaceState();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetStdTilingModeExt.SurfaceState
/// @see GmmLib::GmmResourceInfoCommon::GetStdTilingModeExtSurfaceState()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Std Tiling Mode Ext
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetSurfaceStateStdTilingModeExt(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, GMM_INVALIDPARAM);
return pGmmResource->GetStdTilingModeExtSurfaceState();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetArraySize.
/// @see GmmLib::GmmResourceInfoCommon::GetArraySize()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Array Size
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetArraySize(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetArraySize();
}
#if(LHDM)
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetRefreshRate.
/// @see GmmLib::GmmResourceInfoCommon::GetRefreshRate()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Refresh rate
/////////////////////////////////////////////////////////////////////////////////////
D3DDDI_RATIONAL GMM_STDCALL GmmResGetRefreshRate(GMM_RESOURCE_INFO *pGmmResource)
{
D3DDDI_RATIONAL RetVal = {0};
__GMM_ASSERTPTR(pGmmResource, RetVal);
return pGmmResource->GetRefreshRate();
}
#endif // LHDM
#if(LHDM)
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoWin::GetD3d9Flags.
/// @see GmmLib::GmmResourceInfoWin::GetD3d9Flags()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[out] pD3d9Flags: Mscaps data is copied to this param
/////////////////////////////////////////////////////////////////////////////////////
void GMM_STDCALL GmmResGetD3d9Flags(GMM_RESOURCE_INFO * pGmmResource,
D3DDDI_RESOURCEFLAGS *pD3d9Flags)
{
__GMM_ASSERTPTR(pGmmResource, VOIDRETURN);
__GMM_ASSERTPTR(pD3d9Flags, VOIDRETURN);
*pD3d9Flags = pGmmResource->GetD3d9Flags();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoWin::GetD3d9Format.
/// @see GmmLib::GmmResourceInfoWin::GetD3d9Format()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return D3d9 format for the resource
/////////////////////////////////////////////////////////////////////////////////////
D3DDDIFORMAT GMM_STDCALL GmmResGetD3d9Format(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, (D3DDDIFORMAT)0);
return pGmmResource->GetD3d9Format();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoWin::GetVidSourceId.
/// @see GmmLib::GmmResourceInfoWin::GetVidSourceId()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Source Id
/////////////////////////////////////////////////////////////////////////////////////
D3DDDI_VIDEO_PRESENT_SOURCE_ID GMM_STDCALL GmmResGetVidSourceId(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetVidSourceId();
}
#endif // LHDM
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoWin::Is64KBPageSuitable.
/// @see GmmLib::GmmResourceInfoWin::Is64KBPageSuitable()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return 1/0
/////////////////////////////////////////////////////////////////////////////////////
uint8_t GMM_STDCALL GmmResIs64KBPageSuitable(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->Is64KBPageSuitable();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetRotateInfo.
/// @see GmmLib::GmmResourceInfoCommon::GetRotateInfo()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return rotation info
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetRotateInfo(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetRotateInfo();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetAuxQPitch.
/// @see GmmLib::GmmResourceInfoCommon::GetAuxQPitch()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Aux QPitch
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetAuxQPitch(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetAuxQPitch();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetQPitch.
/// @see GmmLib::GmmResourceInfoCommon::GetQPitch()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return QPitch
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetQPitch(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetQPitch();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetQPitchPlanar.
/// @see GmmLib::GmmResourceInfoCommon::GetQPitchPlanar()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Planar QPitch
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetQPitchPlanar(GMM_RESOURCE_INFO *pGmmResource, GMM_YUV_PLANE Plane)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetQPitchPlanar(Plane);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetQPitchInBytes.
/// @see GmmLib::GmmResourceInfoCommon::GetQPitchInBytes()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return QPitch
/////////////////////////////////////////////////////////////////////////////////////
GMM_GFX_SIZE_T GMM_STDCALL GmmResGetQPitchInBytes(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERT(pGmmResource);
return pGmmResource->GetQPitchInBytes();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetRenderPitch.
/// @see GmmLib::GmmResourceInfoCommon::GetRenderPitch()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Pitch
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetRenderPitch(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return GFX_ULONG_CAST(pGmmResource->GetRenderPitch());
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetRenderPitchTiles.
/// @see GmmLib::GmmResourceInfoCommon::GetRenderPitchTiles()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Pitch in tiles
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetRenderPitchTiles(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetRenderPitchTiles();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetRenderAuxPitchTiles.
/// @see GmmLib::GmmResourceInfoCommon::GetRenderAuxPitchTiles()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Aux Pitch in tiles
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetRenderAuxPitchTiles(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetRenderAuxPitchTiles();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetUnifiedAuxPitch.
/// @see GmmLib::GmmResourceInfoCommon::GetUnifiedAuxPitch()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Aux Pitch
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetAuxPitch(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return GFX_ULONG_CAST(pGmmResource->GetUnifiedAuxPitch());
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetBitsPerPixel.
/// @see GmmLib::GmmResourceInfoCommon::GetBitsPerPixel()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return bpp
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetBitsPerPixel(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetBitsPerPixel();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetUnifiedAuxBitsPerPixel.
/// @see GmmLib::GmmResourceInfoCommon::GetUnifiedAuxBitsPerPixel()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return bpp
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetAuxBitsPerPixel(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetUnifiedAuxBitsPerPixel();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetCompressionBlockXxx.
/// @see GmmLib::GmmResourceInfoCommon::GetCompressionBlockWidth()
/// @see GmmLib::GmmResourceInfoCommon::GetCompressionBlockHeight()
/// @see GmmLib::GmmResourceInfoCommon::GetCompressionBlockDepth()
///
/// @param[in] pRes: Pointer to the GmmResourceInfo class
/// @return Compression Block Width/Height/Depth
/////////////////////////////////////////////////////////////////////////////////////
#define GmmResGetCompressionBlockXxx(Xxx) \
uint32_t GMM_STDCALL GmmResGetCompressionBlock##Xxx(GMM_RESOURCE_INFO *pGmmResource) \
{ \
__GMM_ASSERTPTR(pGmmResource, 1); \
return pGmmResource->GetCompressionBlock##Xxx(); \
} ///////////////////////////////////////////////////////
GmmResGetCompressionBlockXxx(Width)
GmmResGetCompressionBlockXxx(Height)
GmmResGetCompressionBlockXxx(Depth)
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetUnifiedAuxBitsPerPixel.
/// @see GmmLib::GmmResourceInfoCommon::GetUnifiedAuxBitsPerPixel()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[in][out] pReqInfo: Has info about which offset client is requesting. Offset is also
/// passed back to the client in this parameter.
/// @return ::GMM_STATUS
/////////////////////////////////////////////////////////////////////////////////////
GMM_STATUS GMM_STDCALL GmmResGetOffset(GMM_RESOURCE_INFO * pGmmResource,
GMM_REQ_OFFSET_INFO *pReqInfo)
{
__GMM_ASSERTPTR(pGmmResource, GMM_ERROR);
__GMM_ASSERTPTR(pReqInfo, GMM_ERROR);
return pGmmResource->GetOffset(*pReqInfo);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetTextureLayout.
/// @see GmmLib::GmmResourceInfoCommon::GetTextureLayout()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return GMM_2D_LAYOUT_RIGHT or GMM_2D_LAYOUT_BELOW
/////////////////////////////////////////////////////////////////////////////////////
GMM_TEXTURE_LAYOUT GMM_STDCALL GmmResGetTextureLayout(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERT(pGmmResource);
return pGmmResource->GetTextureLayout();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetTileType.
/// @see GmmLib::GmmResourceInfoCommon::GetTileType()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return ::GMM_TILE_TYPE
/////////////////////////////////////////////////////////////////////////////////////
GMM_TILE_TYPE GMM_STDCALL GmmResGetTileType(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERT(pGmmResource);
return pGmmResource->GetTileType();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetMipHeight.
/// @see GmmLib::GmmResourceInfoCommon::GetMipHeight()
///
/// @param[in] pResourceInfo: Pointer to the GmmResourceInfo class
/// @param[in] MipLevel: Mip level for which the info is needed
/// @return Mip Height
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetMipHeight(GMM_RESOURCE_INFO *pResourceInfo, uint32_t MipLevel)
{
return pResourceInfo->GetMipHeight(MipLevel);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetMipWidth.
/// @see GmmLib::GmmResourceInfoCommon::GetMipWidth()
///
/// @param[in] pResourceInfo: Pointer to the GmmResourceInfo class
/// @param[in] MipLevel: Mip level for which the info is needed
/// @return Mip Width
/////////////////////////////////////////////////////////////////////////////////////
GMM_GFX_SIZE_T GMM_STDCALL GmmResGetMipWidth(GMM_RESOURCE_INFO *pResourceInfo, uint32_t MipLevel)
{
return pResourceInfo->GetMipWidth(MipLevel);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetMipDepth.
/// @see GmmLib::GmmResourceInfoCommon::GetMipDepth()
///
/// @param[in] pResourceInfo: Pointer to the GmmResourceInfo class
/// @param[in] MipLevel: Mip level for which the info is needed
/// @return Mip Depth
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetMipDepth(GMM_RESOURCE_INFO *pResourceInfo, uint32_t MipLevel)
{
return pResourceInfo->GetMipDepth(MipLevel);
}
//=============================================================================
//
// Function:GmmResGetCornerTexelMode
//
// Desc:
// Simple getter function to return the Corner Texel Mode of a surface.
//
// Parameters:
// pGmmResource: ==> A previously allocated resource.
//
// Returns:
// CornerTexelMode flag ==> uint8_t
//-----------------------------------------------------------------------------
uint8_t GMM_STDCALL GmmResGetCornerTexelMode(GMM_RESOURCE_INFO *pGmmResource)
{
GMM_DPF_ENTER;
__GMM_ASSERT(pGmmResource);
return ((pGmmResource->GetResFlags().Info.CornerTexelMode) ? 1 : 0);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetCpuCacheType.
/// @see GmmLib::GmmResourceInfoCommon::GetCpuCacheType()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return ::GMM_CPU_CACHE_TYPE
/////////////////////////////////////////////////////////////////////////////////////
GMM_CPU_CACHE_TYPE GMM_STDCALL GmmResGetCpuCacheType(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERT(pGmmResource);
return pGmmResource->GetCpuCacheType();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetMmcMode.
/// @see GmmLib::GmmResourceInfoCommon::GetMmcMode()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[in] ArrayIndex: ArrayIndex for which this info is needed
/// @return Media Memory Compression Mode (Disabled, Horizontal, Vertical)
/////////////////////////////////////////////////////////////////////////////////////
GMM_RESOURCE_MMC_INFO GMM_STDCALL GmmResGetMmcMode(GMM_RESOURCE_INFO *pGmmResource, uint32_t ArrayIndex)
{
__GMM_ASSERT(pGmmResource);
return pGmmResource->GetMmcMode(ArrayIndex);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::SetMmcMode.
/// @see GmmLib::GmmResourceInfoCommon::SetMmcMode()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[in] Mode Media Memory Compression Mode (Disabled, Horizontal, Vertical)
/// @param[in] ArrayIndex ArrayIndex for which this info needs to be set
/////////////////////////////////////////////////////////////////////////////////////
void GMM_STDCALL GmmResSetMmcMode(GMM_RESOURCE_INFO *pGmmResource, GMM_RESOURCE_MMC_INFO Mode, uint32_t ArrayIndex)
{
__GMM_ASSERTPTR(pGmmResource, VOIDRETURN);
pGmmResource->SetMmcMode(Mode, ArrayIndex);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::IsMediaMemoryCompressed.
/// @see GmmLib::GmmResourceInfoCommon::IsMediaMemoryCompressed()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[in] ArrayIndex ArrayIndex for which this info is needed
/// @return 1 (enabled), 0 (disabled)
/////////////////////////////////////////////////////////////////////////////////////
uint8_t GMM_STDCALL GmmResIsMediaMemoryCompressed(GMM_RESOURCE_INFO *pGmmResource, uint32_t ArrayIndex)
{
return pGmmResource->IsMediaMemoryCompressed(ArrayIndex);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetMmcHint.
/// @see GmmLib::GmmResourceInfoCommon::GetMmcHint()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[in] ArrayIndex ArrayIndex for which this info is needed
/// @return true/false
/////////////////////////////////////////////////////////////////////////////////////
GMM_RESOURCE_MMC_HINT GMM_STDCALL GmmResGetMmcHint(GMM_RESOURCE_INFO *pGmmResource, uint32_t ArrayIndex)
{
__GMM_ASSERT(pGmmResource);
return pGmmResource->GetMmcHint(ArrayIndex);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::SetMmcHint.
/// @see GmmLib::GmmResourceInfoCommon::SetMmcHint()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @param[in] Hint Mmc hint to store
/// @param[in] ArrayIndex ArrayIndex for which this info is needed
/// @return true/false
/////////////////////////////////////////////////////////////////////////////////////
void GMM_STDCALL GmmResSetMmcHint(GMM_RESOURCE_INFO *pGmmResource, GMM_RESOURCE_MMC_HINT Hint, uint32_t ArrayIndex)
{
__GMM_ASSERTPTR(pGmmResource, VOIDRETURN);
pGmmResource->SetMmcHint(Hint, ArrayIndex);
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetNumSamples.
/// @see GmmLib::GmmResourceInfoCommon::GetNumSamples()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Sample count
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetNumSamples(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetNumSamples();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetSamplePattern.
/// @see GmmLib::GmmResourceInfoCommon::GetSamplePattern()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return Sample count
/////////////////////////////////////////////////////////////////////////////////////
GMM_MSAA_SAMPLE_PATTERN GMM_STDCALL GmmResGetSamplePattern(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERT(pGmmResource);
return pGmmResource->GetSamplePattern();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetHAlign.
/// @see GmmLib::GmmResourceInfoCommon::GetHAlign()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return HAlign
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetHAlign(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetHAlign();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetVAlign.
/// @see GmmLib::GmmResourceInfoCommon::GetVAlign()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return VAlign
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetVAlign(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetVAlign();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetAuxHAlign.
/// @see GmmLib::GmmResourceInfoCommon::GetAuxHAlign()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return HAlign
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetAuxHAlign(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetAuxHAlign();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::GetAuxVAlign.
/// @see GmmLib::GmmResourceInfoCommon::GetAuxVAlign()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return VAlign
/////////////////////////////////////////////////////////////////////////////////////
uint32_t GMM_STDCALL GmmResGetAuxVAlign(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->GetAuxVAlign();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::IsArraySpacingSingleLod.
/// @see GmmLib::GmmResourceInfoCommon::IsArraySpacingSingleLod()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return 1/0
/////////////////////////////////////////////////////////////////////////////////////
uint8_t GMM_STDCALL GmmResIsArraySpacingSingleLod(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->IsArraySpacingSingleLod();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::IsASTC.
/// @see GmmLib::GmmResourceInfoCommon::IsASTC()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return 1/0
/////////////////////////////////////////////////////////////////////////////////////
uint8_t GMM_STDCALL GmmResIsASTC(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->IsASTC();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::IsMsaaFormatDepthStencil.
/// @see GmmLib::GmmResourceInfoCommon::IsMsaaFormatDepthStencil()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return 1/0
/////////////////////////////////////////////////////////////////////////////////////
uint8_t GMM_STDCALL GmmResIsMsaaFormatDepthStencil(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->IsMsaaFormatDepthStencil();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmLib::GmmResourceInfoCommon::IsSvm.
/// @see GmmLib::GmmResourceInfoCommon::IsSvm()
///
/// @param[in] pGmmResource: Pointer to the GmmResourceInfo class
/// @return 1/0
/////////////////////////////////////////////////////////////////////////////////////
uint8_t GMM_STDCALL GmmResIsSvm(GMM_RESOURCE_INFO *pGmmResource)
{
__GMM_ASSERTPTR(pGmmResource, 0);
return pGmmResource->IsSvm();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmResourceInfoCommon::ValidateParams
/// @see GmmLib::GmmResourceInfoCommon::ValidateParams()
///
/// @param[in] pResourceInfo: Pointer to GmmResourceInfo class
/// @return 1 is validation passed. 0 otherwise.
/////////////////////////////////////////////////////////////////////////////////////
uint8_t GMM_STDCALL GmmResValidateParams(GMM_RESOURCE_INFO *pResourceInfo)
{
return pResourceInfo->ValidateParams();
}
/////////////////////////////////////////////////////////////////////////////////////
/// C wrapper for GmmResourceInfoCommon::SetPrivateData
/// @see GmmLib::GmmResourceInfoCommon::SetPrivateData()
///
/// @param[in] pGmmResource: Pointer to GmmResourceInfo class
/// @param[in] pPrivateData: Pointer to opaque private data from clients
/////////////////////////////////////////////////////////////////////////////////////