summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D
AgeCommit message (Collapse)Author
2024-04-04Fix out of bounds accesses for invalid vertex component formatsPokechu22
On all platforms, this would result in out of bounds accesses when getting the component sizes (which uses stuff from VertexLoader_Position.h/VertexLoader_TextCoord.h/VertexLoader_Normal.h). On platforms other than x64 and ARM64, this would also be out of bounds accesses when getting function pointers for the non-JIT vertex loader (in VertexLoader_Position.cpp etc.). Usually both of these would get data from other entries in the same multi-dimensional array, but the last few entries would be truly out of bounds. This does mean that an out of bounds function pointer can be called on platforms that don't have a JIT vertex loader, but it is limited to invalid component formats with values 5/6/7 due to the size of the bitfield the formats come from, so it seems unlikely that this could be exploited in practice. This issue affects a few games; Def Jam: Fight for New York (https://bugs.dolphin-emu.org/issues/12719) and Fifa Street are known to be affected. I have not done any hardware testing for this PR specifically, though I *think* I previously determined that at least a value of 5 behaves the same as float (4). That's what I implemented in any case. I did previously determine that both Def Jam: Fight for New York and Fifa Street use an invalid normal format, but don't actually have lighting enabled when that normal vector is used, so it doesn't change rendering in practice. The color component format also has two invalid values, but VertexLoader_Color.h/.cpp do check for those invalid ones and return a default value instead of doing an out of bounds access.
2023-12-15VideoBackends / VideoCommon: add type enum to dictate whether a texture is a ↵iwubcode
2D texture, a texture array, or a cube map; support 2D texture type across backends Co-authored-by: TellowKrinkle <tellowkrinkle@gmail.com>
2023-12-09VideoCommon: Use std::span for BoundingBox::Write()Lioncash
Crosses off a lingering TODO. Also amends a few nearby cases where a u32 cast was being repromoted to size_t.
2023-10-06VideoBackends / VideoCommon: add new uniform buffer object for custom shader ↵iwubcode
materials (slot 3, geometry shader buffer moves to slot 4 if available)
2023-07-21VideoBackends: add support for cube maps for OGL, Vulkan, and D3Diwubcode
2023-07-11Merge pull request #12042 from JosJuice/logic-op-no-win7OatmealDome
D3D: Remove Windows 7 mention in logic ops warning
2023-07-11D3D: Remove Windows 7 mention in logic ops warningJosJuice
Dolphin no longer supports Windows 7, so the fact that there are (were?) more people who use Windows 7 than who use a GPU that doesn't support the required feature is no longer relevant.
2023-06-28VideoBackends: support multiple compute images for some backends (D3D, OGL, ↵iwubcode
Vulkan)
2023-06-19Video: implement color correction to match the NTSC and PAL color spaces ↵Filoppi
(and gamma) that GC and Wii targeted. To further increase the accuracy of the post process phase, I've added (scRGB) HDR support, which is necessary to fully display the PAL and NTSC-J color spaces, and also to improve the quality of post process texture samplings and do them in linear space instead of gamma space (which is very important when playing at low resolutions). For SDR, the quality is also slightly increased, at least if any post process runs, as the buffer is now R10G10B10A2 (on Vulkan, DX11 and DX12) if supported; previously it was R8G8B8A8 but the alpha bits were wasted. Gamma correction is arguably the most important thing as Dolphin on Windows outputted in "sRGB" (implicitly) as that's what Windows expects by default, though sRGB gamma is very different from the gamma commonly used by video standards dating to the pre HDR era (roughly gamma 2.35). Additionally, the addition of HDR support (which is pretty straight forward and minimal), added support for our own custom AutoHDR shaders, which would allow us to achieve decent looking HDR in Dolphin games without having to use SpecialK or Windows 11 AutoHDR. Both of which don't necessarily play nice with older games with strongly different and simpler lighting. HDR should also be supported in Linux. Development of my own AutoHDR shader is almost complete and will come next. This has been carefully tested and there should be no regression in any of the different features that Dolphin offers, like multisampling, stereo rendering, other post processes, etc etc. Fixes: https://bugs.dolphin-emu.org/issues/8941 Co-authored-by: EndlesslyFlowering <EndlesslyFlowering@protonmail.com> Co-authored-by: Dogway <lin_ares@hotmail.com>
2023-06-09Merge pull request #11699 from Pokechu22/gl-check-maximum-samplesAdmiral H. Curtiss
OpenGL: Check the list of supported AA modes instead of hardcoding
2023-06-08VideoCommon: Pass WindowSystemInfo to InitBackendInfoPokechu22
2023-06-03VideoBackends: add support to allow rendering to multiple output texturesiwubcode
2023-03-14Divide by MSAA for PerfQuery in all backends.Admiral H. Curtiss
2023-03-14Return quarter value for PerfQuery in all backends.Admiral H. Curtiss
2023-02-24VideoBackends: rework d3d11 to specify samplers/bound textures using a ↵iwubcode
bitset with a constant size, instead of hardcoding each individual enumeration value
2023-02-10VideoCommon: add constant value to set the allowed maximum number of pixel ↵iwubcode
samplers
2023-02-09VideoCommon: store the configuration used to create the AbstractPipeline on ↵iwubcode
the pipeline itself, so that it's easy to duplicate pipelines with slightly altered configuration
2023-02-09Merge pull request #11522 from phire/KillRendererWithFireScott Mansell
Kill Renderer (with phire)
2023-02-09Apply suggestions from code reviewScott Mansell
Co-authored-by: Mai <mathew1800@gmail.com> Co-authored-by: BhaaL <bhaalsen@gmail.com> Co-authored-by: iwubcode <iwubcode@users.noreply.github.com>
2023-02-09Cleanup headersScott Mansell
2023-02-09Lint fixesScott Mansell
2023-02-09Move xfb tracking and IR scaling out of RenderBaseScott Mansell
2023-01-31Also use events for config changedScott Mansell
2023-01-31Implement AbstractGfx for Dx11Scott Mansell
2023-01-31Move Presenting, Dumping and ImGui out of RendererScott Mansell
2023-01-31TextureCache: Refactor with smart pointersScott Mansell
The whole ownership model was getting a bit of a mess, with a some of special cases to deal with. And I'm planning to make it even more complex in the future. So here is some upfront work to convert it over to reference counted pointers.
2023-01-27VideoBackends: add a way to load data into a specific level AND layer, ↵iwubcode
default to layer 0
2022-12-29VideoCommon: De-globalize GeometryShaderManager class.Admiral H. Curtiss
2022-12-28VideoCommon: De-globalize VertexShaderManager class.Admiral H. Curtiss
2022-12-27VideoCommon: De-globalize PixelShaderManager class.Admiral H. Curtiss
2022-12-20Merge pull request #11351 from JosJuice/bitset-cpp20Mai
Common: Use C++20 <bit> header in BitSet.h
2022-12-19Merge pull request #11286 from K0bin/vk-query-fixJMC47
VideoBackends: Query fixes and cleanups
2022-12-18Common: Use C++20 <bit> header in BitSet.hJosJuice
2022-11-29VideoBackends: Rename query_type to query_groupRobin Kertels
2022-11-23VideoBackends/D3D11: Simplify vertex attribute codePokechu22
2022-11-23Fix build errors related to formatting non-scoped enumsPokechu22
2022-09-19VideoCommon: Add dynamic vertex loader to ubershadersTellowKrinkle
2022-07-21VideoBackends:Metal: MSAA supportTellowKrinkle
2022-07-21VideoBackends: Add Metal rendererTellowKrinkle
2022-06-24D3D: update BoundingBox to match generated shader codeiwubcode
2022-06-24D3D / VideoCommon: generate HLSL from SPIRViwubcode
2022-05-22cmake: Don't use PCH with Qt6.Admiral H. Curtiss
2022-04-24Merge pull request #10251 from Pokechu22/negative-scissorJMC47
Rework scissor handling
2022-04-22VideoCommon: Rename norm0/norm1/norm2 to normal/tangent/binormalPokechu22
2022-04-16VideoCommon: Remove bSupportsOversizedViewportsPokechu22
I think this is a relic of D3D9. D3D11 and D3D12 seem to work fine without it. Plus, ViewportCorrectionMatrix just didn't work correctly (at least with the viewports being generated by the new scissor code).
2022-01-31Merge pull request #10422 from OatmealDome/opengl-shader-crashJMC47
VideoConfig: Add flag for whether the system supports setting object names
2022-01-31D3DMain: Assume support for setting object namesOatmealDome
2022-01-13Make all custom fmt::formatter's format functions constPokechu22
fmt 8.0.0 requires this.
2022-01-09VideoBackends/D3D11: Include HRESULT in error messagesPokechu22
2022-01-09VideoBackends/D3D: Eliminate CHECK in favor of ASSERT_MSGPokechu22