diff options
author | Matt Wagantall <mwagantall@cyngn.com> | 2015-12-16 17:22:30 -0800 |
---|---|---|
committer | Matt Wagantall <mwagantall@cyngn.com> | 2015-12-17 10:29:40 -0800 |
commit | 4b54a6dfaaa62fa359101028583ae5261f280758 (patch) | |
tree | 060ef79264351dac48023d1dc5d773a7402f8145 | |
parent | be5aaf61726bcbae52ff324c2315cec9f7bb4c47 (diff) | |
download | android_external_cyanogen_UICommon-stable/cm-12.1-YOG4P.tar.gz android_external_cyanogen_UICommon-stable/cm-12.1-YOG4P.tar.bz2 android_external_cyanogen_UICommon-stable/cm-12.1-YOG4P.zip |
UICommon : make grayscale RenderScript compatible with GPU executionstable/cm-12.1-YOG4P
The Adreno GPU RenderScript libraries do not support operations with
double-precision floating point numbers. Update the constants in
grayscale.rs to be single-precision floats so that the script may
run on the GPU.
This resolves warnings like the following seen as a result of the
GPU RenderScript compiler failing. These were not fatal, but the
script would end up running on the CPUs rather than the GPU.
W Adreno-RS: <rsdVendorScriptInitQCOM:795>: ERROR: rsdCompileBitcode returned -30
Issue: SAMBAR-1126
Change-Id: I8c58900c3268b6998d961cd6c9e0c09b0d9971f6
(cherry picked from commit 8ac1645eb89526333539de21957a6803e6c6bf9d)
-rw-r--r-- | src/com/cyngn/uicommon/rs/grayscale.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/cyngn/uicommon/rs/grayscale.rs b/src/com/cyngn/uicommon/rs/grayscale.rs index c5d06aa..dd56f85 100644 --- a/src/com/cyngn/uicommon/rs/grayscale.rs +++ b/src/com/cyngn/uicommon/rs/grayscale.rs @@ -4,7 +4,7 @@ uchar4 __attribute__((kernel)) grayscale(uchar4 pixelIn, uint32_t x, uint32_t y) { - uchar grayscale = pixelIn.r * 0.299 + pixelIn.g * 0.587 + pixelIn.b * 0.114; + uchar grayscale = pixelIn.r * 0.299f + pixelIn.g * 0.587f + pixelIn.b * 0.114f; uchar4 pixelOut; pixelOut.a = pixelIn.a; @@ -13,4 +13,4 @@ uchar4 __attribute__((kernel)) grayscale(uchar4 pixelIn, uint32_t x, uint32_t y) pixelOut.b = grayscale; return pixelOut; -}
\ No newline at end of file +} |