Makefile.in
author Sam Lantinga
Sun, 05 Apr 2020 08:58:47 -0700
changeset 13689 c3055b205671
parent 13657 3c2eaf481522
child 13797 55ec5ae4aa0b
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.
     1 # Makefile to build and install the SDL library
     2 
     3 top_builddir = .
     4 srcdir  = @srcdir@
     5 objects = build
     6 gen = gen
     7 prefix = @prefix@
     8 exec_prefix = @exec_prefix@
     9 bindir	= @bindir@
    10 libdir  = @libdir@
    11 includedir = @includedir@
    12 datarootdir = @datarootdir@
    13 datadir	= @datadir@
    14 auxdir	= @ac_aux_dir@
    15 distpath = $(srcdir)/..
    16 distdir = SDL2-@SDL_VERSION@
    17 distfile = $(distdir).tar.gz
    18 
    19 @SET_MAKE@
    20 SHELL	= @SHELL@
    21 CC      = @CC@
    22 INCLUDE = @INCLUDE@
    23 CFLAGS  = @BUILD_CFLAGS@
    24 EXTRA_CFLAGS = @EXTRA_CFLAGS@
    25 LDFLAGS = @BUILD_LDFLAGS@
    26 EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
    27 LIBTOOL = @LIBTOOL@
    28 INSTALL = @INSTALL@
    29 AR	= @AR@
    30 RANLIB	= @RANLIB@
    31 RC	= @RC@
    32 
    33 TARGET  = libSDL2.la
    34 OBJECTS = @OBJECTS@
    35 GEN_HEADERS = @GEN_HEADERS@
    36 GEN_OBJECTS = @GEN_OBJECTS@
    37 VERSION_OBJECTS = @VERSION_OBJECTS@
    38 
    39 SDLMAIN_TARGET = libSDL2main.la
    40 SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
    41 
    42 SDLTEST_TARGET = libSDL2_test.la
    43 SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
    44 
    45 WAYLAND_SCANNER = @WAYLAND_SCANNER@
    46 
    47 INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@
    48 
    49 SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac debian docs include Makefile.* sdl2-config.cmake.in sdl2-config-version.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols
    50 GEN_DIST = SDL2.spec
    51 
    52 ifneq ($V,1)
    53 RUN_CMD_AR     = @echo "  AR    " $@;
    54 RUN_CMD_CC     = @echo "  CC    " $@;
    55 RUN_CMD_CXX    = @echo "  CXX   " $@;
    56 RUN_CMD_LTLINK = @echo "  LTLINK" $@;
    57 RUN_CMD_RANLIB = @echo "  RANLIB" $@;
    58 RUN_CMD_RC     = @echo "  RC    " $@;
    59 RUN_CMD_GEN    = @echo "  GEN   " $@;
    60 LIBTOOL += --quiet
    61 endif
    62 
    63 HDRS = \
    64 	SDL.h \
    65 	SDL_assert.h \
    66 	SDL_atomic.h \
    67 	SDL_audio.h \
    68 	SDL_bits.h \
    69 	SDL_blendmode.h \
    70 	SDL_clipboard.h \
    71 	SDL_cpuinfo.h \
    72 	SDL_egl.h \
    73 	SDL_endian.h \
    74 	SDL_error.h \
    75 	SDL_events.h \
    76 	SDL_filesystem.h \
    77 	SDL_gamecontroller.h \
    78 	SDL_gesture.h \
    79 	SDL_haptic.h \
    80 	SDL_hints.h \
    81 	SDL_joystick.h \
    82 	SDL_keyboard.h \
    83 	SDL_keycode.h \
    84 	SDL_loadso.h \
    85 	SDL_log.h \
    86 	SDL_main.h \
    87 	SDL_messagebox.h \
    88 	SDL_metal.h \
    89 	SDL_mouse.h \
    90 	SDL_mutex.h \
    91 	SDL_name.h \
    92 	SDL_opengl.h \
    93 	SDL_opengl_glext.h \
    94 	SDL_opengles.h \
    95 	SDL_opengles2_gl2ext.h \
    96 	SDL_opengles2_gl2.h \
    97 	SDL_opengles2_gl2platform.h \
    98 	SDL_opengles2.h \
    99 	SDL_opengles2_khrplatform.h \
   100 	SDL_pixels.h \
   101 	SDL_platform.h \
   102 	SDL_power.h \
   103 	SDL_quit.h \
   104 	SDL_rect.h \
   105 	SDL_render.h \
   106 	SDL_rwops.h \
   107 	SDL_scancode.h \
   108 	SDL_sensor.h \
   109 	SDL_shape.h \
   110 	SDL_stdinc.h \
   111 	SDL_surface.h \
   112 	SDL_system.h \
   113 	SDL_syswm.h \
   114 	SDL_thread.h \
   115 	SDL_timer.h \
   116 	SDL_touch.h \
   117 	SDL_types.h \
   118 	SDL_version.h \
   119 	SDL_video.h \
   120 	SDL_vulkan.h \
   121 	begin_code.h \
   122 	close_code.h
   123 
   124 SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
   125 
   126 LT_AGE      = @LT_AGE@
   127 LT_CURRENT  = @LT_CURRENT@
   128 LT_RELEASE  = @LT_RELEASE@
   129 LT_REVISION = @LT_REVISION@
   130 LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
   131 
   132 all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
   133 
   134 $(srcdir)/configure: $(srcdir)/configure.ac
   135 	@echo "Warning, configure is out of date, please re-run autogen.sh"
   136 
   137 Makefile: $(srcdir)/Makefile.in
   138 	$(SHELL) config.status $@
   139 
   140 Makefile.in:;
   141 
   142 $(objects)/.created:
   143 	$(SHELL) $(auxdir)/mkinstalldirs $(objects)
   144 	touch $@
   145 
   146 update-revision:
   147 	$(SHELL) $(auxdir)/updaterev.sh
   148 
   149 .PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
   150 
   151 $(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
   152 	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
   153 
   154 $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
   155 	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
   156 
   157 $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
   158 	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
   159 
   160 install: all install-bin install-hdrs install-lib install-data
   161 install-bin:
   162 ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
   163 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
   164 	$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
   165 endif
   166 
   167 install-hdrs: update-revision
   168 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
   169 	for file in $(HDRS) $(SDLTEST_HDRS); do \
   170 	    $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \
   171 	done
   172 	$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h
   173 	if test -f include/SDL_revision.h; then \
   174 	    $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
   175 	else \
   176 	    $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
   177 	fi
   178 
   179 install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
   180 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
   181 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
   182 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
   183 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
   184 install-data:
   185 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
   186 	$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
   187 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
   188 	$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
   189 ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
   190 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
   191 	$(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2
   192 	$(INSTALL) -m 644 sdl2-config-version.cmake $(DESTDIR)$(libdir)/cmake/SDL2
   193 endif
   194 
   195 uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
   196 uninstall-bin:
   197 	rm -f $(DESTDIR)$(bindir)/sdl2-config
   198 uninstall-hdrs:
   199 	for file in $(HDRS) $(SDLTEST_HDRS); do \
   200 	    rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \
   201 	done
   202 	rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h
   203 	rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h
   204 	-rmdir $(DESTDIR)$(includedir)/SDL2
   205 uninstall-lib:
   206 	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
   207 	rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
   208 	rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
   209 uninstall-data:
   210 	rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
   211 	rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
   212 	rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config.cmake
   213 	rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config-version.cmake
   214 
   215 clean:
   216 	rm -rf $(objects)
   217 	rm -rf $(gen)
   218 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
   219 
   220 distclean: clean
   221 	rm -f Makefile Makefile.rules sdl2-config
   222 	rm -f config.status config.cache config.log libtool
   223 	rm -rf $(srcdir)/autom4te*
   224 	find $(srcdir) \( \
   225 	    -name '*~' -o \
   226 	    -name '*.bak' -o \
   227 	    -name '*.old' -o \
   228 	    -name '*.rej' -o \
   229 	    -name '*.orig' -o \
   230 	    -name '.#*' \) \
   231 	    -exec rm -f {} \;
   232 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
   233 
   234 dist $(distfile):
   235 	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
   236 	(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
   237 	tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
   238 	find $(distdir) \( \
   239 	    -name '*~' -o \
   240 	    -name '*.bak' -o \
   241 	    -name '*.old' -o \
   242 	    -name '*.rej' -o \
   243 	    -name '*.orig' -o \
   244 	    -name '.#*' \) \
   245 	    -exec rm -f {} \;
   246 	if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
   247 	(cd $(distdir); build-scripts/updaterev.sh)
   248 	tar cvf - $(distdir) | gzip --best >$(distfile)
   249 	rm -rf $(distdir)
   250 
   251 rpm: $(distfile)
   252 	rpmbuild -ta $?