зеркало из https://github.com/mozilla/gecko-dev.git
WebGL2: implement TEXTURE_IMMUTABLE_FORMAT for getTexParameter (bug 1080299
, r=jgilbert).
--HG-- extra : rebase_source : 79f493cb48e106c99685ae92d65d6dd228139489
This commit is contained in:
Родитель
6fdc089047
Коммит
79fb3b538c
|
@ -248,6 +248,7 @@ private:
|
|||
bool ValidateTexStorage(GLenum target, GLsizei levels, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLsizei depth,
|
||||
const char* info);
|
||||
JS::Value GetTexParameterInternal(const TexTarget& target, GLenum pname) MOZ_OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -345,3 +345,17 @@ WebGL2Context::CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset
|
|||
{
|
||||
MOZ_CRASH("Not Implemented.");
|
||||
}
|
||||
|
||||
JS::Value
|
||||
WebGL2Context::GetTexParameterInternal(const TexTarget& target, GLenum pname)
|
||||
{
|
||||
switch (pname) {
|
||||
case LOCAL_GL_TEXTURE_IMMUTABLE_FORMAT:
|
||||
{
|
||||
GLint i = 0;
|
||||
gl->fGetTexParameteriv(target.get(), pname, &i);
|
||||
return JS::NumberValue(uint32_t(i));
|
||||
}
|
||||
}
|
||||
return WebGLContext::GetTexParameterInternal(target, pname);
|
||||
}
|
||||
|
|
|
@ -990,6 +990,8 @@ protected:
|
|||
uint32_t pixelSize,
|
||||
uint32_t alignment);
|
||||
|
||||
virtual JS::Value GetTexParameterInternal(const TexTarget& target, GLenum pname);
|
||||
|
||||
// Returns x rounded to the next highest multiple of y.
|
||||
static CheckedUint32 RoundedToNextMultipleOf(CheckedUint32 x, CheckedUint32 y) {
|
||||
return ((x + y - 1) / y) * y;
|
||||
|
|
|
@ -1611,6 +1611,12 @@ WebGLContext::GetTexParameter(GLenum rawTarget, GLenum pname)
|
|||
return JS::NullValue();
|
||||
}
|
||||
|
||||
return GetTexParameterInternal(target, pname);
|
||||
}
|
||||
|
||||
JS::Value
|
||||
WebGLContext::GetTexParameterInternal(const TexTarget& target, GLenum pname)
|
||||
{
|
||||
switch (pname) {
|
||||
case LOCAL_GL_TEXTURE_MIN_FILTER:
|
||||
case LOCAL_GL_TEXTURE_MAG_FILTER:
|
||||
|
|
Загрузка…
Ссылка в новой задаче