Fixing some implicit casts. These must be ignored

in GLSL 1.5 but with older GLSL spec'ed I was getting
implicit cast errors.
I believe these are harmless if not needed but I'm
not sure if there are hidden ramifications.  This
looks more correct to my eyes.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10866 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
PSp..om 11 years ago
parent b8071a2f50
commit 46b573db52
  1. 8
      engine/src/core-data/Common/ShaderLib/MultiSample.glsllib

@ -18,16 +18,16 @@ uniform int m_NumSamplesDepth;
// NOTE: Only define multisample functions if multisample is available and is being used! // NOTE: Only define multisample functions if multisample is available and is being used!
#if defined(GL_ARB_texture_multisample) && (defined(RESOLVE_MS) || defined(RESOLVE_DEPTH_MS)) #if defined(GL_ARB_texture_multisample) && (defined(RESOLVE_MS) || defined(RESOLVE_DEPTH_MS))
vec4 textureFetch(in sampler2DMS tex,in vec2 texC, in int numSamples){ vec4 textureFetch(in sampler2DMS tex,in vec2 texC, in int numSamples){
ivec2 iTexC = ivec2(texC * textureSize(tex)); ivec2 iTexC = ivec2(texC * vec2(textureSize(tex)));
vec4 color = vec4(0.0); vec4 color = vec4(0.0);
for (int i = 0; i < numSamples; i++){ for (int i = 0; i < numSamples; i++){
color += texelFetch(tex, iTexC, i); color += texelFetch(tex, iTexC, i);
} }
return color / numSamples; return color / float(numSamples);
} }
vec4 fetchTextureSample(in sampler2DMS tex,in vec2 texC,in int sample){ vec4 fetchTextureSample(in sampler2DMS tex,in vec2 texC,in int sample){
ivec2 iTexC = ivec2(texC * textureSize(tex)); ivec2 iTexC = ivec2(texC * vec2(textureSize(tex)));
return texelFetch(tex, iTexC, sample); return texelFetch(tex, iTexC, sample);
} }
@ -36,7 +36,7 @@ vec4 getColor(in sampler2DMS tex, in vec2 texC){
} }
vec4 getColorSingle(in sampler2DMS tex, in vec2 texC){ vec4 getColorSingle(in sampler2DMS tex, in vec2 texC){
ivec2 iTexC = ivec2(texC * textureSize(tex)); ivec2 iTexC = ivec2(texC * vec2(textureSize(tex)));
return texelFetch(tex, iTexC, 0); return texelFetch(tex, iTexC, 0);
} }

Loading…
Cancel
Save