Commit 778c28f2 by Alexis Hetu Committed by Alexis Hétu

Texture2DArray binding function

Texture2DArray textures can now be bound properly. Change-Id: I3516b67c266feaede3e63c30615bd9f2891c0f1b Reviewed-on: https://swiftshader-review.googlesource.com/3083Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent b7c46afa
...@@ -1223,6 +1223,13 @@ void Context::bindTexture3D(GLuint texture) ...@@ -1223,6 +1223,13 @@ void Context::bindTexture3D(GLuint texture)
mState.samplerTexture[TEXTURE_3D][mState.activeSampler] = getTexture(texture); mState.samplerTexture[TEXTURE_3D][mState.activeSampler] = getTexture(texture);
} }
void Context::bindTexture2DArray(GLuint texture)
{
mResourceManager->checkTextureAllocation(texture, TEXTURE_2D_ARRAY);
mState.samplerTexture[TEXTURE_2D_ARRAY][mState.activeSampler] = getTexture(texture);
}
void Context::bindReadFramebuffer(GLuint framebuffer) void Context::bindReadFramebuffer(GLuint framebuffer)
{ {
if(!getFramebuffer(framebuffer)) if(!getFramebuffer(framebuffer))
......
...@@ -516,6 +516,7 @@ public: ...@@ -516,6 +516,7 @@ public:
void bindTextureCubeMap(GLuint texture); void bindTextureCubeMap(GLuint texture);
void bindTextureExternal(GLuint texture); void bindTextureExternal(GLuint texture);
void bindTexture3D(GLuint texture); void bindTexture3D(GLuint texture);
void bindTexture2DArray(GLuint texture);
void bindReadFramebuffer(GLuint framebuffer); void bindReadFramebuffer(GLuint framebuffer);
void bindDrawFramebuffer(GLuint framebuffer); void bindDrawFramebuffer(GLuint framebuffer);
void bindRenderbuffer(GLuint renderbuffer); void bindRenderbuffer(GLuint renderbuffer);
......
...@@ -546,27 +546,23 @@ void BindTexture(GLenum target, GLuint texture) ...@@ -546,27 +546,23 @@ void BindTexture(GLenum target, GLuint texture)
{ {
case GL_TEXTURE_2D: case GL_TEXTURE_2D:
context->bindTexture2D(texture); context->bindTexture2D(texture);
return; break;
case GL_TEXTURE_CUBE_MAP: case GL_TEXTURE_CUBE_MAP:
context->bindTextureCubeMap(texture); context->bindTextureCubeMap(texture);
return; break;
case GL_TEXTURE_EXTERNAL_OES: case GL_TEXTURE_EXTERNAL_OES:
context->bindTextureExternal(texture); context->bindTextureExternal(texture);
return; break;
case GL_TEXTURE_2D_ARRAY: case GL_TEXTURE_2D_ARRAY:
if(clientVersion < 3) if(clientVersion < 3)
{ {
return error(GL_INVALID_ENUM); return error(GL_INVALID_ENUM);
} }
else context->bindTexture2DArray(texture);
{ break;
UNIMPLEMENTED();
context->bindTexture3D(texture);
break;
}
case GL_TEXTURE_3D_OES: case GL_TEXTURE_3D_OES:
context->bindTexture3D(texture); context->bindTexture3D(texture);
return; break;
default: default:
return error(GL_INVALID_ENUM); return error(GL_INVALID_ENUM);
} }
......
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