| 1 |
/* |
| 2 |
* Copyright (C) 2018-2024 Intel Corporation |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: MIT |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
#include "shared/source/helpers/hw_info.h" |
| 9 |
#include "shared/source/os_interface/product_helper.h" |
| 10 |
#include "shared/test/common/mocks/mock_gmm.h" |
| 11 |
#include "shared/test/common/mocks/mock_gmm_resource_info.h" |
| 12 |
#include "shared/test/common/mocks/mock_memory_manager.h" |
| 13 |
|
| 14 |
#include "opencl/source/helpers/gmm_types_converter.h" |
| 15 |
#include "opencl/source/mem_obj/image.h" |
| 16 |
#include "opencl/source/platform/platform.h" |
| 17 |
#include "opencl/source/sharings/gl/gl_texture.h" |
| 18 |
#include "opencl/test/unit_test/mocks/gl/windows/mock_gl_sharing_windows.h" |
| 19 |
#include "opencl/test/unit_test/mocks/mock_cl_device.h" |
| 20 |
#include "opencl/test/unit_test/mocks/mock_context.h" |
| 21 |
#include "opencl/test/unit_test/mocks/mock_platform.h" |
| 22 |
|
| 23 |
#include "gtest/gtest.h" |
| 24 |
|
| 25 |
using namespace NEO; |
| 26 |
|
| 27 |
class GlSharingTextureTests : public ::testing::Test { |
| 28 |
public: |
| 29 |
// temp solution - we need to query size from GMM: |
| 30 |
class TempMM : public MockMemoryManager { |
| 31 |
public: |
| 32 |
using MockMemoryManager::MockMemoryManager; |
| 33 |
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(const OsHandleData &osHandleData, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) override { |
| 34 |
auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(osHandleData, properties, requireSpecificBitness, isHostIpcAllocation, reuseSharedAllocation, mapPointer); |
| 35 |
if (useForcedGmm) { |
| 36 |
alloc->setDefaultGmm(forceGmm.get()); |
| 37 |
} |
| 38 |
return alloc; |
| 39 |
} |
| 40 |
void freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation) override { |
| 41 |
if (useForcedGmm) { |
| 42 |
forceGmm.release(); |
| 43 |
} |
| 44 |
OsAgnosticMemoryManager::freeGraphicsMemoryImpl(gfxAllocation); |
| 45 |
} |
| 46 |
bool mapAuxGpuVA(GraphicsAllocation *graphicsAllocation) override { |
| 47 |
mapAuxGpuVACalled++; |
| 48 |
return false; |
| 49 |
} |
| 50 |
uint32_t mapAuxGpuVACalled = 0u; |
| 51 |
size_t forceAllocationSize; |
| 52 |
std::unique_ptr<Gmm> forceGmm; |
| 53 |
bool useForcedGmm = true; |
| 54 |
}; |
| 55 |
|
| 56 |
void SetUp() override { |
| 57 |
executionEnvironment = platform()->peekExecutionEnvironment(); |
| 58 |
imgDesc = {}; |
| 59 |
imgDesc.imageType = ImageType::image1D; |
| 60 |
imgDesc.imageWidth = 10; |
| 61 |
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr); |
| 62 |
|
| 63 |
tempMM = new TempMM(*executionEnvironment); |
| 64 |
executionEnvironment->memoryManager.reset(tempMM); |
| 65 |
device = std::make_unique<MockClDevice>(MockDevice::create<MockDevice>(executionEnvironment, 0)); |
| 66 |
clContext = std::make_unique<MockContext>(device.get()); |
| 67 |
|
| 68 |
mockGlSharingFunctions = glSharing->sharingFunctions.release(); |
| 69 |
clContext->setSharingFunctions(mockGlSharingFunctions); |
| 70 |
|
| 71 |
tempMM->forceGmm = MockGmm::queryImgParams(device->getGmmHelper(), imgInfo, false); |
| 72 |
tempMM->forceAllocationSize = textureSize; |
| 73 |
textureSize = imgInfo.size; |
| 74 |
textureId = 1; |
| 75 |
} |
| 76 |
|
| 77 |
void setUnifiedAuxSurf() { |
| 78 |
tempMM->useForcedGmm = true; |
| 79 |
auto mockGmmResInfo = static_cast<MockGmmResourceInfo *>(tempMM->forceGmm->gmmResourceInfo.get()); |
| 80 |
mockGmmResInfo->setUnifiedAuxTranslationCapable(); |
| 81 |
} |
| 82 |
|
| 83 |
ExecutionEnvironment *executionEnvironment; |
| 84 |
ImageDescriptor imgDesc; |
| 85 |
TempMM *tempMM; |
| 86 |
std::unique_ptr<MockClDevice> device; |
| 87 |
std::unique_ptr<MockContext> clContext; |
| 88 |
std::unique_ptr<MockGlSharing> glSharing = std::make_unique<MockGlSharing>(); |
| 89 |
GlSharingFunctionsMock *mockGlSharingFunctions; |
| 90 |
size_t textureSize; |
| 91 |
unsigned int textureId; |
| 92 |
}; |
| 93 |
|
| 94 |
TEST_F(GlSharingTextureTests, givenMockGlWhen1dGlTextureIsCreatedThenMemObjectHasGlHandler) { |
| 95 |
cl_int retVal = CL_INVALID_VALUE; |
| 96 |
|
| 97 |
glSharing->uploadDataToTextureInfo(textureId); |
| 98 |
|
| 99 |
auto glTexture = GlTexture::createSharedGlTexture(clContext.get(), (cl_mem_flags)0, GL_TEXTURE_1D, 0, textureId, &retVal); |
| 100 |
ASSERT_NE(nullptr, glTexture); |
| 101 |
auto graphicsAllocation = glTexture->getGraphicsAllocation(device->getRootDeviceIndex()); |
| 102 |
EXPECT_NE(nullptr, graphicsAllocation); |
| 103 |
EXPECT_EQ(textureSize, graphicsAllocation->getUnderlyingBufferSize()); |
| 104 |
EXPECT_EQ(1, glSharing->dllParam->getParam("glAcquireSharedTextureCalled")); |
| 105 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 106 |
|
| 107 |
EXPECT_EQ(textureId, glSharing->dllParam->getTextureInfo().name); // input |
| 108 |
|
| 109 |
auto handler = glTexture->peekSharingHandler(); |
| 110 |
ASSERT_NE(nullptr, handler); |
| 111 |
auto glHandler = static_cast<GlSharing *>(handler); |
| 112 |
|
| 113 |
EXPECT_EQ(glHandler->peekFunctionsHandler(), mockGlSharingFunctions); |
| 114 |
|
| 115 |
delete glTexture; |
| 116 |
} |
| 117 |
|
| 118 |
class FailingMemoryManager : public MockMemoryManager { |
| 119 |
public: |
| 120 |
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(const OsHandleData &osHandleData, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) override { |
| 121 |
return nullptr; |
| 122 |
} |
| 123 |
}; |
| 124 |
|
| 125 |
TEST_F(GlSharingTextureTests, givenMockGlWhenGlTextureIsCreatedFromWrongHandleThenErrorAndNoTextureIsReturned) { |
| 126 |
auto tempMemoryManager = clContext->getMemoryManager(); |
| 127 |
tempMM->useForcedGmm = false; |
| 128 |
auto memoryManager = std::unique_ptr<FailingMemoryManager>(new FailingMemoryManager()); |
| 129 |
clContext->memoryManager = memoryManager.get(); |
| 130 |
|
| 131 |
auto retVal = CL_SUCCESS; |
| 132 |
auto glTexture = GlTexture::createSharedGlTexture(clContext.get(), (cl_mem_flags)0, GL_TEXTURE_1D, 0, textureId, &retVal); |
| 133 |
|
| 134 |
EXPECT_EQ(nullptr, glTexture); |
| 135 |
EXPECT_EQ(CL_INVALID_GL_OBJECT, retVal); |
| 136 |
|
| 137 |
clContext->memoryManager = tempMemoryManager; |
| 138 |
} |
| 139 |
|
| 140 |
GLboolean OSAPI mockGLAcquireSharedTexture(GLDisplay, GLContext, GLContext, GLvoid *pResourceInfo) { |
| 141 |
auto pTextureInfo = (CL_GL_RESOURCE_INFO *)pResourceInfo; |
| 142 |
GlDllHelper dllParam; |
| 143 |
pTextureInfo->globalShareHandle = dllParam.getTextureInfo().globalShareHandle; |
| 144 |
pTextureInfo->globalShareHandleMCS = dllParam.getTextureInfo().globalShareHandleMCS; |
| 145 |
|
| 146 |
if (pTextureInfo->target == GL_TEXTURE_BUFFER) { |
| 147 |
// size and width for texture buffer are queried from textureInfo - not from gmm |
| 148 |
pTextureInfo->textureBufferSize = dllParam.getTextureInfo().textureBufferSize; |
| 149 |
pTextureInfo->textureBufferWidth = dllParam.getTextureInfo().textureBufferWidth; |
| 150 |
} |
| 151 |
pTextureInfo->pGmmResInfo = dllParam.getTextureInfo().pGmmResInfo; |
| 152 |
pTextureInfo->glInternalFormat = 99999; |
| 153 |
pTextureInfo->glHWFormat = dllParam.getTextureInfo().glHWFormat; |
| 154 |
pTextureInfo->textureBufferOffset = dllParam.getTextureInfo().textureBufferOffset; |
| 155 |
dllParam.loadTexture(*pTextureInfo); |
| 156 |
return (GLboolean)1; |
| 157 |
}; |
| 158 |
|
| 159 |
TEST_F(GlSharingTextureTests, givenMockGlWhenGlTextureIsCreatedFromIncorrectFormatThenErrorAndNoTextureIsReturned) { |
| 160 |
mockGlSharingFunctions->setGLAcquireSharedTextureMock(mockGLAcquireSharedTexture); |
| 161 |
|
| 162 |
auto retVal = CL_SUCCESS; |
| 163 |
auto glTexture = GlTexture::createSharedGlTexture(clContext.get(), (cl_mem_flags)0, GL_TEXTURE_1D, 0, textureId, &retVal); |
| 164 |
|
| 165 |
EXPECT_EQ(nullptr, glTexture); |
| 166 |
EXPECT_EQ(CL_INVALID_GL_OBJECT, retVal); |
| 167 |
} |
| 168 |
|
| 169 |
TEST_F(GlSharingTextureTests, givenMockGlWhenRenderBufferTextureIsCreatedThenMemObjectHasGlHandler) { |
| 170 |
cl_int retVal = CL_INVALID_VALUE; |
| 171 |
|
| 172 |
glSharing->uploadDataToTextureInfo(textureId); |
| 173 |
|
| 174 |
auto glTexture = GlTexture::createSharedGlTexture(clContext.get(), (cl_mem_flags)0, GL_RENDERBUFFER_EXT, 0, textureId, &retVal); |
| 175 |
ASSERT_NE(nullptr, glTexture); |
| 176 |
auto graphicsAllocation = glTexture->getGraphicsAllocation(device->getRootDeviceIndex()); |
| 177 |
EXPECT_NE(nullptr, graphicsAllocation); |
| 178 |
EXPECT_EQ(textureSize, graphicsAllocation->getUnderlyingBufferSize()); |
| 179 |
EXPECT_EQ(1, glSharing->dllParam->getParam("glAcquireSharedRenderBufferCalled")); |
| 180 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 181 |
|
| 182 |
EXPECT_EQ(textureId, glSharing->dllParam->getTextureInfo().name); |
| 183 |
|
| 184 |
auto handler = glTexture->peekSharingHandler(); |
| 185 |
ASSERT_NE(nullptr, handler); |
| 186 |
auto glHandler = static_cast<GlSharing *>(handler); |
| 187 |
|
| 188 |
EXPECT_EQ(glHandler->peekFunctionsHandler(), mockGlSharingFunctions); |
| 189 |
|
| 190 |
delete glTexture; |
| 191 |
} |
| 192 |
|
| 193 |
TEST_F(GlSharingTextureTests, givenGmmResourceAsInputWhenTextureIsCreatedThenItHasGmmSet) { |
| 194 |
cl_int retVal = CL_INVALID_VALUE; |
| 195 |
|
| 196 |
glSharing->textureInfoOutput.globalShareHandle = textureId; |
| 197 |
glSharing->textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo(); |
| 198 |
this->tempMM->useForcedGmm = false; |
| 199 |
glSharing->textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo(); |
| 200 |
|
| 201 |
glSharing->uploadDataToTextureInfo(); |
| 202 |
|
| 203 |
auto glTexture = GlTexture::createSharedGlTexture(clContext.get(), (cl_mem_flags)0, GL_TEXTURE_1D, 0, textureId, &retVal); |
| 204 |
ASSERT_NE(nullptr, glTexture); |
| 205 |
auto graphicsAllocation = glTexture->getGraphicsAllocation(device->getRootDeviceIndex()); |
| 206 |
EXPECT_NE(nullptr, graphicsAllocation); |
| 207 |
|
| 208 |
ASSERT_NE(nullptr, graphicsAllocation->getDefaultGmm()); |
| 209 |
ASSERT_NE(nullptr, graphicsAllocation->getDefaultGmm()->gmmResourceInfo->peekHandle()); |
| 210 |
|
| 211 |
delete glTexture; |
| 212 |
} |
| 213 |
|
| 214 |
TEST_F(GlSharingTextureTests, givenDifferentHwFormatWhenSurfaceFormatInfoIsSetThenOverwrite) { |
| 215 |
cl_int retVal = CL_INVALID_VALUE; |
| 216 |
cl_image_format imageFormat = {}; |
| 217 |
GlTexture::setClImageFormat(GL_DEPTH32F_STENCIL8, imageFormat); |
| 218 |
auto format = Image::getSurfaceFormatFromTable(CL_MEM_READ_ONLY, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); |
| 219 |
ASSERT_NE(format, nullptr); |
| 220 |
auto newHwFormat = 217u; |
| 221 |
|
| 222 |
EXPECT_TRUE(format->surfaceFormat.genxSurfaceFormat != newHwFormat); |
| 223 |
|
| 224 |
glSharing->textureInfoOutput.glHWFormat = newHwFormat; |
| 225 |
glSharing->textureInfoOutput.glInternalFormat = GL_DEPTH32F_STENCIL8; |
| 226 |
|
| 227 |
glSharing->uploadDataToTextureInfo(); |
| 228 |
|
| 229 |
auto glTexture = GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_ONLY, GL_TEXTURE_2D, 0, textureId, &retVal); |
| 230 |
ASSERT_NE(nullptr, glTexture); |
| 231 |
EXPECT_TRUE(newHwFormat == glTexture->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat); |
| 232 |
|
| 233 |
delete glTexture; |
| 234 |
} |
| 235 |
|
| 236 |
TEST_F(GlSharingTextureTests, givenGLRGB10FormatWhenSharedGlTextureIsCreatedThenItHasCorrectGenxSurfaceFormatAssigned) { |
| 237 |
cl_int retVal = CL_INVALID_VALUE; |
| 238 |
glSharing->textureInfoOutput.glInternalFormat = GL_RGB10; |
| 239 |
glSharing->textureInfoOutput.glHWFormat = GFX3DSTATE_SURFACEFORMAT_R16G16B16X16_UNORM; |
| 240 |
glSharing->uploadDataToTextureInfo(); |
| 241 |
|
| 242 |
std::unique_ptr<Image> glTexture(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_ONLY, GL_TEXTURE_2D, 0, textureId, &retVal)); |
| 243 |
ASSERT_NE(nullptr, glTexture); |
| 244 |
EXPECT_EQ(glTexture->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, GFX3DSTATE_SURFACEFORMAT_R16G16B16A16_UNORM); |
| 245 |
} |
| 246 |
|
| 247 |
TEST_F(GlSharingTextureTests, givenContextAnd1dTextureWhenClCreateFromGlTextureIsCalledThenImageIsReturned) { |
| 248 |
cl_int retVal = CL_INVALID_GL_OBJECT; |
| 249 |
auto glImage = clCreateFromGLTexture(clContext.get(), 0, GL_TEXTURE_1D, 0, textureId, &retVal); |
| 250 |
ASSERT_EQ(CL_SUCCESS, retVal); |
| 251 |
ASSERT_NE(nullptr, glImage); |
| 252 |
|
| 253 |
retVal = clReleaseMemObject(glImage); |
| 254 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 255 |
} |
| 256 |
|
| 257 |
TEST_F(GlSharingTextureTests, givenContextWithoutSharingAnd1dTextureWhenClCreateFromGlTextureIsCalledThenErrorIsReturned) { |
| 258 |
tempMM->useForcedGmm = false; |
| 259 |
clContext->resetSharingFunctions(CLGL_SHARING); |
| 260 |
cl_int retVal = CL_INVALID_GL_OBJECT; |
| 261 |
auto glImage = clCreateFromGLTexture(clContext.get(), 0, GL_TEXTURE_1D, 0, textureId, &retVal); |
| 262 |
ASSERT_EQ(CL_INVALID_CONTEXT, retVal); |
| 263 |
ASSERT_EQ(nullptr, glImage); |
| 264 |
} |
| 265 |
|
| 266 |
TEST_F(GlSharingTextureTests, givenContextAndRenderBufferTextureWhenClCreateFromGlTextureIsCalledThenImageIsReturned) { |
| 267 |
cl_int retVal = CL_INVALID_GL_OBJECT; |
| 268 |
auto glImage = clCreateFromGLRenderbuffer(clContext.get(), 0, textureId, &retVal); |
| 269 |
ASSERT_EQ(CL_SUCCESS, retVal); |
| 270 |
ASSERT_NE(nullptr, glImage); |
| 271 |
|
| 272 |
retVal = clReleaseMemObject(glImage); |
| 273 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 274 |
} |
| 275 |
|
| 276 |
TEST_F(GlSharingTextureTests, givenContextWithoutSharingAndRenderBufferTextureWhenClCreateFromGlTextureIsCalledThenErrorIsReturned) { |
| 277 |
tempMM->useForcedGmm = false; |
| 278 |
clContext->resetSharingFunctions(CLGL_SHARING); |
| 279 |
cl_int retVal = CL_INVALID_GL_OBJECT; |
| 280 |
auto glImage = clCreateFromGLRenderbuffer(clContext.get(), 0, textureId, &retVal); |
| 281 |
ASSERT_EQ(CL_INVALID_CONTEXT, retVal); |
| 282 |
ASSERT_EQ(nullptr, glImage); |
| 283 |
} |
| 284 |
|
| 285 |
TEST_F(GlSharingTextureTests, givenGlCl1dTextureWhenAskedForCLGLGetInfoThenIdAndTypeIsReturned) { |
| 286 |
auto retVal = CL_SUCCESS; |
| 287 |
auto glImage = clCreateFromGLTexture(clContext.get(), 0, GL_TEXTURE_1D, 0, textureId, &retVal); |
| 288 |
ASSERT_EQ(CL_SUCCESS, retVal); |
| 289 |
ASSERT_NE(nullptr, glImage); |
| 290 |
|
| 291 |
cl_gl_object_type objectType = 0u; |
| 292 |
cl_GLuint objectId = 0u; |
| 293 |
|
| 294 |
retVal = clGetGLObjectInfo(glImage, &objectType, &objectId); |
| 295 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 296 |
EXPECT_EQ(objectType, (cl_gl_object_type)CL_GL_OBJECT_TEXTURE1D); |
| 297 |
EXPECT_EQ(objectId, textureId); |
| 298 |
|
| 299 |
retVal = clReleaseMemObject(glImage); |
| 300 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 301 |
} |
| 302 |
|
| 303 |
TEST_F(GlSharingTextureTests, givenHwCommandQueueAndGlTextureWhenItIsCreatedWithClCreateFromGlTexture2dThenImageObjectIsReturned) { |
| 304 |
auto retVal = CL_SUCCESS; |
| 305 |
auto glImage = clCreateFromGLTexture2D(clContext.get(), 0, GL_TEXTURE_2D, 0, textureId, &retVal); |
| 306 |
ASSERT_EQ(CL_SUCCESS, retVal); |
| 307 |
ASSERT_NE(nullptr, glImage); |
| 308 |
|
| 309 |
cl_gl_object_type objectType = 0u; |
| 310 |
cl_GLuint objectId = 0u; |
| 311 |
|
| 312 |
retVal = clGetGLObjectInfo(glImage, &objectType, &objectId); |
| 313 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 314 |
EXPECT_EQ(objectType, (cl_gl_object_type)CL_GL_OBJECT_TEXTURE2D); |
| 315 |
EXPECT_EQ(objectId, textureId); |
| 316 |
|
| 317 |
retVal = clReleaseMemObject(glImage); |
| 318 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 319 |
} |
| 320 |
|
| 321 |
TEST_F(GlSharingTextureTests, givenContextWithoutSharingAndGlTextureWhenItIsCreatedWithClCreateFromGlTexture2dThenErrorIsReturned) { |
| 322 |
tempMM->useForcedGmm = false; |
| 323 |
clContext->resetSharingFunctions(CLGL_SHARING); |
| 324 |
auto retVal = CL_SUCCESS; |
| 325 |
auto glImage = clCreateFromGLTexture2D(clContext.get(), 0, GL_TEXTURE_2D, 0, textureId, &retVal); |
| 326 |
ASSERT_EQ(CL_INVALID_CONTEXT, retVal); |
| 327 |
ASSERT_EQ(nullptr, glImage); |
| 328 |
} |
| 329 |
|
| 330 |
TEST_F(GlSharingTextureTests, givenHwCommandQueueAndGlTextureWhenItIsCreatedWithClCreateFromGlTexture3dThenImageObjectIsReturned) { |
| 331 |
auto retVal = CL_SUCCESS; |
| 332 |
auto glImage = clCreateFromGLTexture3D(clContext.get(), 0, GL_TEXTURE_3D, 0, textureId, &retVal); |
| 333 |
ASSERT_EQ(CL_SUCCESS, retVal); |
| 334 |
ASSERT_NE(nullptr, glImage); |
| 335 |
|
| 336 |
cl_gl_object_type objectType = 0u; |
| 337 |
cl_GLuint objectId = 0u; |
| 338 |
|
| 339 |
retVal = clGetGLObjectInfo(glImage, &objectType, &objectId); |
| 340 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 341 |
EXPECT_EQ(objectType, (cl_gl_object_type)CL_GL_OBJECT_TEXTURE3D); |
| 342 |
EXPECT_EQ(objectId, textureId); |
| 343 |
|
| 344 |
retVal = clReleaseMemObject(glImage); |
| 345 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 346 |
} |
| 347 |
|
| 348 |
TEST_F(GlSharingTextureTests, givenContextWithoutSharingAndGlTextureWhenItIsCreatedWithClCreateFromGlTexture3dThenErrorIsReturned) { |
| 349 |
tempMM->useForcedGmm = false; |
| 350 |
clContext->resetSharingFunctions(CLGL_SHARING); |
| 351 |
auto retVal = CL_SUCCESS; |
| 352 |
auto glImage = clCreateFromGLTexture3D(clContext.get(), 0, GL_TEXTURE_3D, 0, textureId, &retVal); |
| 353 |
ASSERT_EQ(CL_INVALID_CONTEXT, retVal); |
| 354 |
ASSERT_EQ(nullptr, glImage); |
| 355 |
} |
| 356 |
|
| 357 |
TEST_F(GlSharingTextureTests, givenHwCommandQueueAndGlTextureWhenAcquireIsCalledThenAcquireCountIsIncremented) { |
| 358 |
glSharing->uploadDataToTextureInfo(textureId); |
| 359 |
|
| 360 |
auto retVal = CL_SUCCESS; |
| 361 |
auto commandQueue = clCreateCommandQueue(clContext.get(), clContext->getDevice(0), 0, &retVal); |
| 362 |
ASSERT_EQ(CL_SUCCESS, retVal); |
| 363 |
|
| 364 |
auto glImage = clCreateFromGLTexture(clContext.get(), 0, GL_TEXTURE_1D, 0, textureId, &retVal); |
| 365 |
|
| 366 |
EXPECT_EQ(1, glSharing->dllParam->getParam("glAcquireSharedTextureCalled")); |
| 367 |
retVal = clEnqueueAcquireGLObjects(commandQueue, 1, &glImage, 0, nullptr, nullptr); |
| 368 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 369 |
EXPECT_EQ(2, glSharing->dllParam->getParam("glAcquireSharedTextureCalled")); |
| 370 |
|
| 371 |
retVal = clEnqueueReleaseGLObjects(commandQueue, 1, &glImage, 0, nullptr, nullptr); |
| 372 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 373 |
|
| 374 |
retVal = clEnqueueAcquireGLObjects(commandQueue, 1, &glImage, 0, nullptr, nullptr); |
| 375 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 376 |
EXPECT_EQ(3, glSharing->dllParam->getParam("glAcquireSharedTextureCalled")); |
| 377 |
|
| 378 |
retVal = clReleaseCommandQueue(commandQueue); |
| 379 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 380 |
retVal = clReleaseMemObject(glImage); |
| 381 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 382 |
} |
| 383 |
|
| 384 |
TEST_F(GlSharingTextureTests, GivenGlTextureThenBufferOffsetIsCorrect) { |
| 385 |
glSharing->uploadDataToTextureInfo(textureId); |
| 386 |
|
| 387 |
auto rootDeviceIndex = clContext->getDevice(0)->getRootDeviceIndex(); |
| 388 |
|
| 389 |
auto retVal = CL_SUCCESS; |
| 390 |
auto commandQueue = clCreateCommandQueue(clContext.get(), clContext->getDevice(0), 0, &retVal); |
| 391 |
ASSERT_EQ(CL_SUCCESS, retVal); |
| 392 |
|
| 393 |
auto glImage = clCreateFromGLTexture(clContext.get(), 0, GL_TEXTURE_1D, 0, textureId, &retVal); |
| 394 |
EXPECT_NE(glImage, nullptr); |
| 395 |
|
| 396 |
retVal = clEnqueueAcquireGLObjects(commandQueue, 1, &glImage, 0, nullptr, nullptr); |
| 397 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 398 |
auto memObj = castToObject<MemObj>(glImage); |
| 399 |
EXPECT_NE(memObj, nullptr); |
| 400 |
EXPECT_EQ(memObj->getGraphicsAllocation(rootDeviceIndex)->getAllocationOffset(), 0u); |
| 401 |
|
| 402 |
retVal = clEnqueueReleaseGLObjects(commandQueue, 1, &glImage, 0, nullptr, nullptr); |
| 403 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 404 |
|
| 405 |
glSharing->uploadTextureBufferOffsetToTextureInfo(0x660); |
| 406 |
retVal = clEnqueueAcquireGLObjects(commandQueue, 1, &glImage, 0, nullptr, nullptr); |
| 407 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 408 |
memObj = castToObject<MemObj>(glImage); |
| 409 |
EXPECT_NE(memObj, nullptr); |
| 410 |
EXPECT_EQ(memObj->getGraphicsAllocation(rootDeviceIndex)->getAllocationOffset(), 0x660u); |
| 411 |
|
| 412 |
retVal = clEnqueueReleaseGLObjects(commandQueue, 1, &glImage, 0, nullptr, nullptr); |
| 413 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 414 |
|
| 415 |
retVal = clReleaseCommandQueue(commandQueue); |
| 416 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 417 |
|
| 418 |
retVal = clReleaseMemObject(glImage); |
| 419 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 420 |
} |
| 421 |
|
| 422 |
TEST_F(GlSharingTextureTests, givenHwCommandQueueAndGlRenderBufferWhenAcquireIsCalledThenAcquireCountIsIncremented) { |
| 423 |
glSharing->uploadDataToTextureInfo(textureId); |
| 424 |
|
| 425 |
auto retVal = CL_SUCCESS; |
| 426 |
auto commandQueue = clCreateCommandQueue(clContext.get(), clContext->getDevice(0), 0, &retVal); |
| 427 |
ASSERT_EQ(CL_SUCCESS, retVal); |
| 428 |
|
| 429 |
auto glImage = clCreateFromGLRenderbuffer(clContext.get(), 0, textureId, &retVal); |
| 430 |
|
| 431 |
EXPECT_EQ(1, glSharing->dllParam->getParam("glAcquireSharedRenderBufferCalled")); |
| 432 |
retVal = clEnqueueAcquireGLObjects(commandQueue, 1, &glImage, 0, nullptr, nullptr); |
| 433 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 434 |
EXPECT_EQ(2, glSharing->dllParam->getParam("glAcquireSharedRenderBufferCalled")); |
| 435 |
|
| 436 |
retVal = clEnqueueReleaseGLObjects(commandQueue, 1, &glImage, 0, nullptr, nullptr); |
| 437 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 438 |
|
| 439 |
retVal = clEnqueueAcquireGLObjects(commandQueue, 1, &glImage, 0, nullptr, nullptr); |
| 440 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 441 |
EXPECT_EQ(3, glSharing->dllParam->getParam("glAcquireSharedRenderBufferCalled")); |
| 442 |
|
| 443 |
retVal = clReleaseCommandQueue(commandQueue); |
| 444 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 445 |
retVal = clReleaseMemObject(glImage); |
| 446 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 447 |
} |
| 448 |
|
| 449 |
TEST_F(GlSharingTextureTests, givenSharedGlTextureWhenItIsAcquireCountIsDecrementedToZeroThenCallReleaseFunction) { |
| 450 |
std::unique_ptr<Image> image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_ONLY, GL_TEXTURE_2D, 0, textureId, nullptr)); |
| 451 |
auto sharingHandler = image->peekSharingHandler(); |
| 452 |
|
| 453 |
sharingHandler->acquire(image.get(), clContext->getDevice(0)->getRootDeviceIndex()); |
| 454 |
sharingHandler->acquire(image.get(), clContext->getDevice(0)->getRootDeviceIndex()); |
| 455 |
|
| 456 |
sharingHandler->release(image.get(), clContext->getDevice(0)->getRootDeviceIndex()); |
| 457 |
EXPECT_EQ(0, glSharing->dllParam->getParam("glReleaseSharedTextureCalled")); |
| 458 |
|
| 459 |
sharingHandler->release(image.get(), clContext->getDevice(0)->getRootDeviceIndex()); |
| 460 |
EXPECT_EQ(1, glSharing->dllParam->getParam("glReleaseSharedTextureCalled")); |
| 461 |
EXPECT_EQ(0, glSharing->dllParam->getParam("glReleaseSharedRenderBufferCalled")); |
| 462 |
EXPECT_EQ(textureId, glSharing->dllParam->getTextureInfo().name); |
| 463 |
} |
| 464 |
|
| 465 |
TEST_F(GlSharingTextureTests, givenSharedRenderBufferWhenItIsAcquireCountIsDecrementedToZeroThenCallReleaseFunction) { |
| 466 |
std::unique_ptr<Image> image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_WRITE, GL_RENDERBUFFER_EXT, 0, textureId, nullptr)); |
| 467 |
auto sharingHandler = image->peekSharingHandler(); |
| 468 |
|
| 469 |
sharingHandler->acquire(image.get(), clContext->getDevice(0)->getRootDeviceIndex()); |
| 470 |
sharingHandler->acquire(image.get(), clContext->getDevice(0)->getRootDeviceIndex()); |
| 471 |
|
| 472 |
sharingHandler->release(image.get(), clContext->getDevice(0)->getRootDeviceIndex()); |
| 473 |
EXPECT_EQ(0, glSharing->dllParam->getParam("glReleaseSharedRenderBufferCalled")); |
| 474 |
|
| 475 |
sharingHandler->release(image.get(), clContext->getDevice(0)->getRootDeviceIndex()); |
| 476 |
EXPECT_EQ(1, glSharing->dllParam->getParam("glReleaseSharedRenderBufferCalled")); |
| 477 |
EXPECT_EQ(0, glSharing->dllParam->getParam("glReleaseSharedTextureCalled")); |
| 478 |
EXPECT_EQ(textureId, glSharing->dllParam->getTextureInfo().name); |
| 479 |
} |
| 480 |
|
| 481 |
TEST_F(GlSharingTextureTests, givenMultisampleTextureWithMoreThanOneSampleWhenAskedForNumSamplesThenReturnCorrectValue) { |
| 482 |
GLsizei expectedNumSamples = 2; |
| 483 |
glSharing->textureInfoOutput.numberOfSamples = expectedNumSamples; |
| 484 |
glSharing->uploadDataToTextureInfo(); |
| 485 |
std::unique_ptr<Image> image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_WRITE, GL_TEXTURE_2D_MULTISAMPLE, 0, textureId, nullptr)); |
| 486 |
|
| 487 |
GLsizei numSamples = 0; |
| 488 |
size_t retSize = 0; |
| 489 |
|
| 490 |
auto retVal = clGetGLTextureInfo(image.get(), CL_GL_NUM_SAMPLES, sizeof(GLsizei), &numSamples, &retSize); |
| 491 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 492 |
EXPECT_EQ(expectedNumSamples, numSamples); |
| 493 |
EXPECT_EQ(sizeof(GLsizei), retSize); |
| 494 |
} |
| 495 |
|
| 496 |
TEST_F(GlSharingTextureTests, givenTextureWithOneSampleWhenAskedForNumSamplesThenReturnZero) { |
| 497 |
glSharing->textureInfoOutput.numberOfSamples = 1; |
| 498 |
glSharing->uploadDataToTextureInfo(); |
| 499 |
std::unique_ptr<Image> image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_WRITE, GL_TEXTURE_2D_MULTISAMPLE, 0, textureId, nullptr)); |
| 500 |
|
| 501 |
GLenum numSamples = 0; |
| 502 |
size_t retSize = 0; |
| 503 |
|
| 504 |
auto retVal = clGetGLTextureInfo(image.get(), CL_GL_NUM_SAMPLES, sizeof(GLsizei), &numSamples, &retSize); |
| 505 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 506 |
EXPECT_EQ(0u, numSamples); |
| 507 |
EXPECT_EQ(sizeof(GLsizei), retSize); |
| 508 |
} |
| 509 |
|
| 510 |
TEST_F(GlSharingTextureTests, givenTextureWithZeroSamplesWhenAskedForNumSamplesThenReturnZero) { |
| 511 |
glSharing->textureInfoOutput.numberOfSamples = 0; |
| 512 |
glSharing->uploadDataToTextureInfo(); |
| 513 |
std::unique_ptr<Image> image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_WRITE, GL_TEXTURE_2D_MULTISAMPLE, 0, textureId, nullptr)); |
| 514 |
|
| 515 |
GLenum numSamples = 0; |
| 516 |
size_t retSize = 0; |
| 517 |
|
| 518 |
auto retVal = clGetGLTextureInfo(image.get(), CL_GL_NUM_SAMPLES, sizeof(GLsizei), &numSamples, &retSize); |
| 519 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 520 |
EXPECT_EQ(0u, numSamples); |
| 521 |
EXPECT_EQ(sizeof(GLsizei), retSize); |
| 522 |
} |
| 523 |
|
| 524 |
TEST_F(GlSharingTextureTests, givenMockGlWhenGlTextureIsCreatedFromFormatNotIncludedInSurfaceFormatsThenErrorAndNoTextureIsReturned) { |
| 525 |
cl_int retVal = CL_SUCCESS; |
| 526 |
auto textureInfoOutput = std::make_unique<CL_GL_RESOURCE_INFO>(); |
| 527 |
textureInfoOutput->glInternalFormat = GL_SRGB8_ALPHA8; |
| 528 |
glSharing->dllParam->loadTexture(*textureInfoOutput); |
| 529 |
|
| 530 |
auto glTexture = GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_WRITE_ONLY, GL_SRGB8_ALPHA8, 0, textureId, &retVal); |
| 531 |
|
| 532 |
EXPECT_EQ(nullptr, glTexture); |
| 533 |
EXPECT_EQ(CL_INVALID_GL_OBJECT, retVal); |
| 534 |
} |
| 535 |
|
| 536 |
TEST_F(GlSharingTextureTests, givenMockGlWhenGlTextureIsCreatedWithUnifiedAuxSurfThenMapAuxGpuVaIsCalled) { |
| 537 |
CL_GL_RESOURCE_INFO textureInfoToReturn = {}; |
| 538 |
textureInfoToReturn.isAuxEnabled = GL_TRUE; |
| 539 |
glSharing->dllParam->loadTexture(textureInfoToReturn); |
| 540 |
|
| 541 |
cl_int retVal = CL_SUCCESS; |
| 542 |
setUnifiedAuxSurf(); |
| 543 |
EXPECT_EQ(0u, tempMM->mapAuxGpuVACalled); |
| 544 |
|
| 545 |
auto glTexture = std::unique_ptr<Image>(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_WRITE_ONLY, GL_SRGB8_ALPHA8, 0, textureId, &retVal)); |
| 546 |
|
| 547 |
const auto &hwInfo = clContext->getDevice(0)->getHardwareInfo(); |
| 548 |
const auto &productHelper = clContext->getDevice(0)->getProductHelper(); |
| 549 |
uint32_t expectedMapAuxGpuVaCalls = productHelper.isPageTableManagerSupported(hwInfo) ? 1 : 0; |
| 550 |
|
| 551 |
EXPECT_EQ(expectedMapAuxGpuVaCalls, tempMM->mapAuxGpuVACalled); |
| 552 |
} |
| 553 |
|
| 554 |
TEST_F(GlSharingTextureTests, givenAuxDisabledAndUnifiedAuxCapableWhenGlTextureIsCreatedThenAllocationIsTreatedAsUncompressed) { |
| 555 |
CL_GL_RESOURCE_INFO textureInfoToReturn = {}; |
| 556 |
textureInfoToReturn.isAuxEnabled = GL_FALSE; |
| 557 |
glSharing->dllParam->loadTexture(textureInfoToReturn); |
| 558 |
|
| 559 |
cl_int retVal = CL_SUCCESS; |
| 560 |
setUnifiedAuxSurf(); |
| 561 |
ASSERT_EQ(0u, tempMM->mapAuxGpuVACalled); |
| 562 |
|
| 563 |
auto glTexture = std::unique_ptr<Image>(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_WRITE_ONLY, GL_SRGB8_ALPHA8, 0, textureId, &retVal)); |
| 564 |
EXPECT_EQ(0u, tempMM->mapAuxGpuVACalled); |
| 565 |
auto graphicsAllocation = glTexture->getGraphicsAllocation(device->getRootDeviceIndex()); |
| 566 |
EXPECT_FALSE(graphicsAllocation->getDefaultGmm()->isCompressionEnabled()); |
| 567 |
} |
| 568 |
|
| 569 |
TEST_F(GlSharingTextureTests, givenGmmInfoIsDisplayableWhenGlTextureIsCreatedThenImageHasDisplayableSet) { |
| 570 |
auto mockGmmResInfo = static_cast<MockGmmResourceInfo *>(tempMM->forceGmm->gmmResourceInfo.get()); |
| 571 |
mockGmmResInfo->isDisplayableValue = true; |
| 572 |
cl_int retVal = CL_SUCCESS; |
| 573 |
auto glTexture = std::unique_ptr<Image>(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_WRITE_ONLY, GL_SRGB8_ALPHA8, 0, textureId, &retVal)); |
| 574 |
EXPECT_TRUE(glTexture->getIsDisplayable()); |
| 575 |
} |
| 576 |
|
| 577 |
class GetGlTextureInfoTests : public GlSharingTextureTests, |
| 578 |
public ::testing::WithParamInterface<unsigned int /*cl_GLenum*/> { |
| 579 |
}; |
| 580 |
|
| 581 |
INSTANTIATE_TEST_SUITE_P( |
| 582 |
GetGlTextureInfoTests, |
| 583 |
GetGlTextureInfoTests, |
| 584 |
testing::ValuesIn(glTextureTargets::supportedTargets)); |
| 585 |
|
| 586 |
TEST_P(GetGlTextureInfoTests, givenGlTextureWhenAskedForCLGetGLTextureInfoThenReturnValidInfo) { |
| 587 |
auto retVal = CL_SUCCESS; |
| 588 |
GLenum expectedTarget = GetParam(); |
| 589 |
GLint mipLevel = 1u; |
| 590 |
auto glImage = clCreateFromGLTexture(clContext.get(), 0, expectedTarget, mipLevel, textureId, &retVal); |
| 591 |
ASSERT_EQ(CL_SUCCESS, retVal); |
| 592 |
ASSERT_NE(nullptr, glImage); |
| 593 |
|
| 594 |
auto pMemObj = castToObject<MemObj>(glImage); |
| 595 |
auto glTextureObj = (GlTexture *)pMemObj->peekSharingHandler(); |
| 596 |
|
| 597 |
GLenum textureTarget = 0u; |
| 598 |
|
| 599 |
size_t retSize = 0; |
| 600 |
|
| 601 |
retVal = clGetGLTextureInfo(glImage, CL_GL_TEXTURE_TARGET, sizeof(GLenum), &textureTarget, &retSize); |
| 602 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 603 |
EXPECT_EQ(expectedTarget, textureTarget); |
| 604 |
EXPECT_EQ(sizeof(GLenum), retSize); |
| 605 |
|
| 606 |
retVal = clGetGLTextureInfo(glImage, CL_GL_MIPMAP_LEVEL, sizeof(GLenum), &mipLevel, &retSize); |
| 607 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 608 |
EXPECT_EQ(glTextureObj->getMiplevel(), mipLevel); |
| 609 |
EXPECT_EQ(sizeof(GLint), retSize); |
| 610 |
|
| 611 |
retVal = clGetGLTextureInfo(glImage, CL_INVALID_VALUE, 0, nullptr, nullptr); |
| 612 |
EXPECT_EQ(CL_INVALID_VALUE, retVal); |
| 613 |
|
| 614 |
auto image = castToObject<Image>(glImage); |
| 615 |
EXPECT_EQ(mipLevel, image->peekBaseMipLevel()); |
| 616 |
|
| 617 |
retVal = clReleaseMemObject(glImage); |
| 618 |
EXPECT_EQ(CL_SUCCESS, retVal); |
| 619 |
} |
| 620 |
|
| 621 |
TEST_P(GetGlTextureInfoTests, givenApiTargetTypeWhenAskedForBaseTypeThenConvertOnlyCubeMaps) { |
| 622 |
tempMM->useForcedGmm = false; |
| 623 |
auto apiTarget = GetParam(); |
| 624 |
unsigned int expectedBaseType; |
| 625 |
|
| 626 |
switch (apiTarget) { |
| 627 |
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: |
| 628 |
case GL_TEXTURE_CUBE_MAP_POSITIVE_X: |
| 629 |
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: |
| 630 |
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: |
| 631 |
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: |
| 632 |
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: |
| 633 |
expectedBaseType = GL_TEXTURE_CUBE_MAP_ARB; |
| 634 |
break; |
| 635 |
default: |
| 636 |
expectedBaseType = apiTarget; |
| 637 |
break; |
| 638 |
} |
| 639 |
|
| 640 |
EXPECT_EQ(GlTexture::getBaseTargetType(apiTarget), expectedBaseType); |
| 641 |
} |
| 642 |
|
| 643 |
TEST_P(GetGlTextureInfoTests, givenApiTargetTypeWhenAskedForGmmCubeFaceIndexThenReturnValidOnlyForCubeType) { |
| 644 |
tempMM->useForcedGmm = false; |
| 645 |
auto apiTarget = GetParam(); |
| 646 |
auto gmmCubeFaceIndex = static_cast<unsigned int>(GmmTypesConverter::getCubeFaceIndex(apiTarget)); |
| 647 |
|
| 648 |
switch (apiTarget) { |
| 649 |
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: |
| 650 |
EXPECT_EQ(gmmCubeFaceIndex, static_cast<unsigned int>(__GMM_CUBE_FACE_NEG_X)); |
| 651 |
break; |
| 652 |
case GL_TEXTURE_CUBE_MAP_POSITIVE_X: |
| 653 |
EXPECT_EQ(gmmCubeFaceIndex, static_cast<unsigned int>(__GMM_CUBE_FACE_POS_X)); |
| 654 |
break; |
| 655 |
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: |
| 656 |
EXPECT_EQ(gmmCubeFaceIndex, static_cast<unsigned int>(__GMM_CUBE_FACE_NEG_Y)); |
| 657 |
break; |
| 658 |
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: |
| 659 |
EXPECT_EQ(gmmCubeFaceIndex, static_cast<unsigned int>(__GMM_CUBE_FACE_POS_Y)); |
| 660 |
break; |
| 661 |
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: |
| 662 |
EXPECT_EQ(gmmCubeFaceIndex, static_cast<unsigned int>(__GMM_CUBE_FACE_NEG_Z)); |
| 663 |
break; |
| 664 |
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: |
| 665 |
EXPECT_EQ(gmmCubeFaceIndex, static_cast<unsigned int>(__GMM_CUBE_FACE_POS_Z)); |
| 666 |
break; |
| 667 |
default: |
| 668 |
EXPECT_EQ(gmmCubeFaceIndex, static_cast<unsigned int>(__GMM_NO_CUBE_MAP)); |
| 669 |
break; |
| 670 |
} |
| 671 |
} |