Lines Matching defs:width
102 inline int getNumMipLevels2D (int width, int height)
104 return deLog2Floor32(de::max(width, height))+1;
107 inline int getNumMipLevels3D (int width, int height, int depth)
109 return deLog2Floor32(de::max(width, de::max(height, depth)))+1;
306 ReferenceContextBuffers::ReferenceContextBuffers (const tcu::PixelFormat& colorBits, int depthBits, int stencilBits, int width, int height, int samples)
308 m_colorbuffer.setStorage(toTextureFormat(colorBits), samples, width, height);
311 m_depthbuffer.setStorage(getDepthFormat(depthBits), samples, width, height);
314 m_stencilbuffer.setStorage(getStencilFormat(stencilBits), samples, width, height);
949 tcu::ConstPixelBufferAccess ReferenceContext::getUnpack2DAccess (const tcu::TextureFormat& format, int width, int height, const void* data)
952 int rowLen = m_pixelUnpackRowLength > 0 ? m_pixelUnpackRowLength : width;
956 return tcu::ConstPixelBufferAccess(format, width, height, 1, rowPitch, 0, ptr);
959 tcu::ConstPixelBufferAccess ReferenceContext::getUnpack3DAccess (const tcu::TextureFormat& format, int width, int height, int depth, const void* data)
962 int rowLen = m_pixelUnpackRowLength > 0 ? m_pixelUnpackRowLength : width;
968 return tcu::ConstPixelBufferAccess(format, width, height, depth, rowPitch, slicePitch, ptr);
988 int width = dst.getWidth();
992 DE_ASSERT(src.getWidth() == width && src.getHeight() == height && src.getDepth() == depth);
1001 for (int x = 0; x < width; x++)
1012 for (int x = 0; x < width; x++)
1017 void ReferenceContext::texImage1D (deUint32 target, int level, deUint32 internalFormat, int width, int border, deUint32 format, deUint32 type, const void* data)
1019 texImage2D(target, level, internalFormat, width, 1, border, format, type, data);
1022 void ReferenceContext::texImage2D (deUint32 target, int level, deUint32 internalFormat, int width, int height, int border, deUint32 format, deUint32 type, const void* data)
1024 texImage3D(target, level, internalFormat, width, height, 1, border, format, type, data);
1041 void ReferenceContext::texImage3D (deUint32 target, int level, deUint32 internalFormat, int width, int height, int depth, int border, deUint32 format, deUint32 type, const void* data)
1050 RC_IF_ERROR(width < 0 || height < 0 || depth < 0 || level < 0, GL_INVALID_VALUE, RC_RET_VOID);
1065 RC_IF_ERROR(width > m_limits.maxTexture2DSize || height != 1 || depth != 1, GL_INVALID_VALUE, RC_RET_VOID);
1076 width != dst.getWidth(), GL_INVALID_OPERATION, RC_RET_VOID);
1079 texture->allocLevel(level, storageFmt, width);
1083 ConstPixelBufferAccess src = getUnpack2DAccess(transferFmt, width, 1, unpackPtr);
1100 RC_IF_ERROR(width > m_limits.maxTexture2DSize || height > m_limits.maxTexture2DSize || depth != 1, GL_INVALID_VALUE, RC_RET_VOID);
1111 width != dst.getWidth() ||
1115 texture->allocLevel(level, storageFmt, width, height);
1119 ConstPixelBufferAccess src = getUnpack2DAccess(transferFmt, width, height, unpackPtr);
1141 RC_IF_ERROR(width != height || width > m_limits.maxTextureCubeSize || depth != 1, GL_INVALID_VALUE, RC_RET_VOID);
1153 width != dst.getWidth() ||
1157 texture->allocFace(level, face, storageFmt, width, height);
1161 ConstPixelBufferAccess src = getUnpack2DAccess(transferFmt, width, height, unpackPtr);
1178 RC_IF_ERROR(width > m_limits.maxTexture2DSize ||
1191 width != dst.getWidth() ||
1196 texture->allocLevel(level, storageFmt, width, height, depth);
1200 ConstPixelBufferAccess src = getUnpack3DAccess(transferFmt, width, height, depth, unpackPtr);
1217 RC_IF_ERROR(width > m_limits.maxTexture3DSize ||
1230 width != dst.getWidth() ||
1235 texture->allocLevel(level, storageFmt, width, height, depth);
1239 ConstPixelBufferAccess src = getUnpack3DAccess(transferFmt, width, height, depth, unpackPtr);
1256 RC_IF_ERROR(width != height ||
1257 width > m_limits.maxTexture2DSize ||
1270 width != dst.getWidth() ||
1275 texture->allocLevel(level, storageFmt, width, height, depth);
1279 ConstPixelBufferAccess src = getUnpack3DAccess(transferFmt, width, height, depth, unpackPtr);
1297 void ReferenceContext::texSubImage1D (deUint32 target, int level, int xoffset, int width, deUint32 format, deUint32 type, const void* data)
1299 texSubImage2D(target, level, xoffset, 0, width, 1, format, type, data);
1302 void ReferenceContext::texSubImage2D (deUint32 target, int level, int xoffset, int yoffset, int width, int height, deUint32 format, deUint32 type, const void* data)
1304 texSubImage3D(target, level, xoffset, yoffset, 0, width, height, 1, format, type, data);
1307 void ReferenceContext::texSubImage3D (deUint32 target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, deUint32 format, deUint32 type, const void* data)
1312 RC_IF_ERROR(width < 0 || height < 0 || depth < 0, GL_INVALID_VALUE, RC_RET_VOID);
1318 ConstPixelBufferAccess src = getUnpack3DAccess(transferFmt, width, height, depth, getPixelUnpackPtr(data));
1328 RC_IF_ERROR(xoffset + width > dst.getWidth() ||
1335 depthValueFloatClampCopy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1337 tcu::copy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1347 RC_IF_ERROR(xoffset + width > dst.getWidth() ||
1354 depthValueFloatClampCopy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1356 tcu::copy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1372 RC_IF_ERROR(xoffset + width > dst.getWidth() ||
1379 depthValueFloatClampCopy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1381 tcu::copy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1391 RC_IF_ERROR(xoffset + width > dst.getWidth() ||
1398 depthValueFloatClampCopy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1400 tcu::copy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1410 RC_IF_ERROR(xoffset + width > dst.getWidth() ||
1417 depthValueFloatClampCopy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1419 tcu::copy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1429 RC_IF_ERROR(xoffset + width > dst.getWidth() ||
1436 depthValueFloatClampCopy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1438 tcu::copy(tcu::getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth), src);
1444 void ReferenceContext::copyTexImage1D (deUint32 target, int level, deUint32 internalFormat, int x, int y, int width, int border)
1451 RC_IF_ERROR(width < 0 || level < 0, GL_INVALID_VALUE, RC_RET_VOID);
1462 RC_IF_ERROR(width > m_limits.maxTexture2DSize, GL_INVALID_VALUE, RC_RET_VOID);
1473 width != dst.getWidth(), GL_INVALID_OPERATION, RC_RET_VOID);
1476 texture->allocLevel(level, storageFmt, width);
1480 for (int xo = 0; xo < width; xo++)
1492 void ReferenceContext::copyTexImage2D (deUint32 target, int level, deUint32 internalFormat, int x, int y, int width, int height, int border)
1499 RC_IF_ERROR(width < 0 || height < 0 || level < 0, GL_INVALID_VALUE, RC_RET_VOID);
1510 RC_IF_ERROR(width > m_limits.maxTexture2DSize || height > m_limits.maxTexture2DSize, GL_INVALID_VALUE, RC_RET_VOID);
1521 width != dst.getWidth() ||
1525 texture->allocLevel(level, storageFmt, width, height);
1530 for (int xo = 0; xo < width; xo++)
1546 RC_IF_ERROR(width != height || width > m_limits.maxTextureCubeSize, GL_INVALID_VALUE, RC_RET_VOID);
1558 width != dst.getWidth() ||
1562 texture->allocFace(level, face, storageFmt, width, height);
1567 for (int xo = 0; xo < width; xo++)
1579 void ReferenceContext::copyTexSubImage1D (deUint32 target, int level, int xoffset, int x, int y, int width)
1585 RC_IF_ERROR(width < 0, GL_INVALID_VALUE, RC_RET_VOID);
1596 RC_IF_ERROR(xoffset + width > dst.getWidth(), GL_INVALID_VALUE, RC_RET_VOID);
1598 for (int xo = 0; xo < width; xo++)
1610 void ReferenceContext::copyTexSubImage2D (deUint32 target, int level, int xoffset, int yoffset, int x, int y, int width, int height)
1616 RC_IF_ERROR(width < 0 || height < 0, GL_INVALID_VALUE, RC_RET_VOID);
1627 RC_IF_ERROR(xoffset + width > dst.getWidth() ||
1632 for (int xo = 0; xo < width; xo++)
1654 RC_IF_ERROR(xoffset + width > dst.getWidth() ||
1659 for (int xo = 0; xo < width; xo++)
1671 void ReferenceContext::copyTexSubImage3D (deUint32 target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height)
1673 DE_UNREF(target && level && xoffset && yoffset && zoffset && x && y && width && height);
1677 void ReferenceContext::texStorage2D (deUint32 target, int levels, deUint32 internalFormat, int width, int height)
1682 RC_IF_ERROR(width <= 0 || height <= 0, GL_INVALID_VALUE, RC_RET_VOID);
1683 RC_IF_ERROR(!de::inRange(levels, 1, (int)deLog2Floor32(de::max(width, height))+1), GL_INVALID_VALUE, RC_RET_VOID);
1694 RC_IF_ERROR(width > m_limits.maxTexture2DSize || height >= m_limits.maxTexture2DSize, GL_INVALID_VALUE, RC_RET_VOID);
1702 int levelW = de::max(1, width >> level);
1712 RC_IF_ERROR(width > m_limits.maxTextureCubeSize || height > m_limits.maxTextureCubeSize, GL_INVALID_VALUE, RC_RET_VOID);
1720 int levelW = de::max(1, width >> level);
1731 void ReferenceContext::texStorage3D (deUint32 target, int levels, deUint32 internalFormat, int width, int height, int depth)
1736 RC_IF_ERROR(width <= 0 || height <= 0, GL_INVALID_VALUE, RC_RET_VOID);
1737 RC_IF_ERROR(!de::inRange(levels, 1, (int)deLog2Floor32(de::max(width, height))+1), GL_INVALID_VALUE, RC_RET_VOID);
1748 RC_IF_ERROR(width > m_limits.maxTexture2DSize ||
1758 int levelW = de::max(1, width >> level);
1768 RC_IF_ERROR(width > m_limits.maxTexture3DSize ||
1778 int levelW = de::max(1, width >> level);
1789 RC_IF_ERROR(width != height ||
1791 width > m_limits.maxTexture2DSize ||
1800 int levelW = de::max(1, width >> level);
2184 int width = -1;
2271 width = attachmentWidth;
2275 else if (attachmentWidth != width || attachmentHeight != height)
2328 void ReferenceContext::renderbufferStorage (deUint32 target, deUint32 internalformat, int width, int height)
2334 RC_IF_ERROR(!deInRange32(width, 0, m_limits.maxRenderbufferSize) ||
2340 m_renderbufferBinding->setStorage(format, (int)width, (int)height);
2343 void ReferenceContext::renderbufferStorageMultisample (deUint32 target, int samples, deUint32 internalFormat, int width, int height)
2347 renderbufferStorage(target, internalFormat, width, height);
2647 void ReferenceContext::scissor (int x, int y, int width, int height)
2649 RC_IF_ERROR(width < 0 || height < 0, GL_INVALID_VALUE, RC_RET_VOID);
2650 m_scissorBox = IVec4(x, y, width, height);
3151 // Negative width/height means swap.
3319 void ReferenceContext::invalidateSubFramebuffer (deUint32 target, int numAttachments, const deUint32* attachments, int x, int y, int width, int height)
3323 RC_IF_ERROR(width < 0 || height < 0, GL_INVALID_VALUE, RC_RET_VOID);
3363 tcu::IVec4 area = intersect(tcu::IVec4(0, 0, buf.raw().getHeight(), buf.raw().getDepth()), tcu::IVec4(x, y, width, height));
3381 int width = 0;
3384 width = de::max(width, colorBuf0.raw().getHeight());
3385 width = de::max(width, depthBuf.raw().getHeight());
3386 width = de::max(width, stencilBuf.raw().getHeight());
3392 invalidateSubFramebuffer(target, numAttachments, attachments, 0, 0, width, height);
4630 void ReferenceContext::readPixels (int x, int y, int width, int height, deUint32 format, deUint32 type, void* data)
4643 const int copyWidth = deClamp32(width, 0, src.raw().getHeight()-x);
4646 PixelBufferAccess dst(transferFmt, width, height, 1, deAlign32(width*transferFmt.getPixelSize(), m_pixelPackAlignment), 0, getPixelPackPtr(data));
4720 void TextureLevelArray::allocLevel (int level, const tcu::TextureFormat& format, int width, int height, int depth)
4722 const int dataSize = format.getPixelSize()*width*height*depth;
4730 m_access[level] = PixelBufferAccess(format, width, height, depth, m_data[level].getPtr());
4778 void Texture1D::allocLevel (int level, const tcu::TextureFormat& format, int width)
4780 m_levels.allocLevel(level, format, width, 1, 1);
4854 const int width = getLevel(baseLevel).getWidth();
4856 const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels1D(width)) : 1;
4875 void Texture2D::allocLevel (int level, const tcu::TextureFormat& format, int width, int height)
4877 m_levels.allocLevel(level, format, width, height, 1);
4927 const int width = getLevel(baseLevel).getWidth();
4930 const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels2D(width, height)) : 1;
4984 void TextureCube::allocFace (int level, tcu::CubeFace face, const tcu::TextureFormat& format, int width, int height)
4986 m_levels[face].allocLevel(level, format, width, height, 1);
4995 const int width = getFace(baseLevel, tcu::CUBEFACE_NEGATIVE_X).getWidth();
4999 const int numLevels = mipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels2D(width, height)) : 1;
5001 if (width != height)
5007 const int levelW = getMipLevelSize(width, levelNdx);
5107 void Texture2DArray::allocLevel (int level, const tcu::TextureFormat& format, int width, int height, int numLayers)
5109 m_levels.allocLevel(level, format, width, height, numLayers);
5160 const int width = getLevel(baseLevel).getWidth();
5163 const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels2D(width, height)) : 1;
5212 void TextureCubeArray::allocLevel (int level, const tcu::TextureFormat& format, int width, int height, int numLayers)
5215 m_levels.allocLevel(level, format, width, height, numLayers);
5266 const int width = getLevel(baseLevel).getWidth();
5269 const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels2D(width, height)) : 1;
5333 void Texture3D::allocLevel (int level, const tcu::TextureFormat& format, int width, int height, int depth)
5335 m_levels.allocLevel(level, format, width, height, depth);
5419 const int width = getLevel(baseLevel).getWidth();
5423 const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels3D(width, height, depth)) : 1;
5441 void Renderbuffer::setStorage (const TextureFormat& format, int width, int height)
5443 m_data.setStorage(format, width, height);