Commit 889faf04 by Alexis Hetu Committed by Alexis Hétu

Fixed a couple of regressions from namespace refactoring

From the ES3 spec, section 4.4.2 (about DeleteRenderbuffers): "Unused names in renderbuffers are silently ignored, as is the value zero." And from section 6.1.5: "IsSampler will return TRUE if sampler is the name of a sampler object previously returned from a call to GenSamplers and FALSE otherwise". Also, glIsSampler can use Context::isSampler(), which uses ResourceManager::isSampler(), which should only look whether a name has been reserved, not whether the object is allocated. Note: Even though the spec mentions (about Sampler objects): "they acquire state only when they are first used as a parameter to BindSampler, SamplerParameter*, GetSamplerParameter*, or IsSampler", it shouldn't hurt to not allocate the object when calling IsSampler, since a subsequent call to any other Sampler object related function should allocate it. Change-Id: I69c9d8bbcf93231747b913c0afbd970c78d02cf1 Reviewed-on: https://swiftshader-review.googlesource.com/5161Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 094f2bf1
...@@ -987,7 +987,10 @@ void Context::deleteTexture(GLuint texture) ...@@ -987,7 +987,10 @@ void Context::deleteTexture(GLuint texture)
void Context::deleteRenderbuffer(GLuint renderbuffer) void Context::deleteRenderbuffer(GLuint renderbuffer)
{ {
detachRenderbuffer(renderbuffer); if(mResourceManager->getRenderbuffer(renderbuffer))
{
detachRenderbuffer(renderbuffer);
}
mResourceManager->deleteRenderbuffer(renderbuffer); mResourceManager->deleteRenderbuffer(renderbuffer);
} }
......
...@@ -341,7 +341,7 @@ void ResourceManager::checkSamplerAllocation(GLuint sampler) ...@@ -341,7 +341,7 @@ void ResourceManager::checkSamplerAllocation(GLuint sampler)
bool ResourceManager::isSampler(GLuint sampler) bool ResourceManager::isSampler(GLuint sampler)
{ {
return mSamplerNameSpace.find(sampler) != nullptr; return mSamplerNameSpace.isReserved(sampler);
} }
} }
...@@ -3392,9 +3392,7 @@ GL_APICALL GLboolean GL_APIENTRY glIsSampler(GLuint sampler) ...@@ -3392,9 +3392,7 @@ GL_APICALL GLboolean GL_APIENTRY glIsSampler(GLuint sampler)
if(context) if(context)
{ {
es2::Sampler *samplerObject = context->getSampler(sampler); if(context->isSampler(sampler))
if(samplerObject)
{ {
return GL_TRUE; return GL_TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment