15bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond/* 25bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* Copyright (C) 2016 The Android Open Source Project 35bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* 45bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* Licensed under the Apache License, Version 2.0 (the "License"); 55bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* you may not use this file except in compliance with the License. 65bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* You may obtain a copy of the License at 75bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* 85bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* http://www.apache.org/licenses/LICENSE-2.0 95bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* 105bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* Unless required by applicable law or agreed to in writing, software 115bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* distributed under the License is distributed on an "AS IS" BASIS, 125bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 135bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* See the License for the specific language governing permissions and 145bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond* limitations under the License. 155bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond*/ 165bbcc3861c44435f89481f80946ef5c9c49968f2Luke Drummond 17dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo#pragma version(1) 18dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo#pragma rs java_package_name(com.android.rs.waitattachdebug) 19dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo 20dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leofloat4 gColor = {0.299f, 0.587f, 0.114f, 1.f}; 21dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo 22dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo/* RenderScript kernel that just sets the colour of the screen and does some 23dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo * simple operations so it is not completely empty 24dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo * (and can therefore be debugged). 25dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo */ 26dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leouchar4 __attribute__((kernel)) simple_kernel(uchar4 in) 27dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo{ 28dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo float4 temp = rsUnpackColor8888(in); 29dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo temp = gColor; 30dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo uchar4 result = rsPackColorTo8888(temp); 31dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo return result; 32dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo} 33dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo 34dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo// Extra kernel to test lldb setting breakpoints on all the RS kernels. 35dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leouchar4 __attribute__((kernel)) other_kernel(uchar4 in) 36dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo{ 37dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo uchar4 result = in.wzyx; 38dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo return result; 39dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo} 40