GPUOpen-LibrariesAndSDKs / RadeonImageFilter

https://gpuopen.com/radeon-prorender-suite/
Other
49 stars 15 forks source link

Combining filters with buffer does not work normally #11

Closed Umio-Yasuno closed 2 years ago

Umio-Yasuno commented 3 years ago

Hello. I tried to implement the combination of filters by referring to the link below. https://radeon-pro.github.io/RadeonProRenderDocs/en/rif/combining_filters.html

The unbuffered version works fine. However, the buffered version does not work normally

The unbuffered version works fine if not combined with a size-affecting filter (e.g. Resampling, Rotate, Flip), so I'm going to use that for now.

/*
 *    without buffer
 */

   if (i % 2 == 0) {
      rifCommandQueueAttachImageFilter(queue, filter[i], inputImage,  outputImage);
   } else {
      rifCommandQueueAttachImageFilter(queue, filter[i], outputImage, inputImage);
   }

   if (i == filter_count - 1 && i % 2 == 1) {
      rif_image_filter fill_filter = nullptr;

      rifContextCreateImageFilter(context,
                                  RIF_IMAGE_FILTER_CONVERT,
                                  &fill_filter);

      rifCommandQueueAttachImageFilter(queue, fill_filter, inputImage, outputImage);
   }
/*
 *    with buffer
 */
   if (i == 0 && filter_count == 1) {
      rifCommandQueueAttachImageFilter(queue, filter[i], inputImage, outputImage);

   } else if (i == 0) {
      rifImageFilterSetParameterImage(filter[i], "srcBuffer", inputImage);

   } else if (0 < i && i < filter_count - 1) {
      rifImageFilterSetParameterImage(filter[i], "srcBuffer", (rif_image)(filter[i-1]));

   } else if (i == filter_count - 1) {
      rifCommandQueueAttachImageFilter(queue, filter[i],
                                       (rif_image)(filter[i-1]), outputImage);
   }

Trace file & Log

filter: bloom + bloom

rif-trace-1611674947-1.6.2.0xbdf2aac0.tar.gz bloom_and_bloom-log.txt

filter: bloom + motion blur

rif-trace-1611674748-1.6.2.0xbdf2aac0.tar.gz bloom_and_motionblur-log.txt

OS: Debian GNU/Linux bullseye/sid CPU: Ryzen 5 2600 GPU: Radeon RX 560 4GB (Polaris11, gfx803) OpenCL: OpenCL 2.0 AMD-APP (3212.0)

BenjaminCoquelle commented 3 years ago

@Umio-Yasuno thanks for that test. This is expected to fail as we don't support joining the bloom effect with other effects. However we currently don't report that information to developers and it is big problem on our side. We will expose that better in our next version Most of our filter can be combined, only a few cannot