Skip to content

Commit 087d058

Browse files
azhirnovTheMostDiligent
authored andcommitted
Fixed compilation and tests for Metal
1 parent 25296ce commit 087d058

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

Graphics/GraphicsEngineMetal/interface/RasterizationRateMapMtl.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
#include "../../GraphicsEngine/interface/Buffer.h"
3232
#include "../../GraphicsEngine/interface/TextureView.h"
3333

34+
#if PLATFORM_TVOS
35+
@protocol MTLRasterizationRateMap; // Not available in tvOS
36+
#endif
37+
3438
DILIGENT_BEGIN_NAMESPACE(Diligent)
3539

3640
// {89148E0E-1300-4FF2-BEA4-F1127ED24CF9}
@@ -49,13 +53,13 @@ static const INTERFACE_ID IID_RasterizationRateMapMtl =
4953

5054
/// Rasterization rate map description
5155
struct RasterizationRateMapDesc DILIGENT_DERIVE(DeviceObjectAttribs)
52-
56+
5357
/// Width of the final render target
5458
Uint32 ScreenWidth DEFAULT_INITIALIZER(0);
5559

5660
/// Height of the final render target
5761
Uint32 ScreenHeight DEFAULT_INITIALIZER(0);
58-
62+
5963
/// The number of layers (aka array size)
6064
Uint32 LayerCount DEFAULT_INITIALIZER(0);
6165
};
@@ -87,7 +91,7 @@ struct RasterizationRateMapCreateInfo
8791
{
8892
/// Rasterization rate map description
8993
RasterizationRateMapDesc Desc;
90-
94+
9195
/// Array of rasterization rate map layer descriptions
9296
const RasterizationRateLayerDesc* pLayers DEFAULT_INITIALIZER(nullptr);
9397
};

Graphics/GraphicsEngineMetal/interface/RenderDeviceMtl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
/// Definition of the Diligent::IRenderDeviceMtl interface
2929

3030
#include "../../GraphicsEngine/interface/RenderDevice.h"
31+
#include "RasterizationRateMapMtl.h"
3132

3233
#if PLATFORM_TVOS
3334
@protocol MTLAccelerationStructure; // Not available in tvOS
34-
@protocol MTLRasterizationRateMap; // Not available in tvOS
3535
#endif
3636

3737
DILIGENT_BEGIN_NAMESPACE(Diligent)
@@ -84,13 +84,13 @@ DILIGENT_BEGIN_INTERFACE(IRenderDeviceMtl, IRenderDevice)
8484

8585
/// Creates a rasterization rate map from existing Metal resource
8686
VIRTUAL void METHOD(CreateRasterizationRateMapFromMtlResource)(THIS_
87-
id<MTLRasterizationRateMap> mtlRRM,
88-
struct IRasterizationRateMapMtl** ppRRM) API_AVAILABLE(ios(13), macosx(10.15.4)) API_UNAVAILABLE(tvos) PURE;
87+
id<MTLRasterizationRateMap> mtlRRM,
88+
IRasterizationRateMapMtl** ppRRM) API_AVAILABLE(ios(13), macosx(10.15.4)) API_UNAVAILABLE(tvos) PURE;
8989

9090
/// Creates a rasterization rate map
9191
VIRTUAL void METHOD(CreateRasterizationRateMap)(THIS_
92-
const struct RasterizationRateMapCreateInfo REF CreateInfo,
93-
struct IRasterizationRateMapMtl** ppRRM) PURE;
92+
const RasterizationRateMapCreateInfo REF CreateInfo,
93+
IRasterizationRateMapMtl** ppRRM) PURE;
9494

9595
/// Creates a sparse texture
9696
///

Tests/DiligentCoreAPITest/src/SparseResourcesTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ TEST_F(SparseResourceTest, SparseTexture3D)
19061906
{
19071907
GTEST_SKIP() << "Sparse texture 3D is not supported by this device";
19081908
}
1909-
if ((pDevice->GetSparseTextureFormatInfo(TEX_FORMAT_RGBA8_UNORM, RESOURCE_DIM_TEX_3D, 1).BindFlags & BIND_UNORDERED_ACCESS) != 0)
1909+
if ((pDevice->GetSparseTextureFormatInfo(TEX_FORMAT_RGBA8_UNORM, RESOURCE_DIM_TEX_3D, 1).BindFlags & BIND_UNORDERED_ACCESS) == 0)
19101910
{
19111911
GTEST_SKIP() << "Sparse texture UAV is not supported by this device";
19121912
}

Tests/IncludeTest/GraphicsEngineMetal/RasterizationRateMapMtlH_test.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ void TestRasterizationRateMapMtl_CInterface(IRasterizationRateMapMtl* pRRM)
4343
IRasterizationRateMapMtl_GetPhysicalGranularity(pRRM, (Uint32*)NULL, (Uint32*)NULL);
4444
IRasterizationRateMapMtl_MapScreenToPhysicalCoordinates(pRRM, 0, 0.f, 0.f, (float*)NULL, (float*)NULL);
4545
IRasterizationRateMapMtl_MapPhysicalToScreenCoordinates(pRRM, 0, 0.f, 0.f, (float*)NULL, (float*)NULL);
46-
IRasterizationRateMapMtl_GetParameterBufferSizeAndAlign(pRRM, (Uint32*)NULL, (Uint32*)NULL);
46+
IRasterizationRateMapMtl_GetParameterBufferSizeAndAlign(pRRM, (Uint64*)NULL, (Uint32*)NULL);
4747
IRasterizationRateMapMtl_CopyParameterDataToBuffer(pRRM, (struct IBuffer*)NULL, 0);
4848
}

0 commit comments

Comments
 (0)