diff options
| author | Matt Wagantall <mwagantall@cyngn.com> | 2015-12-16 17:22:30 -0800 |
|---|---|---|
| committer | Matt Wagantall <mwagantall@cyngn.com> | 2015-12-16 17:31:00 -0800 |
| commit | 8ac1645eb89526333539de21957a6803e6c6bf9d (patch) | |
| tree | b63b51b5dfd1d9283463703eb75a4ed005a11d35 | |
| parent | f3b113dc237061fd26a67cec7ad52d359e522c2f (diff) | |
| download | android_external_cyanogen_UICommon-cm-12.1.tar.gz android_external_cyanogen_UICommon-cm-12.1.tar.bz2 android_external_cyanogen_UICommon-cm-12.1.zip | |
UICommon : make grayscale RenderScript compatible with GPU executioncm-12.1
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
Change-Id: I8c58900c3268b6998d961cd6c9e0c09b0d9971f6
| -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 +} |
