mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
webgl: Check for pending current_program errors
This commit is contained in:
parent
221a583784
commit
910b2260ab
1 changed files with 8 additions and 4 deletions
|
@ -696,8 +696,10 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
constants::LINE_LOOP | constants::LINES |
|
constants::LINE_LOOP | constants::LINES |
|
||||||
constants::TRIANGLE_STRIP | constants::TRIANGLE_FAN |
|
constants::TRIANGLE_STRIP | constants::TRIANGLE_FAN |
|
||||||
constants::TRIANGLES => {
|
constants::TRIANGLES => {
|
||||||
// TODO(ecoal95): Check the CURRENT_PROGRAM when we keep track of it, and if it's
|
if self.current_program.get().is_none() {
|
||||||
// null generate an InvalidOperation error
|
return self.webgl_error(InvalidOperation);
|
||||||
|
}
|
||||||
|
|
||||||
if first < 0 || count < 0 {
|
if first < 0 || count < 0 {
|
||||||
self.webgl_error(InvalidValue);
|
self.webgl_error(InvalidValue);
|
||||||
} else {
|
} else {
|
||||||
|
@ -733,8 +735,10 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO ensure a non-null WebGLBuffer must be bound to the ELEMENT_ARRAY_BUFFER
|
// TODO ensure a non-null WebGLBuffer must be bound to the ELEMENT_ARRAY_BUFFER
|
||||||
// TODO(ecoal95): Check the CURRENT_PROGRAM when we keep track of it, and if it's
|
if self.current_program.get().is_none() {
|
||||||
// null generate an InvalidOperation error
|
return self.webgl_error(InvalidOperation);
|
||||||
|
}
|
||||||
|
|
||||||
match mode {
|
match mode {
|
||||||
constants::POINTS | constants::LINE_STRIP |
|
constants::POINTS | constants::LINE_STRIP |
|
||||||
constants::LINE_LOOP | constants::LINES |
|
constants::LINE_LOOP | constants::LINES |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue