Browse Source
Merge pull request #3282 from FernandoS27/indexed-samplers
Merge pull request #3282 from FernandoS27/indexed-samplers
Partially implement Indexed samplers in general and specific code in GLSLnce_cpp
committed by
GitHub
24 changed files with 610 additions and 58 deletions
-
2src/video_core/CMakeLists.txt
-
4src/video_core/engines/const_buffer_engine_interface.h
-
8src/video_core/engines/kepler_compute.cpp
-
4src/video_core/engines/kepler_compute.h
-
8src/video_core/engines/maxwell_3d.cpp
-
4src/video_core/engines/maxwell_3d.h
-
36src/video_core/guest_driver.cpp
-
41src/video_core/guest_driver.h
-
14src/video_core/rasterizer_interface.h
-
28src/video_core/renderer_opengl/gl_rasterizer.cpp
-
4src/video_core/renderer_opengl/gl_shader_cache.cpp
-
33src/video_core/renderer_opengl/gl_shader_decompiler.cpp
-
12src/video_core/renderer_opengl/gl_shader_disk_cache.cpp
-
1src/video_core/renderer_opengl/gl_shader_disk_cache.h
-
19src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
-
17src/video_core/shader/const_buffer_locker.cpp
-
21src/video_core/shader/const_buffer_locker.h
-
68src/video_core/shader/decode.cpp
-
84src/video_core/shader/decode/texture.cpp
-
87src/video_core/shader/node.h
-
6src/video_core/shader/node_helper.h
-
9src/video_core/shader/shader_ir.cpp
-
16src/video_core/shader/shader_ir.h
-
106src/video_core/shader/track.cpp
@ -0,0 +1,36 @@ |
|||
// Copyright 2020 yuzu Emulator Project
|
|||
// Licensed under GPLv2 or any later version
|
|||
// Refer to the license.txt file included.
|
|||
|
|||
#include <algorithm>
|
|||
#include <limits>
|
|||
|
|||
#include "video_core/guest_driver.h"
|
|||
|
|||
namespace VideoCore { |
|||
|
|||
void GuestDriverProfile::DeduceTextureHandlerSize(std::vector<u32>&& bound_offsets) { |
|||
if (texture_handler_size_deduced) { |
|||
return; |
|||
} |
|||
const std::size_t size = bound_offsets.size(); |
|||
if (size < 2) { |
|||
return; |
|||
} |
|||
std::sort(bound_offsets.begin(), bound_offsets.end(), std::less{}); |
|||
u32 min_val = std::numeric_limits<u32>::max(); |
|||
for (std::size_t i = 1; i < size; ++i) { |
|||
if (bound_offsets[i] == bound_offsets[i - 1]) { |
|||
continue; |
|||
} |
|||
const u32 new_min = bound_offsets[i] - bound_offsets[i - 1]; |
|||
min_val = std::min(min_val, new_min); |
|||
} |
|||
if (min_val > 2) { |
|||
return; |
|||
} |
|||
texture_handler_size_deduced = true; |
|||
texture_handler_size = min_texture_handler_size * min_val; |
|||
} |
|||
|
|||
} // namespace VideoCore
|
|||
@ -0,0 +1,41 @@ |
|||
// Copyright 2020 yuzu Emulator Project |
|||
// Licensed under GPLv2 or any later version |
|||
// Refer to the license.txt file included. |
|||
|
|||
#pragma once |
|||
|
|||
#include <vector> |
|||
|
|||
#include "common/common_types.h" |
|||
|
|||
namespace VideoCore { |
|||
|
|||
/** |
|||
* The GuestDriverProfile class is used to learn about the GPU drivers behavior and collect |
|||
* information necessary for impossible to avoid HLE methods like shader tracks as they are |
|||
* Entscheidungsproblems. |
|||
*/ |
|||
class GuestDriverProfile { |
|||
public: |
|||
void DeduceTextureHandlerSize(std::vector<u32>&& bound_offsets); |
|||
|
|||
u32 GetTextureHandlerSize() const { |
|||
return texture_handler_size; |
|||
} |
|||
|
|||
bool TextureHandlerSizeKnown() const { |
|||
return texture_handler_size_deduced; |
|||
} |
|||
|
|||
private: |
|||
// Minimum size of texture handler any driver can use. |
|||
static constexpr u32 min_texture_handler_size = 4; |
|||
// This goes with Vulkan and OpenGL standards but Nvidia GPUs can easily |
|||
// use 4 bytes instead. Thus, certain drivers may squish the size. |
|||
static constexpr u32 default_texture_handler_size = 8; |
|||
|
|||
u32 texture_handler_size = default_texture_handler_size; |
|||
bool texture_handler_size_deduced = false; |
|||
}; |
|||
|
|||
} // namespace VideoCore |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue