Handle GL applications changing BASE_LEVEL / MAX_LEVEL dynamically

* This is the only way in GL to do rendering from one mip to another. We handle
  it and display the whole texture even if it's temporarily constricted, and
  display the mip state in the pipeline viewer.
* If the mip state is constricted at the start of the frame capture, only mips
  0..MAX will be visible at all and other mips will be assumed to not be valid.
This commit is contained in:
baldurk
2019-01-14 18:02:44 +00:00
parent 2afcd9868a
commit 145f4bdb15
11 changed files with 273 additions and 29 deletions
+6 -6
View File
@@ -212,7 +212,7 @@ struct Texture
bool operator==(const Texture &o) const
{
return resourceId == o.resourceId && firstSlice == o.firstSlice && firstMip == o.firstMip &&
return resourceId == o.resourceId && firstMip == o.firstMip && numMips == o.numMips &&
type == o.type && swizzle[0] == o.swizzle[0] && swizzle[1] == o.swizzle[1] &&
swizzle[2] == o.swizzle[2] && swizzle[3] == o.swizzle[3] &&
depthReadChannel == o.depthReadChannel;
@@ -221,10 +221,10 @@ struct Texture
{
if(!(resourceId == o.resourceId))
return resourceId < o.resourceId;
if(!(firstSlice == o.firstSlice))
return firstSlice < o.firstSlice;
if(!(firstMip == o.firstMip))
return firstMip < o.firstMip;
if(!(numMips == o.numMips))
return numMips < o.numMips;
if(!(type == o.type))
return type < o.type;
if(!(swizzle[0] == o.swizzle[0]))
@@ -241,10 +241,10 @@ struct Texture
}
DOCUMENT("The :class:`ResourceId` of the underlying resource the view refers to.");
ResourceId resourceId;
DOCUMENT("Valid for texture arrays or 3D textures - the first slice available.");
uint32_t firstSlice = 0;
DOCUMENT("Valid for textures - the highest mip that is available.");
DOCUMENT("Valid for textures - the first mip that is available.");
uint32_t firstMip = 0;
DOCUMENT("Valid for textures - the number of mips that are available.");
uint32_t numMips = 0;
DOCUMENT("The :class:`TextureType` of the texture.");
TextureType type = TextureType::Unknown;
+1 -1
View File
@@ -1071,7 +1071,7 @@ rdcarray<BoundResourceArray> PipeState::GetReadOnlyResources(ShaderStage stage)
val.resourceId = m_GL->textures[i].resourceId;
val.firstMip = (int)m_GL->textures[i].firstMip;
val.firstSlice = (int)m_GL->textures[i].firstSlice;
val.firstSlice = 0;
val.typeHint = CompType::Typeless;
ret.push_back(BoundResourceArray(key, {val}));