summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_cache.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-09-21shader/image: Implement SULD and remove irrelevant codeReinUsesLisp1-8/+8
* Implement SULD as float. * Remove conditional declaration of GL_ARB_shader_viewport_layer_array.
2019-09-17shader_ir/warp: Implement SHFLReinUsesLisp1-1/+2
2019-09-04gl_shader_cache: Remove special casing for geometry shadersReinUsesLisp1-59/+9
Now that ProgramVariants holds the primitive topology we no longer need to keep track of individual geometry shaders topologies.
2019-08-30video_core: Silent miscellaneous warnings (#2820)Rodrigo Locatti1-1/+1
* texture_cache/surface_params: Remove unused local variable * rasterizer_interface: Add missing documentation commentary * maxwell_dma: Remove unused rasterizer reference * video_core/gpu: Sort member declaration order to silent -Wreorder warning * fermi_2d: Remove unused MemoryManager reference * video_core: Silent unused variable warnings * buffer_cache: Silent -Wreorder warnings * kepler_memory: Remove unused MemoryManager reference * gl_texture_cache: Add missing override * buffer_cache: Add missing include * shader/decode: Remove unused variables
2019-08-21shader_ir: Implement VOTEReinUsesLisp1-1/+3
Implement VOTE using Nvidia's intrinsics. Documentation about these can be found here https://developer.nvidia.com/reading-between-threads-shader-intrinsics Instead of using portable ARB instructions I opted to use Nvidia intrinsics because these are the closest we have to how Tegra X1 hardware renders. To stub VOTE on non-Nvidia drivers (including nouveau) this commit simulates a GPU with a warp size of one, returning what is meaningful for the instruction being emulated: * anyThreadNV(value) -> value * allThreadsNV(value) -> value * allThreadsEqualNV(value) -> true ballotARB, also known as "uint64_t(activeThreadsNV())", emits VOTE.ANY Rd, PT, PT; on nouveau's compiler. This doesn't match exactly to Nvidia's code VOTE.ALL Rd, PT, PT; Which is emulated with activeThreadsNV() by this commit. In theory this shouldn't really matter since .ANY, .ALL and .EQ affect the predicates (set to PT on those cases) and not the registers.
2019-07-18gl_shader_cache: Fix newline on buffer preprocessor definitionsReinUsesLisp1-2/+6
2019-07-17Maxwell3D: Rework the dirty system to be more consistant and scaleableFernando Sahmkow1-1/+1
2019-07-16gl_shader_cache: Fix clang-format issuesReinUsesLisp1-2/+1
2019-07-15gl_shader_cache: Address review commentariesReinUsesLisp1-7/+4
2019-07-15gl_shader_cache: Address CI issuesReinUsesLisp1-1/+2
2019-07-15gl_rasterizer: Implement compute shadersReinUsesLisp1-35/+122
2019-07-09shader_ir: propagate shader size to the IRFernando Sahmkow1-7/+15
2019-07-08gl_shader_decompiler: Implement gl_ViewportIndex and gl_Layer in vertex shadersReinUsesLisp1-2/+5
This commit implements gl_ViewportIndex and gl_Layer in vertex and geometry shaders. In the case it's used in a vertex shader, it requires ARB_shader_viewport_layer_array. This extension is available on AMD and Nvidia devices (mesa and proprietary drivers), but not available on Intel on any platform. At the moment of writing this description I don't know if this is a hardware limitation or a driver limitation. In the case that ARB_shader_viewport_layer_array is not available, writes to these registers on a vertex shader are ignored, with the appropriate logging.
2019-07-05texture_cache: Address FeedbackFernando Sahmkow1-2/+4
2019-07-04gl_shader_cache: Make CachedShader constructor privateZach Hilman1-2/+2
Fixes missing review comments introduced.
2019-06-21texture_cache: Style and CorrectionsFernando Sahmkow1-1/+1
2019-06-21shader_cache: Correct versioning and size calculation.Fernando Sahmkow1-1/+6
2019-06-21gl_shader_decompiler: Implement image binding settingsReinUsesLisp1-0/+4
2019-06-21gl_rasterizer: Track texture buffer usageReinUsesLisp1-34/+44
2019-06-08gl_shader_cache: Use static constructors for CachedShader initializationReinUsesLisp1-42/+34
2019-05-30gl_shader_cache: Store a system class and drop global accessorsReinUsesLisp1-7/+8
2019-05-30gl_shader_cache: Add commentaries explaining the intention in shaders creationReinUsesLisp1-0/+2
2019-05-30gl_shader_cache: Flip if condition in GetStageProgram to reduce indentationReinUsesLisp1-25/+26
2019-05-27gl_shader_gen: Always declare extensions after the version declarationReinUsesLisp1-1/+2
This addresses a bug on geometry shaders where code was being written before all #extension declarations were done. Ref to #2523
2019-05-21gl_shader_cache: Fix clang strict standard build issuesReinUsesLisp1-3/+4
2019-05-21gl_shader_cache: Use shared contexts to build shaders in parallelReinUsesLisp1-34/+82
2019-05-10video_core/renderer_opengl/gl_shader_cache: Correct member initialization orderLioncash1-1/+1
Silences a -Wreorder warning.
2019-04-23Re added new lines at the end of filesFreddyFunk1-1/+1
2019-04-23gl_shader_disk_cache: Use VectorVfsFile for the virtual precompiled shader cache fileunknown1-1/+11
2019-04-16Document unsafe versions and add BlockCopyUnsafeFernando Sahmkow1-6/+7
2019-04-16Use ReadBlockUnsafe for Shader CacheFernando Sahmkow1-5/+7
2019-04-14gl_shader_decompiler: Use variable AOFFI on supported hardwareReinUsesLisp1-27/+27
2019-04-07Permit a Null Shader in case of a bad host_ptr.Fernando Sahmkow1-0/+4
2019-04-06video_core/texures/texture: Remove unnecessary includesLioncash1-0/+1
Nothing in this header relies on common_funcs or the memory manager. This gets rid of reliance on indirect inclusions in the OpenGL caches.
2019-03-28gl_shader_manager: Remove unnecessary gl_shader_manager inclusionLioncash1-2/+0
This isn't used at all in the OpenGL shader cache, so we can remove it's include here, meaning one less file needs to be recompiled if any changes ever occur within that header. core/memory.h is also not used within this file at all, so we can remove it as well.
2019-03-27video_core: Amend constructor initializer list order where applicableLioncash1-6/+6
Specifies the members in the same order that initialization would take place in. This also silences -Wreorder warnings.
2019-03-21gpu: Move GPUVAddr definition to common_types.bunnei1-2/+2
2019-03-16video_core: Refactor to use MemoryManager interface for all memory access.bunnei1-20/+17
# Conflicts: # src/video_core/engines/kepler_memory.cpp # src/video_core/engines/maxwell_3d.cpp # src/video_core/morton.cpp # src/video_core/morton.h # src/video_core/renderer_opengl/gl_global_cache.cpp # src/video_core/renderer_opengl/gl_global_cache.h # src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
2019-03-15gpu: Use host address for caching instead of guest address.bunnei1-19/+24
2019-02-07gl_shader_disk_cache: Use unordered containersReinUsesLisp1-3/+3
2019-02-07gl_shader_cache: Fixup GLSL unique identifiersReinUsesLisp1-2/+2
2019-02-07gl_shader_cache: Link loading screen with disk shader cache loadReinUsesLisp1-3/+26
2019-02-07gl_shader_cache: Set GL_PROGRAM_SEPARABLE to dumped shadersReinUsesLisp1-0/+1
i965 (and probably all mesa drivers) require GL_PROGRAM_SEPARABLE when using glProgramBinary. This is probably required by the standard but it's ignored by permisive proprietary drivers.
2019-02-07gl_shader_disk_cache: Pass core system as argument and guard against games without title idsReinUsesLisp1-1/+2
2019-02-07gl_shader_disk_cache: Address miscellaneous feedbackReinUsesLisp1-3/+3
2019-02-07gl_shader_disk_cache: Pass return values returning instead of by parametersReinUsesLisp1-7/+5
2019-02-07gl_shader_disk_cache: Save GLSL and entries into the precompiled fileReinUsesLisp1-32/+39
2019-02-07gl_shader_cache: Refactor to support disk shader cacheReinUsesLisp1-105/+345
2019-02-07rasterizer_interface: Add disk cache entry for the rasterizerReinUsesLisp1-0/+2
2019-02-03video_core: Assert on invalid GPU to CPU address queriesReinUsesLisp1-2/+4
2019-01-30gl_shader_cache: Use explicit bindingsReinUsesLisp1-63/+83
2019-01-30gl_rasterizer: Implement global memory managementReinUsesLisp1-3/+15
2019-01-15video_core: Rename glsl_decompiler to gl_shader_decompilerReinUsesLisp1-1/+1
2019-01-15video_core: Replace gl_shader_decompilerReinUsesLisp1-2/+6
2019-01-07gl_shader_cache: Use dirty flags for shadersReinUsesLisp1-1/+5
2018-12-11gl_shader_cache: Dehardcode constant in CalculateProgramSize()Lioncash1-2/+2
This constant is related to the size of the instruction.
2018-12-11gl_shader_cache: Resolve truncation compiler warningLioncash1-1/+1
The previous code would cause a warning, as it was truncating size_t (64-bit) to a u32 (32-bit) implicitly.
2018-12-09Implemented a shader unique identifier.Fernando Sahmkow1-0/+45
2018-11-20shader_cache: Only lock covered instructions.Markus Wick1-0/+1
2018-11-10gl_shader_decompiler: Guard out of bound geometry shader input readsReinUsesLisp1-2/+6
Geometry shaders follow a pattern that results in out of bound reads. This pattern is: - VSETP to predicate - Use that predicate to conditionally set a register a big number - Use the register to access geometry shaders At the time of writing this commit I don't know what's the intent of this number. Some drivers argue about these out of bound reads. To avoid this issue, input reads are guarded limiting reads to the highest posible vertex input of the current topology (e.g. points to 1 and triangles to 3).
2018-11-08rasterizer_cache: Remove reliance on the System singletonLioncash1-1/+3
Rather than have a transparent dependency, we can make it explicit in the interface. This also gets rid of the need to put the core include in a header.
2018-10-29video_core: Move OpenGL specific utils to its rendererReinUsesLisp1-2/+3
2018-10-22Use standard UBO and fix/stylize the codeFernandoS271-20/+0
2018-10-22Cache uniform locations and restructure the implementationFernandoS271-8/+16
2018-10-22Implemented Alpha TestingFernandoS271-0/+12
2018-10-07gl_shader_decompiler: Implement geometry shadersReinUsesLisp1-5/+29
2018-09-23Added glObjectLabels for renderdoc for textures and shader programs (#1384)David1-0/+2
* Added glObjectLabels for renderdoc for textures and shader programs * Changed hardcoded "Texture" name to reflect the texture type instead * Removed string initialize
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi1-3/+3
2018-09-09video_core: fixed arithmetic overflow warnings & improved code stylePatrick Elsässer1-4/+4
- Fixed all warnings, for renderer_opengl items, which were indicating a possible incorrect behavior from integral promotion rules and types larger than those in which arithmetic is typically performed. - Added const for variables where possible and meaningful. - Added constexpr where possible.
2018-09-04gl_shader_cache: Use an u32 for the binding point cache.Markus Wick1-8/+8
The std::string generation with its malloc and free requirement was a noticeable overhead. Also switch to an ordered_map to avoid the std::hash call. As those maps usually have a size of two elements, the lookup time shall not matter.
2018-08-31gl_renderer: Cache textures, framebuffers, and shaders based on CPU address.bunnei1-11/+7
2018-08-28gl_shader_cache: Remove unused program_code vector in GetShaderAddress()Lioncash1-2/+1
Given std::vector is a type with a non-trivial destructor, this variable cannot be optimized away by the compiler, even if unused. Because of that, something that was intended to be fairly lightweight, was actually allocating 32KB and deallocating it at the end of the function.
2018-08-28renderer_opengl: Implement a new shader cache.bunnei1-0/+131