mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 669013 - Despite supporting OES_texture_float, getSupportedExtensions still returns no extensions - r=joe
This commit is contained in:
parent
ec310123a9
commit
e00ca83dcf
@ -937,6 +937,16 @@ WebGLContext::MozGetUnderlyingParamString(PRUint32 pname, nsAString& retval)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool WebGLContext::IsExtensionSupported(WebGLExtensionID ei)
|
||||
{
|
||||
if (ei == WebGL_OES_texture_float) {
|
||||
MakeContextCurrent();
|
||||
return gl->IsExtensionSupported(gl->IsGLES2() ? GLContext::OES_texture_float
|
||||
: GLContext::ARB_texture_float);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebGLContext::GetExtension(const nsAString& aName, nsIWebGLExtension **retval)
|
||||
{
|
||||
@ -945,10 +955,7 @@ WebGLContext::GetExtension(const nsAString& aName, nsIWebGLExtension **retval)
|
||||
// handle simple extensions that don't need custom objects first
|
||||
WebGLExtensionID ei = WebGLExtensionID_Max;
|
||||
if (aName.EqualsLiteral("OES_texture_float")) {
|
||||
MakeContextCurrent();
|
||||
|
||||
PRBool avail = gl->IsExtensionSupported(gl->IsGLES2() ? "GL_OES_texture_float" : "GL_ARB_texture_float");
|
||||
if (avail)
|
||||
if (IsExtensionSupported(WebGL_OES_texture_float))
|
||||
ei = WebGL_OES_texture_float;
|
||||
}
|
||||
|
||||
@ -1245,7 +1252,8 @@ WebGLContext::GetSupportedExtensions(nsIVariant **retval)
|
||||
|
||||
nsTArray<const char *> extList;
|
||||
|
||||
/* no extensions to add to extList */
|
||||
if (IsExtensionSupported(WebGL_OES_texture_float))
|
||||
extList.InsertElementAt(extList.Length(), "OES_texture_float");
|
||||
|
||||
nsresult rv;
|
||||
if (extList.Length() > 0) {
|
||||
|
@ -472,6 +472,7 @@ protected:
|
||||
NS_ABORT_IF_FALSE(ext >= 0 && ext < WebGLExtensionID_Max, "bogus index!");
|
||||
return mEnabledExtensions[ext] != nsnull;
|
||||
}
|
||||
bool IsExtensionSupported(WebGLExtensionID ei);
|
||||
|
||||
PRBool InitAndValidateGL();
|
||||
PRBool ValidateBuffers(PRInt32* maxAllowedCount, const char *info);
|
||||
|
@ -434,6 +434,8 @@ static const char *sExtensionNames[] = {
|
||||
"GL_ARB_texture_non_power_of_two",
|
||||
"GL_ARB_pixel_buffer_object",
|
||||
"GL_ARB_ES2_compatibility",
|
||||
"GL_OES_texture_float",
|
||||
"GL_ARB_texture_float",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -959,6 +959,8 @@ public:
|
||||
ARB_texture_non_power_of_two,
|
||||
ARB_pixel_buffer_object,
|
||||
ARB_ES2_compatibility,
|
||||
OES_texture_float,
|
||||
ARB_texture_float,
|
||||
Extensions_Max
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user