Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't rsDebug work?

I've inserted an rsDebug method in the Android RenderScript sample "Fountain", but I'm getting no messages out of logcat.

Here's a code snippet to demonstrate what I've tried:

int root() {
    float dt = min(rsGetDt(), 0.1f);
    rsDebug("dt", dt);
    ...
}
like image 689
zhucai Avatar asked Jun 28 '12 02:06

zhucai


2 Answers

I have been working with the renderscript example CarouselView example from here and here is what I did to get rsDebug to work:

  1. Added debuggable="true" to the application tag in the manifest file:

    <application android:debuggable="true">
    
  2. Added

    \#include "rs_debug.rsh" 
    

to the carousel.rs renderscript file.

like image 93
Dave C Avatar answered Sep 27 '22 23:09

Dave C


Besides the answer of Dave i want add following hint:

Messages in renderscript are outputted in the "Verbose"-level. So it may be easy to ignore them because you are in the wrong level.

So in Android Studio you can change the logcat-output here:

enter image description here

like image 34
Denis Lukenich Avatar answered Sep 28 '22 00:09

Denis Lukenich