summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Vogel <email@jannikvogel.de>2016-05-23 16:03:11 +0200
committerJannik Vogel <email@jannikvogel.de>2016-06-07 00:06:28 +0200
commitc900c092e329d2e78b9663c1c3fe401da7faaea5 (patch)
tree63c3eb37dd9871f04fad9e3b4f772d4b58e16817
parentMerge pull request #1873 from archshift/remove-config (diff)
downloadyuzu-c900c092e329d2e78b9663c1c3fe401da7faaea5.tar
yuzu-c900c092e329d2e78b9663c1c3fe401da7faaea5.tar.gz
yuzu-c900c092e329d2e78b9663c1c3fe401da7faaea5.tar.bz2
yuzu-c900c092e329d2e78b9663c1c3fe401da7faaea5.tar.lz
yuzu-c900c092e329d2e78b9663c1c3fe401da7faaea5.tar.xz
yuzu-c900c092e329d2e78b9663c1c3fe401da7faaea5.tar.zst
yuzu-c900c092e329d2e78b9663c1c3fe401da7faaea5.zip
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h10
-rw-r--r--src/video_core/renderer_opengl/gl_shader_gen.cpp4
2 files changed, 8 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index bb7f20161..bdc7bd0f2 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -316,16 +316,18 @@ private:
GLfloat dist_atten_scale;
};
- /// Uniform structure for the Uniform Buffer Object, all members must be 16-byte aligned
+ /// Uniform structure for the Uniform Buffer Object, all vectors must be 16-byte aligned
+ // NOTE: Always keep a vec4 at the end. The GL spec is not clear wether the alignment at
+ // the end of a uniform block is included in UNIFORM_BLOCK_DATA_SIZE or not.
+ // Not following that rule will cause problems on some AMD drivers.
struct UniformData {
- // A vec4 color for each of the six tev stages
- GLvec4 const_color[6];
- GLvec4 tev_combiner_buffer_color;
GLint alphatest_ref;
GLfloat depth_scale;
GLfloat depth_offset;
alignas(16) GLvec3 lighting_global_ambient;
LightSrc light_src[8];
+ alignas(16) GLvec4 const_color[6]; // A vec4 color for each of the six tev stages
+ alignas(16) GLvec4 tev_combiner_buffer_color;
};
static_assert(sizeof(UniformData) == 0x390, "The size of the UniformData structure has changed, update the structure in the shader");
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp
index 8332e722d..ea7ab2883 100644
--- a/src/video_core/renderer_opengl/gl_shader_gen.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp
@@ -552,13 +552,13 @@ struct LightSrc {
};
layout (std140) uniform shader_data {
- vec4 const_color[NUM_TEV_STAGES];
- vec4 tev_combiner_buffer_color;
int alphatest_ref;
float depth_scale;
float depth_offset;
vec3 lighting_global_ambient;
LightSrc light_src[NUM_LIGHTS];
+ vec4 const_color[NUM_TEV_STAGES];
+ vec4 tev_combiner_buffer_color;
};
uniform sampler2D tex[3];