void fillWithComponentGradients (const PixelBufferAccess& access, const Vec4& minVal, const Vec4& maxVal)
{
- if (access.getHeight() == 1 && access.getDepth() == 1)
- fillWithComponentGradients1D(access, minVal, maxVal);
- else if (access.getDepth() == 1)
- fillWithComponentGradients2D(access, minVal, maxVal);
+ if (isCombinedDepthStencilType(access.getFormat().type))
+ {
+ const bool hasDepth = access.getFormat().order == tcu::TextureFormat::DS || access.getFormat().order == tcu::TextureFormat::D;
+ const bool hasStencil = access.getFormat().order == tcu::TextureFormat::DS || access.getFormat().order == tcu::TextureFormat::S;
+
+ DE_ASSERT(hasDepth || hasStencil);
+
+ // For combined formats, treat D and S as separate channels
+ if (hasDepth)
+ fillWithComponentGradients(getEffectiveDepthStencilAccess(access, tcu::Sampler::MODE_DEPTH), minVal, maxVal);
+ if (hasStencil)
+ fillWithComponentGradients(getEffectiveDepthStencilAccess(access, tcu::Sampler::MODE_STENCIL), minVal.swizzle(3,2,1,0), maxVal.swizzle(3,2,1,0));
+ }
else
- fillWithComponentGradients3D(access, minVal, maxVal);
+ {
+ if (access.getHeight() == 1 && access.getDepth() == 1)
+ fillWithComponentGradients1D(access, minVal, maxVal);
+ else if (access.getDepth() == 1)
+ fillWithComponentGradients2D(access, minVal, maxVal);
+ else
+ fillWithComponentGradients3D(access, minVal, maxVal);
+ }
}
-void fillWithGrid1D (const PixelBufferAccess& access, int cellSize, const Vec4& colorA, const Vec4& colorB)
+static void fillWithGrid1D (const PixelBufferAccess& access, int cellSize, const Vec4& colorA, const Vec4& colorB)
{
for (int x = 0; x < access.getWidth(); x++)
{
}
}
-void fillWithGrid2D (const PixelBufferAccess& access, int cellSize, const Vec4& colorA, const Vec4& colorB)
+static void fillWithGrid2D (const PixelBufferAccess& access, int cellSize, const Vec4& colorA, const Vec4& colorB)
{
for (int y = 0; y < access.getHeight(); y++)
{
}
}
-void fillWithGrid3D (const PixelBufferAccess& access, int cellSize, const Vec4& colorA, const Vec4& colorB)
+static void fillWithGrid3D (const PixelBufferAccess& access, int cellSize, const Vec4& colorA, const Vec4& colorB)
{
for (int z = 0; z < access.getDepth(); z++)
{
void fillWithGrid (const PixelBufferAccess& access, int cellSize, const Vec4& colorA, const Vec4& colorB)
{
- if (access.getHeight() == 1 && access.getDepth() == 1)
- fillWithGrid1D(access, cellSize, colorA, colorB);
- else if (access.getDepth() == 1)
- fillWithGrid2D(access, cellSize, colorA, colorB);
+ if (isCombinedDepthStencilType(access.getFormat().type))
+ {
+ const bool hasDepth = access.getFormat().order == tcu::TextureFormat::DS || access.getFormat().order == tcu::TextureFormat::D;
+ const bool hasStencil = access.getFormat().order == tcu::TextureFormat::DS || access.getFormat().order == tcu::TextureFormat::S;
+
+ DE_ASSERT(hasDepth || hasStencil);
+
+ // For combined formats, treat D and S as separate channels
+ if (hasDepth)
+ fillWithComponentGradients(getEffectiveDepthStencilAccess(access, tcu::Sampler::MODE_DEPTH), colorA, colorB);
+ if (hasStencil)
+ fillWithComponentGradients(getEffectiveDepthStencilAccess(access, tcu::Sampler::MODE_STENCIL), colorA.swizzle(3,2,1,0), colorB.swizzle(3,2,1,0));
+ }
else
- fillWithGrid3D(access, cellSize, colorA, colorB);
+ {
+ if (access.getHeight() == 1 && access.getDepth() == 1)
+ fillWithGrid1D(access, cellSize, colorA, colorB);
+ else if (access.getDepth() == 1)
+ fillWithGrid2D(access, cellSize, colorA, colorB);
+ else
+ fillWithGrid3D(access, cellSize, colorA, colorB);
+ }
}
void fillWithRepeatableGradient (const PixelBufferAccess& access, const Vec4& colorA, const Vec4& colorB)
const bool srcTightlyPacked = (srcPixelSize == srcPixelPitch);
const bool dstTightlyPacked = (dstPixelSize == dstPixelPitch);
+ const bool srcHasDepth = (src.getFormat().order == tcu::TextureFormat::DS || src.getFormat().order == tcu::TextureFormat::D);
+ const bool srcHasStencil = (src.getFormat().order == tcu::TextureFormat::DS || src.getFormat().order == tcu::TextureFormat::S);
+ const bool dstHasDepth = (dst.getFormat().order == tcu::TextureFormat::DS || dst.getFormat().order == tcu::TextureFormat::D);
+ const bool dstHasStencil = (dst.getFormat().order == tcu::TextureFormat::DS || dst.getFormat().order == tcu::TextureFormat::S);
+
if (src.getFormat() == dst.getFormat() && srcTightlyPacked && dstTightlyPacked)
{
// Fast-path for matching formats.
for (int x = 0; x < width; x++)
deMemcpy(dst.getPixelPtr(x, y, z), src.getPixelPtr(x, y, z), srcPixelSize);
}
+ else if (srcHasDepth || srcHasStencil || dstHasDepth || dstHasStencil)
+ {
+ DE_ASSERT((srcHasDepth && dstHasDepth) || (srcHasStencil && dstHasStencil)); // must have at least one common channel
+
+ if (dstHasDepth && srcHasDepth)
+ {
+ for (int z = 0; z < depth; z++)
+ for (int y = 0; y < height; y++)
+ for (int x = 0; x < width; x++)
+ dst.setPixDepth(src.getPixDepth(x, y, z), x, y, z);
+ }
+ else if (dstHasDepth && !srcHasDepth)
+ {
+ // consistency with color copies
+ tcu::clearDepth(dst, 0.0f);
+ }
+
+ if (dstHasStencil && srcHasStencil)
+ {
+ for (int z = 0; z < depth; z++)
+ for (int y = 0; y < height; y++)
+ for (int x = 0; x < width; x++)
+ dst.setPixStencil(src.getPixStencil(x, y, z), x, y, z);
+ }
+ else if (dstHasStencil && !srcHasStencil)
+ {
+ // consistency with color copies
+ tcu::clearStencil(dst, 0u);
+ }
+ }
else
{
TextureChannelClass srcClass = getTextureChannelClass(src.getFormat().type);
m_emptyTex1D.getSampler().magFilter = tcu::Sampler::NEAREST;
m_emptyTex1D.allocLevel(0, tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8), 1);
m_emptyTex1D.getLevel(0).setPixel(Vec4(0.0f, 0.0f, 0.0f, 1.0f), 0, 0);
- m_emptyTex1D.updateView();
+ m_emptyTex1D.updateView(tcu::Sampler::MODE_LAST);
m_emptyTex2D.getSampler().wrapS = tcu::Sampler::CLAMP_TO_EDGE;
m_emptyTex2D.getSampler().wrapT = tcu::Sampler::CLAMP_TO_EDGE;
m_emptyTex2D.getSampler().magFilter = tcu::Sampler::NEAREST;
m_emptyTex2D.allocLevel(0, tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8), 1, 1);
m_emptyTex2D.getLevel(0).setPixel(Vec4(0.0f, 0.0f, 0.0f, 1.0f), 0, 0);
- m_emptyTex2D.updateView();
+ m_emptyTex2D.updateView(tcu::Sampler::MODE_LAST);
m_emptyTexCube.getSampler().wrapS = tcu::Sampler::CLAMP_TO_EDGE;
m_emptyTexCube.getSampler().wrapT = tcu::Sampler::CLAMP_TO_EDGE;
m_emptyTexCube.allocFace(0, (tcu::CubeFace)face, tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8), 1, 1);
m_emptyTexCube.getFace(0, (tcu::CubeFace)face).setPixel(Vec4(0.0f, 0.0f, 0.0f, 1.0f), 0, 0);
}
- m_emptyTexCube.updateView();
+ m_emptyTexCube.updateView(tcu::Sampler::MODE_LAST);
m_emptyTex2DArray.getSampler().wrapS = tcu::Sampler::CLAMP_TO_EDGE;
m_emptyTex2DArray.getSampler().wrapT = tcu::Sampler::CLAMP_TO_EDGE;
m_emptyTex2DArray.getSampler().magFilter = tcu::Sampler::NEAREST;
m_emptyTex2DArray.allocLevel(0, tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8), 1, 1, 1);
m_emptyTex2DArray.getLevel(0).setPixel(Vec4(0.0f, 0.0f, 0.0f, 1.0f), 0, 0);
- m_emptyTex2DArray.updateView();
+ m_emptyTex2DArray.updateView(tcu::Sampler::MODE_LAST);
m_emptyTex3D.getSampler().wrapS = tcu::Sampler::CLAMP_TO_EDGE;
m_emptyTex3D.getSampler().wrapT = tcu::Sampler::CLAMP_TO_EDGE;
m_emptyTex3D.getSampler().magFilter = tcu::Sampler::NEAREST;
m_emptyTex3D.allocLevel(0, tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8), 1, 1, 1);
m_emptyTex3D.getLevel(0).setPixel(Vec4(0.0f, 0.0f, 0.0f, 1.0f), 0, 0);
- m_emptyTex3D.updateView();
+ m_emptyTex3D.updateView(tcu::Sampler::MODE_LAST);
m_emptyTexCubeArray.getSampler().wrapS = tcu::Sampler::CLAMP_TO_EDGE;
m_emptyTexCubeArray.getSampler().wrapT = tcu::Sampler::CLAMP_TO_EDGE;
m_emptyTexCubeArray.allocLevel(0, tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8), 1, 1, 6);
for (int faceNdx = 0; faceNdx < 6; faceNdx++)
m_emptyTexCubeArray.getLevel(0).setPixel(Vec4(0.0f, 0.0f, 0.0f, 1.0f), 0, 0, faceNdx);
- m_emptyTexCubeArray.updateView();
+ m_emptyTexCubeArray.updateView(tcu::Sampler::MODE_LAST);
if (glu::isContextTypeGLCore(getType()))
m_sRGBUpdateEnabled = false;
DE_ASSERT(src.getWidth() == width && src.getHeight() == height && src.getDepth() == depth);
// clamping copy
- for (int z = 0; z < depth; z++)
- for (int y = 0; y < height; y++)
- for (int x = 0; x < width; x++)
+
+ if (src.getFormat().order == tcu::TextureFormat::DS && dst.getFormat().order == tcu::TextureFormat::DS)
{
- const Vec4 data = src.getPixel(x, y, z);
- dst.setPixel(Vec4(de::clamp(data.x(), 0.0f, 1.0f), data.y(), data.z(), data.w()), x, y, z);
+ // copy only depth and stencil
+ for (int z = 0; z < depth; z++)
+ for (int y = 0; y < height; y++)
+ for (int x = 0; x < width; x++)
+ {
+ dst.setPixDepth(de::clamp(src.getPixDepth(x, y, z), 0.0f, 1.0f), x, y, z);
+ dst.setPixStencil(src.getPixStencil(x, y, z), x, y, z);
+ }
+ }
+ else
+ {
+ // copy only depth
+ for (int z = 0; z < depth; z++)
+ for (int y = 0; y < height; y++)
+ for (int x = 0; x < width; x++)
+ dst.setPixDepth(de::clamp(src.getPixDepth(x, y, z), 0.0f, 1.0f), x, y, z);
}
}
texImage3D(target, level, internalFormat, width, height, 1, border, format, type, data);
}
+static void clearToTextureInitialValue (PixelBufferAccess access)
+{
+ const bool hasDepth = access.getFormat().order == tcu::TextureFormat::D || access.getFormat().order == tcu::TextureFormat::DS;
+ const bool hasStencil = access.getFormat().order == tcu::TextureFormat::S || access.getFormat().order == tcu::TextureFormat::DS;
+ const bool hasColor = !hasDepth && !hasStencil;
+
+ if (hasDepth)
+ tcu::clearDepth(access, 0.0f);
+ if (hasStencil)
+ tcu::clearStencil(access, 0u);
+ if (hasColor)
+ tcu::clear(access, Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+}
+
void ReferenceContext::texImage3D (deUint32 target, int level, deUint32 internalFormat, int width, int height, int depth, int border, deUint32 format, deUint32 type, const void* data)
{
TextureUnit& unit = m_textureUnits[m_activeTexture];
}
else
{
- // No data supplied, clear to black.
- PixelBufferAccess dst = texture->getLevel(level);
- tcu::clear(dst, Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+ // No data supplied, clear to initial
+ clearToTextureInitialValue(texture->getLevel(level));
}
}
else if (target == GL_TEXTURE_2D)
}
else
{
- // No data supplied, clear to black.
- PixelBufferAccess dst = texture->getLevel(level);
- tcu::clear(dst, Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+ // No data supplied, clear to initial
+ clearToTextureInitialValue(texture->getLevel(level));
}
}
else if (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
}
else
{
- // No data supplied, clear to black.
- PixelBufferAccess dst = texture->getFace(level, face);
- tcu::clear(dst, Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+ // No data supplied, clear to initial
+ clearToTextureInitialValue(texture->getFace(level, face));
}
}
else if (target == GL_TEXTURE_2D_ARRAY)
}
else
{
- // No data supplied, clear to black.
- PixelBufferAccess dst = texture->getLevel(level);
- tcu::clear(dst, Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+ // No data supplied, clear to initial
+ clearToTextureInitialValue(texture->getLevel(level));
}
}
else if (target == GL_TEXTURE_3D)
}
else
{
- // No data supplied, clear to black.
- PixelBufferAccess dst = texture->getLevel(level);
- tcu::clear(dst, Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+ // No data supplied, clear to initial
+ clearToTextureInitialValue(texture->getLevel(level));
}
}
else if (target == GL_TEXTURE_CUBE_MAP_ARRAY)
}
else
{
- // No data supplied, clear to black.
- PixelBufferAccess dst = texture->getLevel(level);
- tcu::clear(dst, Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+ // No data supplied, clear to initial
+ clearToTextureInitialValue(texture->getLevel(level));
}
}
else
if ((mask & GL_DEPTH_BUFFER_BIT) && m_depthMask)
{
- rr::MultisampleConstPixelBufferAccess src = rr::getSubregion(getReadDepthbuffer(), srcRect.x(), srcRect.y(), srcRect.z(), srcRect.w());
- rr::MultisamplePixelBufferAccess dst = rr::getSubregion(getDrawDepthbuffer(), dstRect.x(), dstRect.y(), dstRect.z(), dstRect.w());
+ rr::MultisampleConstPixelBufferAccess src = getDepthMultisampleAccess(rr::getSubregion(getReadDepthbuffer(), srcRect.x(), srcRect.y(), srcRect.z(), srcRect.w()));
+ rr::MultisamplePixelBufferAccess dst = getDepthMultisampleAccess(rr::getSubregion(getDrawDepthbuffer(), dstRect.x(), dstRect.y(), dstRect.z(), dstRect.w()));
for (int yo = 0; yo < dstRect.w(); yo++)
{
float sX = transform(0, 0)*dX + transform(0, 1)*dY + transform(0, 2);
float sY = transform(1, 0)*dX + transform(1, 1)*dY + transform(1, 2);
- writeDepthOnly(dst, sampleNdx, xo, yo, src.raw().getPixel(sampleNdx, deFloorFloatToInt32(sX), deFloorFloatToInt32(sY)).x());
+ writeDepthOnly(dst, sampleNdx, xo, yo, src.raw().getPixDepth(sampleNdx, deFloorFloatToInt32(sX), deFloorFloatToInt32(sY)));
}
}
}
return;
rr::MultisamplePixelBufferAccess colorBuf0 = getDrawColorbuffer();
- rr::MultisamplePixelBufferAccess depthBuf = getDrawDepthbuffer();
- rr::MultisamplePixelBufferAccess stencilBuf = getDrawStencilbuffer();
+ rr::MultisamplePixelBufferAccess depthBuf = getDepthMultisampleAccess(getDrawDepthbuffer());
+ rr::MultisamplePixelBufferAccess stencilBuf = getStencilMultisampleAccess(getDrawStencilbuffer());
const bool hasStencil = !isEmpty(stencilBuf);
const int stencilBits = (hasStencil) ? (getNumStencilBits(stencilBuf.raw().getFormat())) : (0);
// Set shader samplers
for (size_t uniformNdx = 0; uniformNdx < m_currentProgram->m_program->m_uniforms.size(); ++uniformNdx)
{
- const int texNdx = m_currentProgram->m_program->m_uniforms[uniformNdx].value.i;
+ const tcu::Sampler::DepthStencilMode depthStencilMode = tcu::Sampler::MODE_DEPTH; // \todo[jarkko] support sampler state
+ const int texNdx = m_currentProgram->m_program->m_uniforms[uniformNdx].value.i;
switch (m_currentProgram->m_program->m_uniforms[uniformNdx].type)
{
if (tex && tex->isComplete())
{
- tex->updateView();
+ tex->updateView(depthStencilMode);
m_currentProgram->m_program->m_uniforms[uniformNdx].sampler.tex1D = tex;
}
else
if (tex && tex->isComplete())
{
- tex->updateView();
+ tex->updateView(depthStencilMode);
m_currentProgram->m_program->m_uniforms[uniformNdx].sampler.tex2D = tex;
}
else
if (tex && tex->isComplete())
{
- tex->updateView();
+ tex->updateView(depthStencilMode);
m_currentProgram->m_program->m_uniforms[uniformNdx].sampler.texCube = tex;
}
else
if (tex && tex->isComplete())
{
- tex->updateView();
+ tex->updateView(depthStencilMode);
m_currentProgram->m_program->m_uniforms[uniformNdx].sampler.tex2DArray = tex;
}
else
if (tex && tex->isComplete())
{
- tex->updateView();
+ tex->updateView(depthStencilMode);
m_currentProgram->m_program->m_uniforms[uniformNdx].sampler.tex3D = tex;
}
else
if (tex && tex->isComplete())
{
- tex->updateView();
+ tex->updateView(depthStencilMode);
m_currentProgram->m_program->m_uniforms[uniformNdx].sampler.texCubeArray = tex;
}
else
m_access[level] = PixelBufferAccess();
}
+void TextureLevelArray::updateSamplerMode (tcu::Sampler::DepthStencilMode mode)
+{
+ for (int levelNdx = 0; hasLevel(levelNdx); ++levelNdx)
+ m_effectiveAccess[levelNdx] = tcu::getEffectiveDepthStencilAccess(m_access[levelNdx], mode);
+}
+
Texture::Texture (deUint32 name, Type type)
: NamedObject (name)
, m_type (type)
}
}
-void Texture1D::updateView (void)
+void Texture1D::updateView (tcu::Sampler::DepthStencilMode mode)
{
const int baseLevel = getBaseLevel();
const bool isMipmap = isMipmapFilter(getSampler().minFilter);
const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels1D(width)) : 1;
- m_view = tcu::Texture2DView(numLevels, m_levels.getLevels() + baseLevel);
+ m_levels.updateSamplerMode(mode);
+ m_view = tcu::Texture2DView(numLevels, m_levels.getEffectiveLevels() + baseLevel);
}
else
m_view = tcu::Texture2DView(0, DE_NULL);
return false;
}
-void Texture2D::updateView (void)
+void Texture2D::updateView (tcu::Sampler::DepthStencilMode mode)
{
const int baseLevel = getBaseLevel();
const bool isMipmap = isMipmapFilter(getSampler().minFilter);
const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels2D(width, height)) : 1;
- m_view = tcu::Texture2DView(numLevels, m_levels.getLevels() + baseLevel);
+ m_levels.updateSamplerMode(mode);
+ m_view = tcu::Texture2DView(numLevels, m_levels.getEffectiveLevels() + baseLevel);
}
else
m_view = tcu::Texture2DView(0, DE_NULL);
return false;
}
-void TextureCube::updateView (void)
+void TextureCube::updateView (tcu::Sampler::DepthStencilMode mode)
{
const int baseLevel = getBaseLevel();
const tcu::ConstPixelBufferAccess* faces[tcu::CUBEFACE_LAST];
const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels1D(size)) : 1;
for (int face = 0; face < tcu::CUBEFACE_LAST; face++)
- faces[face] = m_levels[face].getLevels() + baseLevel;
+ {
+ m_levels[face].updateSamplerMode(mode);
+ faces[face] = m_levels[face].getEffectiveLevels() + baseLevel;
+ }
m_view = tcu::TextureCubeView(numLevels, faces);
}
return false;
}
-void Texture2DArray::updateView (void)
+void Texture2DArray::updateView (tcu::Sampler::DepthStencilMode mode)
{
const int baseLevel = getBaseLevel();
const bool isMipmap = isMipmapFilter(getSampler().minFilter);
const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels2D(width, height)) : 1;
- m_view = tcu::Texture2DArrayView(numLevels, m_levels.getLevels() + baseLevel);
+ m_levels.updateSamplerMode(mode);
+ m_view = tcu::Texture2DArrayView(numLevels, m_levels.getEffectiveLevels() + baseLevel);
}
else
m_view = tcu::Texture2DArrayView(0, DE_NULL);
return false;
}
-void TextureCubeArray::updateView (void)
+void TextureCubeArray::updateView (tcu::Sampler::DepthStencilMode mode)
{
const int baseLevel = getBaseLevel();
const bool isMipmap = isMipmapFilter(getSampler().minFilter);
const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels2D(width, height)) : 1;
- m_view = tcu::TextureCubeArrayView(numLevels, m_levels.getLevels() + baseLevel);
+ m_levels.updateSamplerMode(mode);
+ m_view = tcu::TextureCubeArrayView(numLevels, m_levels.getEffectiveLevels() + baseLevel);
}
else
m_view = tcu::TextureCubeArrayView(0, DE_NULL);
}
}
-void Texture3D::updateView (void)
+void Texture3D::updateView (tcu::Sampler::DepthStencilMode mode)
{
const int baseLevel = getBaseLevel();
const bool isMipmap = isMipmapFilter(getSampler().minFilter);
const int numLevels = isMipmap ? de::min(getMaxLevel()-baseLevel+1, getNumMipLevels3D(width, height, depth)) : 1;
- m_view = tcu::Texture3DView(numLevels, m_levels.getLevels() + baseLevel);
+ m_levels.updateSamplerMode(mode);
+ m_view = tcu::Texture3DView(numLevels, m_levels.getEffectiveLevels() + baseLevel);
}
else
m_view = tcu::Texture3DView(0, DE_NULL);
const tcu::ConstPixelBufferAccess& getLevel (int level) const { DE_ASSERT(hasLevel(level)); return m_access[level]; }
const tcu::ConstPixelBufferAccess* getLevels (void) const { return &m_access[0]; }
+ const tcu::ConstPixelBufferAccess* getEffectiveLevels (void) const { return &m_effectiveAccess[0]; }
void allocLevel (int level, const tcu::TextureFormat& format, int width, int height, int depth);
void clearLevel (int level);
void clear (void);
+ void updateSamplerMode (tcu::Sampler::DepthStencilMode);
+
private:
de::ArrayBuffer<deUint8> m_data[MAX_TEXTURE_SIZE_LOG2];
tcu::PixelBufferAccess m_access[MAX_TEXTURE_SIZE_LOG2];
+ tcu::ConstPixelBufferAccess m_effectiveAccess[MAX_TEXTURE_SIZE_LOG2]; //!< the currently effective sampling mode. For Depth-stencil texture always either Depth or stencil.
};
class Texture1D : public Texture
bool isComplete (void) const;
- void updateView (void); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
+ void updateView (tcu::Sampler::DepthStencilMode mode); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
tcu::Vec4 sample (float s, float lod) const;
void sample4 (tcu::Vec4 output[4], const float packetTexcoords[4], float lodBias = 0.0f) const;
bool isComplete (void) const;
- void updateView (void); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
+ void updateView (tcu::Sampler::DepthStencilMode mode); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
tcu::Vec4 sample (float s, float t, float lod) const;
void sample4 (tcu::Vec4 output[4], const tcu::Vec2 packetTexcoords[4], float lodBias = 0.0f) const;
void allocFace (int level, tcu::CubeFace face, const tcu::TextureFormat& format, int width, int height);
bool isComplete (void) const;
- void updateView (void); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
+ void updateView (tcu::Sampler::DepthStencilMode mode); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
tcu::Vec4 sample (float s, float t, float p, float lod) const;
void sample4 (tcu::Vec4 output[4], const tcu::Vec3 packetTexcoords[4], float lodBias = 0.0f) const;
bool isComplete (void) const;
- void updateView (void); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
+ void updateView (tcu::Sampler::DepthStencilMode mode); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
tcu::Vec4 sample (float s, float t, float r, float lod) const;
void sample4 (tcu::Vec4 output[4], const tcu::Vec3 packetTexcoords[4], float lodBias = 0.0f) const;
bool isComplete (void) const;
- void updateView (void); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
+ void updateView (tcu::Sampler::DepthStencilMode mode); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
tcu::Vec4 sample (float s, float t, float r, float lod) const;
void sample4 (tcu::Vec4 output[4], const tcu::Vec3 packetTexcoords[4], float lodBias = 0.0f) const;
bool isComplete (void) const;
- void updateView (void); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
+ void updateView (tcu::Sampler::DepthStencilMode mode); // \note View must be refreshed after texture parameter/size changes, before calling sample*()
tcu::Vec4 sample (float s, float t, float r, float q, float lod) const;
void sample4 (tcu::Vec4 output[4], const tcu::Vec4 packetTexcoords[4], float lodBias = 0.0f) const;