diff options
author | José Fonseca <[email protected]> | 2013-05-28 13:56:18 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2013-05-28 13:56:18 +0100 |
commit | 4eaa0999b52d2c7a8fb561305eef889dc7de2d2f (patch) | |
tree | f8bbe48f147dcf3d7a3d0a9d1d67374866e932fa /src/glsl | |
parent | d4a06d77f5898726e2453ef32795a2183c033c05 (diff) |
glsl: Fix MSVC build.
It appears that `sizeof(Class::member)` is either non-standard or
merely unsupported in MSVC.
So use `sizeof(instance->member)` instead, which is guaranteed to work
everywhere.
Also promote the assert to a static assert.
Trivial.
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/link_uniforms.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 04218be7ac9..ad636681f8e 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -653,7 +653,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog) * types cannot have initializers." */ memset(prog->_LinkedShaders[i]->SamplerUnits, 0, - sizeof(gl_shader::SamplerUnits)); + sizeof(prog->_LinkedShaders[i]->SamplerUnits)); link_update_uniform_buffer_variables(prog->_LinkedShaders[i]); @@ -724,9 +724,9 @@ link_assign_uniform_locations(struct gl_shader_program *prog) prog->_LinkedShaders[i]->active_samplers = parcel.shader_samplers_used; prog->_LinkedShaders[i]->shadow_samplers = parcel.shader_shadow_samplers; - assert(sizeof(gl_shader::SamplerTargets) == sizeof(parcel.targets)); + STATIC_ASSERT(sizeof(prog->_LinkedShaders[i]->SamplerTargets) == sizeof(parcel.targets)); memcpy(prog->_LinkedShaders[i]->SamplerTargets, parcel.targets, - sizeof(gl_shader::SamplerTargets)); + sizeof(prog->_LinkedShaders[i]->SamplerTargets)); } #ifndef NDEBUG |