Radeon ProRender

Tiled Rendering

This tutorial covers tiled rendering.

Often with large render resolutions, it is desirable to render sections at a time. This is because the resulting framebuffer would take an exorbitant amount of memory if all the sections are processed at once.

This tutorial covers how to render the framebuffer sequentially, i.e. in sections, or “tiles”. This keeps each framebuffer size very small, but once all the sections are processed, the results should be stitched together (however, this can be done in the CPU memory after rendering in the GPU). With each tile, the camera should be moved slightly to keep the results coherent.

Also, please note that we introduce the function StudyErrorCode() which is an extension of the CHECK() function to check the return value of an RPR call. Here, in addition to just checking whether a return value = RPR_SUCCESS, if there is an error, we receive the error message from RPR and print it. This method can provide valuable debugging info.

static void StudyErrorCode(rpr_int errorCode, rpr_context context__ = nullptr)
{
	if (errorCode != RPR_SUCCESS && context__)
	{
		rpr_int status = 0;
		size_t sizeParamA = 0;
		status = rprContextGetInfo(context__, RPR_CONTEXT_LAST_ERROR_MESSAGE, 0, 0, &sizeParamA);
		if (status == RPR_SUCCESS && sizeParamA >= 1)
		{
			char* paramData = new char[sizeParamA];
			status = rprContextGetInfo(context__, RPR_CONTEXT_LAST_ERROR_MESSAGE, sizeParamA, paramData, 0);
			if (status == RPR_SUCCESS)
			{
				printf("ErrorMessage = %s\n", paramData);
			}
			delete[] paramData; paramData = 0;
		}
	}
}