/** * Sets the shaders that this technique definition will use. * * @param shaderNames EnumMap containing all shader names for this stage * @param shaderLanguages EnumMap containing all shader languages for this stage */ public void setShaderFile(EnumMap<Shader.ShaderType, String> shaderNames, EnumMap<Shader.ShaderType, String> shaderLanguages) { requiredCaps.clear(); weight = 0; for (Shader.ShaderType shaderType : shaderNames.keySet()) { String language = shaderLanguages.get(shaderType); String shaderFile = shaderNames.get(shaderType); this.shaderLanguages.put(shaderType, language); this.shaderNames.put(shaderType, shaderFile); Caps cap = Caps.valueOf(language); requiredCaps.add(cap); weight = Math.max(weight, cap.ordinal()); if (shaderType.equals(Shader.ShaderType.Geometry)) { requiredCaps.add(Caps.GeometryShader); } else if (shaderType.equals(Shader.ShaderType.TessellationControl)) { requiredCaps.add(Caps.TesselationShader); } } }
/** * Sets the shaders that this technique definition will use. * * @param shaderNames EnumMap containing all shader names for this stage * @param shaderLanguages EnumMap containing all shader languages for this stage */ public void setShaderFile(EnumMap<Shader.ShaderType, String> shaderNames, EnumMap<Shader.ShaderType, String> shaderLanguages) { requiredCaps.clear(); weight = 0; for (Shader.ShaderType shaderType : shaderNames.keySet()) { String language = shaderLanguages.get(shaderType); String shaderFile = shaderNames.get(shaderType); this.shaderLanguages.put(shaderType, language); this.shaderNames.put(shaderType, shaderFile); Caps cap = Caps.valueOf(language); requiredCaps.add(cap); weight = Math.max(weight, cap.ordinal()); if (shaderType.equals(Shader.ShaderType.Geometry)) { requiredCaps.add(Caps.GeometryShader); } else if (shaderType.equals(Shader.ShaderType.TessellationControl)) { requiredCaps.add(Caps.TesselationShader); } } }