summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
AgeCommit message (Collapse)Author
2018-03-28Merge pull request #6547 from lioncash/deadMarkus Wick
PixelShaderGen: Remove dead code in WriteColor()
2018-03-27PixelShaderGen: Invert conditional in WriteColor()Lioncash
Puts the true condition body first instead of the false one for better reading.
2018-03-27PixelShaderGen: Remove dead code in WriteColor()Lioncash
The outer conditional executes only whenever destination alpha is used.
2018-03-27HiresTextures: Use std::minmax or std::minmax_element where applicable in ↵Lioncash
GenBaseName() Minimizes repetition. std::minmax_element can be used for the 256 * 2 case, as it's only performing byte comparisons and thus, there will always be an element smaller than 0xffff, so it doesn't need to be included in the set of compared values.
2018-03-27HiresTextures: Remove unnecessary pointer casts in GenBaseName()Lioncash
swap16 has an overload that accepts a u8*, performing the same behavior in a well-defined manner.
2018-03-27BPStructs: Remove an unnecessary pointer cast in GetBPRegInfoLioncash
swap32 has an overload that accepts a u8*, performing the same behavior in a well-defined manner.
2018-03-26Implement "Skip" ubershader modeStenzek
Skip ubershader mode works the same as hybrid ubershaders in that the shaders are compiled asynchronously. However, instead of using the ubershader to draw the object, it skips it entirely until the specialized shader is made available. This mode will likely result in broken effects where a game creates an EFB copy, and does not redraw it every frame. Therefore, it is not a recommended option, however, it may result in better performance on low-end systems.
2018-03-23Merge pull request #6503 from lioncash/brace-warnJosJuice
PixelShaderGen/UberShaderPixel: Silence -Wmissing-braces warnings
2018-03-23PixelShaderGen/UberShaderPixel: Silence -Wmissing-braces warningsLioncash
2018-03-23AbstractFramebuffer: Silence a -Wlogical-op-parentheses warning in ↵Lioncash
ValidateConfig()
2018-03-19Merge pull request #6460 from lioncash/datareaderLéo Lam
DataReader: Minor API changes
2018-03-19Merge pull request #6442 from stenzek/async-compiler-priorityMarkus Wick
ShaderCache: Implement compile priority
2018-03-19Merge pull request #6459 from lioncash/enumMarkus Wick
VertexShaderGen: Convert defines to an enum
2018-03-18DataReader: Provide a const qualified variant of GetPointer()Lioncash
This wouldn't be much of a data reader if it can't access the read-only data pointer in read-only contexts. Especially if it can get a writable equivalent in contexts that aren't read-only.
2018-03-18DataReader: Correct return type of operator=Lioncash
It's questionable to not return a reference to the instance being assigned to. It's also quite misleading in terms of expected behavior relative to everything else. This fixes it to make it consistent with other classes.
2018-03-18DataReader: Remove __forceinline from trivial functionsLioncash
2018-03-18DataReader: In-class initialize member variables where applicableLioncash
Allows the default constructor to be defaulted and ensures the default values are associated with the member variables directly. Also corrects a prefixed underscore in the two parameter constructor.
2018-03-18DataReader: Make size() and Peek() const member functionsLioncash
These don't modify class state, so they can be const qualified.
2018-03-18VertexShaderGen: Convert defines to an enumLioncash
Unlike defines, these will actually obey namespacing (should one be added), and also provide a symbol when debugging, as opposed to a magic value.
2018-03-18VideoBackendBase: Migrate functions from MainBase.cpp to VideoBackendBase.cppLioncash
Given that this only contains functions from the VideoBackendBase class, it makes more sense to move these to the relevant cpp file to keep them all together.
2018-03-17MainBase: Remove effectively unused s_FifoShuttingDown variableLioncash
This is only ever set and cleared, which is fine, however nothing else ever actually reads its state to perform differing behavior.
2018-03-17MainBase: Remove unused s_beginFieldArgs structLioncash
This is only ever memset to zero and never used again. This also gets rid of an instance of undefined behavior considering the draft standard for C++17 (N4659) states at [dcl.type.cv] paragraph 5: " The semantics of an access through a volatile glvalue are implementation-defined. If an attempt is made to access an object defined with a volatile-qualified type through the use of a non-volatile glvalue, the behavior is undefined. "
2018-03-17ShaderCache: Implement compile priorityStenzek
Currently, when immediately compile shaders is not enabled, the ubershaders will be placed before any specialized shaders in the compile queue in hybrid ubershaders mode. This means that Dolphin could potentially use the ubershaders for a longer time than it would have if we blocked startup until all shaders were compiled, leading to a drop in performance.
2018-03-14Assert: Uppercase assertion macrosLioncash
Macros should be all upper-cased. This is also kind of a wart that's been sticking out for quite a while now (we avoid prefixing underscores).
2018-03-15ShaderCache: Fix several issues in background shader compilingStenzek
- In D3D, shaders could be compiled on the main thread, blocking startup. - Reduced the latency between a pipeline being requested and used in all backends in hybrid ubershader mode, when no shader stages were present. - Fixed a case where async compilation could cause the same UID to be appended multiple times to the UID cache. - Fix incorrect number of threads being used when immediately compile shaders was enabled.
2018-03-14DriverDetails: Disable primitive restart on Vulkan with Mali driverStenzek
2018-03-14Vulkan: Provide a more accurate method of detecting drivers/vendorsStenzek
This is needed to differentiate between the open-source Mesa drivers and their binary counterparts for Intel and AMD.
2018-03-13SSE-optimize UninitializeXFBMemoryHenrik Rydgård
Lowest hanging fruit I could find with a profiler. Not sure this stuff actually needs to be done, but assuming it is, why not do it quickly? 10x faster, goes from 1% CPU to 0.09%.
2018-03-11ShaderCache: Use a version number for pipeline UID cachesStenzek
2018-03-10ShaderCache: Implement background shader compilationStenzek
This enables shaders to be compiled while the game is starting, instead of blocking startup. If a shader is needed before it is compiled, emulation will block.
2018-03-10VideoConfig: Collapse ubershader configuration fields to a single valueStenzek
2018-03-10ShaderCache: Use memcmp for comparing pipeline UIDsStenzek
As these are stored in a map, operator< will become a hot function when doing lookups, which happen every frame. std::tie generated a rather large function here with quite a few branches.
2018-03-10Renderer: Remove now-redundant Set{Rasterization,Depth,Blending}StateStenzek
2018-03-10OGL: Re-implement async shader compilingStenzek
2018-03-10Move shader caches to VideoCommonStenzek
2018-03-02VideoCommon: Add support for Abstract FramebuffersStenzek
2018-03-01AbstractTexture: Add support for depth textures/formatsStenzek
2018-03-01AbstractTexture: Support multisampled abstract textureStenzek
2018-03-01AbstractTexture: Add property/attribute accessor helpersStenzek
2018-03-01VideoCommon: Drop references to AbstractRawTextureStenzek
2018-02-25OGL: Use glBufferData on Mali.Markus Wick
tl;dr: This PR speedups dolphin on mobiles with the Mali GPU and ES 3.2 drivers by a factor of 10 by using the method with the biggest overhead. Please keep care not to buy this shit! The ARM driver team seems to care very well about their customers. But bad luck, users and open source developers are *not* their customers. So even device-independent feature requests are just ignored for *years*: https://community.arm.com/graphics/f/discussions/4645/gl_ext_buffer_storage-support The bad point, they neither implement any of the other common ways to stream dynamic content in unextented GL: - They just ignore the GL_MAP_UNSYNCHRONIZED_BIT flag - They don't support on-device buffer updates and just stall with glBufferSubData It seems like no benchmark is using any dynamic content - and like no customer cares about anything but benchmarks, or users... We have a flag to disable the glBufferSubData way, this PR adds the flag to also disable the unsychronized mapping way. The second one is available since their ES 3.2 update, but slow as hell. So how to continue? The last remaining technical way to stream dynamic content at all is to alloc a new buffer per draw call with glBufferData. This is very gross, but still a factor 10 speedup compared to stalling the GPU. Small tests shows that you can expect another 3-5 times speedup with EXT_buffer_data, so Mali would be on pair with Adreno here. So if you have bought such a device unfortunately, please try to make noise on your vendor forums/support and ask for this extension. If you are going to buy a new mobile, I'd recormend to avoid *any* mobile with a Mali GPU in it.
2018-02-22VideoBackends: Add AbstractShader and AbstractPipeline classesStenzek
2018-02-20Renderer: Handle resize events on-demand instead of pollingStenzek
We now differentiate between a resize event and surface change/destroyed event, reducing the overhead for resizes in the Vulkan backend. It is also now now safe to change the surface multiple times if the video thread is lagging behind.
2018-02-20BPFunctions: Move upscaling of scissor rect to VideoCommonStenzek
2018-02-20BPFunctions: Move GX viewport conversion to VideoCommonStenzek
2018-02-15PixelShaderGen: Implement table-based fog range as in software rendererStenzek
2018-02-11TextureCache: Add an option to disable EFB copies to VRAMStenzek
The option is named DisableCopyToVRAM under the Hacks section in GFX.ini. It is intentionally not exposed to the GUI, as users should not need to use it under normal circumstances. The main use is debugging issues in the EFB-to-RAM shaders.
2018-02-11VideoConfig: Remove bForceCopyToRam fieldStenzek
It's the inverse of supports-copy-to-vram.
2018-02-07Merge pull request #6334 from stenzek/startupAnthony
Video Backend Initialization/Core Boot Improvements
2018-02-01BPMemory: Handle fog configuration where both A and C are infinity/NaNStenzek
The console appears to behave against standard IEEE754 specification here, in particular around how NaNs are handled. NaNs appear to have no effect on the result, and are treated the same as positive or negative infinity, based on the sign bit. However, when the result would be NaN (inf - inf, or (-inf) - (-inf)), this results in a completely fogged color, or unfogged color respectively. We handle this by returning a constant zero for the A varaible, and positive or negative infinity for C depending on the sign bits of the A and C registers. This ensures that no NaN value is passed to the GPU in the first place, and that the result of the fog calculation cannot be NaN.