diff options
| author | 2018-04-14 18:50:06 -0400 | |
|---|---|---|
| committer | 2018-04-14 18:50:06 -0400 | |
| commit | 1b41b875dcd24c662b947731f48f4d1c7131fa0b (patch) | |
| tree | 57b8c1f1952c53d54a0c14b00543dd21302d661b /src | |
| parent | shaders: Address PR review feedback. (diff) | |
| download | yuzu-1b41b875dcd24c662b947731f48f4d1c7131fa0b.tar.gz yuzu-1b41b875dcd24c662b947731f48f4d1c7131fa0b.tar.xz yuzu-1b41b875dcd24c662b947731f48f4d1c7131fa0b.zip | |
shaders: Add NumTextureSamplers const, remove unused #pragma.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/shader_bytecode.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_manager.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_manager.h | 3 |
4 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 98af381df..eff0c35a1 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -323,7 +323,5 @@ static_assert(sizeof(Instruction) == 0x8, "Incorrect structure size"); | |||
| 323 | static_assert(std::is_standard_layout<Instruction>::value, | 323 | static_assert(std::is_standard_layout<Instruction>::value, |
| 324 | "Structure does not have standard layout"); | 324 | "Structure does not have standard layout"); |
| 325 | 325 | ||
| 326 | #pragma pack() | ||
| 327 | |||
| 328 | } // namespace Shader | 326 | } // namespace Shader |
| 329 | } // namespace Tegra | 327 | } // namespace Tegra |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 32b897eb2..71c21c69b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -128,7 +128,7 @@ private: | |||
| 128 | OGLVertexArray hw_vao; | 128 | OGLVertexArray hw_vao; |
| 129 | std::array<bool, 16> hw_vao_enabled_attributes; | 129 | std::array<bool, 16> hw_vao_enabled_attributes; |
| 130 | 130 | ||
| 131 | std::array<SamplerInfo, 32> texture_samplers; | 131 | std::array<SamplerInfo, GLShader::NumTextureSamplers> texture_samplers; |
| 132 | static constexpr size_t VERTEX_BUFFER_SIZE = 128 * 1024 * 1024; | 132 | static constexpr size_t VERTEX_BUFFER_SIZE = 128 * 1024 * 1024; |
| 133 | std::unique_ptr<OGLStreamBuffer> vertex_buffer; | 133 | std::unique_ptr<OGLStreamBuffer> vertex_buffer; |
| 134 | OGLBuffer uniform_buffer; | 134 | OGLBuffer uniform_buffer; |
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp index 67f2be056..7fceedce8 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.cpp +++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp | |||
| @@ -38,7 +38,7 @@ void SetShaderSamplerBindings(GLuint shader) { | |||
| 38 | cur_state.Apply(); | 38 | cur_state.Apply(); |
| 39 | 39 | ||
| 40 | // Set the texture samplers to correspond to different texture units | 40 | // Set the texture samplers to correspond to different texture units |
| 41 | for (u32 texture = 0; texture < 32; ++texture) { | 41 | for (u32 texture = 0; texture < NumTextureSamplers; ++texture) { |
| 42 | // Set the texture samplers to correspond to different texture units | 42 | // Set the texture samplers to correspond to different texture units |
| 43 | std::string uniform_name = "tex[" + std::to_string(texture) + "]"; | 43 | std::string uniform_name = "tex[" + std::to_string(texture) + "]"; |
| 44 | GLint uniform_tex = glGetUniformLocation(shader, uniform_name.c_str()); | 44 | GLint uniform_tex = glGetUniformLocation(shader, uniform_name.c_str()); |
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.h b/src/video_core/renderer_opengl/gl_shader_manager.h index b5a7b2a18..5c8560cf5 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.h +++ b/src/video_core/renderer_opengl/gl_shader_manager.h | |||
| @@ -14,6 +14,9 @@ | |||
| 14 | 14 | ||
| 15 | namespace GLShader { | 15 | namespace GLShader { |
| 16 | 16 | ||
| 17 | /// Number of OpenGL texture samplers that can be used in the fragment shader | ||
| 18 | static constexpr size_t NumTextureSamplers = 32; | ||
| 19 | |||
| 17 | using Tegra::Engines::Maxwell3D; | 20 | using Tegra::Engines::Maxwell3D; |
| 18 | 21 | ||
| 19 | namespace Impl { | 22 | namespace Impl { |