wined3d: Set d3d 1-9 textures in the state as SRVs.
commit5b60f4649b15efb9ef10b63da3ef2c42f8665078
authorZebediah Figura <zfigura@codeweavers.com>
Fri, 14 Jul 2023 22:44:02 +0000 (14 17:44 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 1 Dec 2023 17:46:23 +0000 (1 18:46 +0100)
tree49bafcc1ca7e28b68daee39ca221951848e00d3d
parentff30b54791bc61e32faf079ce3e3383decf8695f
wined3d: Set d3d 1-9 textures in the state as SRVs.

The idea is to reuse the existing code to handle SRVs, which simplifies the GL
code and essentially allows the Vulkan code to work "for free" (which is to say,
by writing this patch, rather than by adding support for flat textures to the
Vulkan renderer.)

This is a large patch; it consists the following parts:

* Create identity SRVs for d3d 1-9 textures. Store those in
  state->shader_resource_view instead of in state->texture.

* (Re)use wined3d_context_gl_bind_shader_resources() instead of state_sampler()
  to bind them.

  - Introduce code to that function to handle FFP textures.

  - Bind the sRGB texture if necessary in wined3d_shader_resource_view_gl_bind.

* (Re)use context_gl_load_shader_resources() instead of
  context_preload_textures() to load them.

  - Introduce code to that function to handle FFP textures.

  - Load the sRGB texture if necessary.

  - Port the SRV/RTV feedback loop check from context_preload_textures().

* Invalidate STATE_GRAPHICS_SHADER_RESOURCE_BINDING in places that now need to
  account for texture binding being guarded by that state instead of
  STATE_SAMPLER.

  Transitioning the remaining users of STATE_SAMPLER to
  STATE_GRAPHICS_SHADER_RESOURCE_BINDING, and removing STATE_SAMPLER, is left
  for future patches.
12 files changed:
dlls/wined3d/arb_program_shader.c
dlls/wined3d/context.c
dlls/wined3d/context_gl.c
dlls/wined3d/cs.c
dlls/wined3d/device.c
dlls/wined3d/glsl_shader.c
dlls/wined3d/shader.c
dlls/wined3d/state.c
dlls/wined3d/stateblock.c
dlls/wined3d/texture.c
dlls/wined3d/view.c
dlls/wined3d/wined3d_private.h