Changeset 156971 in webkit
- Timestamp:
- Oct 5, 2013, 12:27:35 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r156970 r156971 1 2013-10-04 Dean Jackson <dino@apple.com> 2 3 [WebGL] program should not be able to link if a bad shader is attached 4 https://bugs.webkit.org/show_bug.cgi?id=94036 5 6 Reviewed by Darin Adler. 7 8 If you attempt to link a program when bad shaders are attached, the 9 link should fail. WebGL also requires that the previously linked 10 program should remain intact. We were doing the former, but not 11 the latter. 12 13 Fix this by not calling glLinkProgram if we know we have bad 14 shaders, and synthesize a bad link status instead. 15 16 Test: WebGL conformance test conformance/programs/program-test.html 17 (found in LayoutTests/webgl) 18 19 * html/canvas/WebGLRenderingContext.cpp: 20 (WebCore::WebGLRenderingContext::compileShader): Mark a shader as valid 21 if it compiled ok. 22 (WebCore::WebGLRenderingContext::linkProgram): Don't call into GraphicsContext3D::linkProgram 23 if we know that we don't have valid shaders. 24 * html/canvas/WebGLShader.cpp: 25 (WebCore::WebGLShader::WebGLShader): Initialize m_isValid. 26 * html/canvas/WebGLShader.h: 27 (WebCore::WebGLShader::isValid): New member variable getter and setter. 28 (WebCore::WebGLShader::setValid): 29 1 30 2013-10-05 Dean Jackson <dino@apple.com> 2 31 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r156970 r156971 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1299 1299 return; 1300 1300 m_context->compileShader(objectOrZero(shader)); 1301 GC3Dint value; 1302 m_context->getShaderiv(objectOrZero(shader), GraphicsContext3D::COMPILE_STATUS, &value); 1303 shader->setValid(value); 1301 1304 cleanupAfterGraphicsCall(false); 1302 1305 } … … 3323 3326 return; 3324 3327 if (!isGLES2Compliant()) { 3325 if (!program->getAttachedShader(GraphicsContext3D::VERTEX_SHADER) || !program->getAttachedShader(GraphicsContext3D::FRAGMENT_SHADER)) { 3328 WebGLShader* vertexShader = program->getAttachedShader(GraphicsContext3D::VERTEX_SHADER); 3329 WebGLShader* fragmentShader = program->getAttachedShader(GraphicsContext3D::FRAGMENT_SHADER); 3330 if (!vertexShader || !vertexShader->isValid() || !fragmentShader || !fragmentShader->isValid()) { 3326 3331 program->setLinkStatus(false); 3327 3332 return; -
trunk/Source/WebCore/html/canvas/WebGLShader.cpp
r104954 r156971 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 44 44 , m_type(type) 45 45 , m_source("") 46 , m_isValid(false) 46 47 { 47 48 setObject(ctx->graphicsContext3D()->createShader(type)); -
trunk/Source/WebCore/html/canvas/WebGLShader.h
r151947 r156971 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 44 44 void setSource(const String& source) { m_source = source; } 45 45 46 bool isValid() const { return m_isValid; } 47 void setValid(bool valid) { m_isValid = valid; } 48 46 49 private: 47 50 WebGLShader(WebGLRenderingContext*, GC3Denum); … … 53 56 GC3Denum m_type; 54 57 String m_source; 58 bool m_isValid; 55 59 }; 56 60
Note:
See TracChangeset
for help on using the changeset viewer.