2014-09-18 02:08:41 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
#include "GLContext.h"
|
2014-09-18 02:08:41 +04:00
|
|
|
#include "WebGL2Context.h"
|
2014-10-14 03:42:29 +04:00
|
|
|
#include "WebGLContextUtils.h"
|
2015-07-15 03:37:28 +03:00
|
|
|
#include "WebGLTexture.h"
|
2014-09-18 02:08:41 +04:00
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
namespace mozilla {
|
2014-09-18 02:08:41 +04:00
|
|
|
|
|
|
|
void
|
2016-10-21 04:03:40 +03:00
|
|
|
WebGL2Context::TexStorage(const char* funcName, uint8_t funcDims, GLenum rawTarget,
|
|
|
|
GLsizei levels, GLenum internalFormat, GLsizei width,
|
|
|
|
GLsizei height, GLsizei depth)
|
2014-09-18 02:08:41 +04:00
|
|
|
{
|
2015-11-25 07:15:29 +03:00
|
|
|
TexTarget target;
|
2015-08-04 00:34:46 +03:00
|
|
|
WebGLTexture* tex;
|
2016-10-21 04:03:40 +03:00
|
|
|
if (!ValidateTexTarget(this, funcName, funcDims, rawTarget, &target, &tex))
|
2014-07-15 03:55:56 +04:00
|
|
|
return;
|
|
|
|
|
2015-11-25 07:15:29 +03:00
|
|
|
tex->TexStorage(funcName, target, levels, internalFormat, width, height, depth);
|
2014-09-18 02:08:41 +04:00
|
|
|
}
|
|
|
|
|
2016-07-07 23:02:00 +03:00
|
|
|
////////////////////
|
|
|
|
|
2015-11-25 07:15:29 +03:00
|
|
|
/*virtual*/ bool
|
2015-08-04 00:34:46 +03:00
|
|
|
WebGL2Context::IsTexParamValid(GLenum pname) const
|
2014-10-15 03:33:59 +04:00
|
|
|
{
|
|
|
|
switch (pname) {
|
2015-08-04 00:34:46 +03:00
|
|
|
case LOCAL_GL_TEXTURE_BASE_LEVEL:
|
|
|
|
case LOCAL_GL_TEXTURE_COMPARE_FUNC:
|
|
|
|
case LOCAL_GL_TEXTURE_COMPARE_MODE:
|
|
|
|
case LOCAL_GL_TEXTURE_IMMUTABLE_FORMAT:
|
|
|
|
case LOCAL_GL_TEXTURE_IMMUTABLE_LEVELS:
|
|
|
|
case LOCAL_GL_TEXTURE_MAX_LEVEL:
|
|
|
|
case LOCAL_GL_TEXTURE_WRAP_R:
|
|
|
|
case LOCAL_GL_TEXTURE_MAX_LOD:
|
|
|
|
case LOCAL_GL_TEXTURE_MIN_LOD:
|
|
|
|
return true;
|
2014-11-06 06:07:26 +03:00
|
|
|
|
2015-08-04 00:34:46 +03:00
|
|
|
default:
|
|
|
|
return WebGLContext::IsTexParamValid(pname);
|
2014-10-15 03:33:59 +04:00
|
|
|
}
|
|
|
|
}
|
2015-07-15 03:37:28 +03:00
|
|
|
|
|
|
|
} // namespace mozilla
|