Merge pull request #1474 from kd-11/gl_shader_validate

gl: Move program validation from link-time to draw-time to comply with spec
This commit is contained in:
vlj 2016-02-04 22:31:15 +01:00
commit 020d282868
2 changed files with 7 additions and 1 deletions

View File

@ -583,6 +583,13 @@ void GLGSRender::end()
glEnableVertexAttribArray(0); glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 2, GL_FLOAT, false, 0, 0); glVertexAttribPointer(0, 2, GL_FLOAT, false, 0, 0);
/**
* Validate fails if called right after linking a program because the VS and FS both use textures bound using different
* samplers. So far only sampler2D has been largely used, hiding the problem. This call shall also degrade performance further
* if used every draw call. Fixes shader validation issues on AMD.
*/
m_program->validate();
if (draw_command == rsx::draw_command::indexed) if (draw_command == rsx::draw_command::indexed)
{ {
m_ebo.data(vertex_index_array.size(), vertex_index_array.data()); m_ebo.data(vertex_index_array.size(), vertex_index_array.data());

View File

@ -2096,7 +2096,6 @@ namespace gl
void make() void make()
{ {
link(); link();
validate();
} }
uint id() const uint id() const