android-project/build.gradle
author Sam Lantinga
Sun, 05 Apr 2020 08:58:47 -0700
changeset 13689 c3055b205671
parent 12364 351a67dbe9c6
permissions -rw-r--r--
Fixed bug 5015 - SDL_RenderReadPixels on DirectX 11.1 backend seems to be broken

Konrad

It appears that I cannot use SDL_RenderReadPixels on a bound framebuffer (SDL_Texture set as render target) as it simply results in gibberish data. However, drawing that framebuffer into the default target (window surface) does render it correctly. Other backends (OpenGL, software, Direct3D) do work fine.

It looks to me like D3D11_RenderReadPixels just gets the general backbuffer and not the current render target and its backbuffer.

Here is the patch which actually fetches the current render target and its underlying ID3D11Resource which is ID3D11Texture2D.
slouken@11647
     1
// Top-level build file where you can add configuration options common to all sub-projects/modules.
slouken@11647
     2
slouken@11647
     3
buildscript {
slouken@11647
     4
    repositories {
slouken@11647
     5
        jcenter()
slouken@12364
     6
        google()
slouken@11647
     7
    }
slouken@11647
     8
    dependencies {
slouken@12364
     9
        classpath 'com.android.tools.build:gradle:3.2.0'
slouken@11647
    10
slouken@11647
    11
        // NOTE: Do not place your application dependencies here; they belong
slouken@11647
    12
        // in the individual module build.gradle files
slouken@11647
    13
    }
slouken@11647
    14
}
slouken@11647
    15
slouken@11647
    16
allprojects {
slouken@11647
    17
    repositories {
slouken@11647
    18
        jcenter()
slouken@12364
    19
        google()
slouken@11647
    20
    }
slouken@11647
    21
}
slouken@11647
    22
slouken@11647
    23
task clean(type: Delete) {
slouken@11647
    24
    delete rootProject.buildDir
slouken@11647
    25
}