author Sam Lantinga
Sun, 05 Apr 2020 08:58:47 -0700
changeset 13689 c3055b205671
parent 11647 5816b27073a4
permissions -rw-r--r--
Fixed bug 5015 - SDL_RenderReadPixels on DirectX 11.1 backend seems to be broken


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.
     1 # Project-wide Gradle settings.
     3 # IDE (e.g. Android Studio) users:
     4 # Gradle settings configured through the IDE *will override*
     5 # any settings specified in this file.
     7 # For more details on how to configure your build environment visit
     8 #
    10 # Specifies the JVM arguments used for the daemon process.
    11 # The setting is particularly useful for tweaking memory settings.
    12 org.gradle.jvmargs=-Xmx1536m
    14 # When configured, Gradle will run in incubating parallel mode.
    15 # This option should only be used with decoupled projects. More details, visit
    16 #
    17 # org.gradle.parallel=true