Closed Bug 834814 Opened 11 years ago Closed 11 years ago

allow for webgl tests to support mesa llvm driver

Categories

(Core :: Graphics: CanvasWebGL, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: jmaher, Assigned: jmaher)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

In order to get tests running on amazon ec2 vms, we need to have support for the mesa llvmpipe graphics backend.

We can detect the rendering engine inside the test and mark tests as expected fail or skipped based on the driver.
Assignee: nobody → jmaher
Status: NEW → ASSIGNED
Attachment #706517 - Flags: review?(bjacob)
Comment on attachment 706517 [details] [diff] [review]
detect and filter based on mesa llvmpipe driver (1.0)

Review of attachment 706517 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/canvas/test/webgl/test_webgl_conformance_test_suite.html
@@ +46,5 @@
>  
> +function detectDriverType() {
> +  const Cc = SpecialPowers.wrap(Components).classes;
> +  const Ci = SpecialPowers.wrap(Components).interfaces;
> +  var doc = Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser).parseFromString("<html/>", "text/html");

Ugh. If you just need a document, use document.implementation.createHTMLElement("").
Comment on attachment 706517 [details] [diff] [review]
detect and filter based on mesa llvmpipe driver (1.0)

Review of attachment 706517 [details] [diff] [review]:
-----------------------------------------------------------------

looks good! Let's just do another round to actually detect NVIDIA, see below:

also a minor nit: the filenames here have underscores, not dashes, would be nice to keep that consistent.

::: content/canvas/test/webgl/test_webgl_conformance_test_suite.html
@@ +52,5 @@
> +  var canvas = doc.createElement("canvas");
> +  canvas.width = 1;
> +  canvas.height = 1;
> +
> +  var webglRenderer = "nvidia";

I would really prefer if we didn't artificially return "nvidia" for all non-Mesa drivers. You could have 3 states: "", "nvidia", "mesa". Default to ""; keep your good code here to detect mesa; for NVIDIA, you need to query UNMASKED_VENDOR_WEBGL and check if it contains "NVIDIA" (all uppercase).
Attachment #706517 - Flags: review?(bjacob) → review-
as a note, we would need to set a preference in the profile before running this test, also we would need to install llvm-dev on the image and ensure that we use it.  I did this by doing:
apt-get install llvm-dev
export LD_LIBRARY_PATH=/usr/lib/libLLVMgold.so


and to fix the harness, we need to add:
user_pref("webgl.force-enabled", true);

we should add this as a commandline variable for the VM machines.  Maybe --force-webgl or something like --platform=ubuntu-vm
Attachment #706517 - Attachment is obsolete: true
Attachment #706543 - Flags: review?(bjacob)
Comment on attachment 706543 [details] [diff] [review]
support linux, nvidia, and mesa in the driver (2.0)

Review of attachment 706543 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good! Thanks.

Ms2ger's suggestion sounds good too, I didn't know about that, nor did the people who helped me with the about:support update. Is that a new thing? Anyway, the patch in its current form is acceptable --- but what Ms2ger suggests sounds better.
Attachment #706543 - Flags: review?(bjacob) → review+
Depends on: 834914
Depends on: 835135
https://hg.mozilla.org/mozilla-central/rev/6518cc9027e2
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: