diff options
author | Harvey Harrison <[email protected]> | 2012-08-24 13:22:14 -0700 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2012-08-24 13:29:11 -0700 |
commit | 473514cc39b204ecc8b70aa5e7ae6e9bd4b9b26e (patch) | |
tree | 340bde4c145f78cf798698b032af16d40bddf0c1 /src | |
parent | a241887b07adf3cdcda780b7a40c482fa02b4699 (diff) |
j3dcore: with remaining supported pipelines, GLSL is always available
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/classes/share/javax/media/j3d/Canvas3D.java | 18 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/JoglPipeline.java | 32 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/MasterControl.java | 12 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/NoopPipeline.java | 15 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/Pipeline.java | 16 |
5 files changed, 19 insertions, 74 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java index c2217a3..44ed868 100644 --- a/src/classes/share/javax/media/j3d/Canvas3D.java +++ b/src/classes/share/javax/media/j3d/Canvas3D.java @@ -2430,8 +2430,7 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine this.drawable, this.fbConfig, shareCtx, isSharedCtx, - this.offScreen, - VirtualUniverse.mc.glslLibraryAvailable); + this.offScreen); // compute the max available texture units maxAvailableTextureUnits = Math.max(maxTextureUnits, maxTextureImageUnits); @@ -3656,8 +3655,7 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine // inside the native code after setting the various // fields in this object createQueryContext(screen.display, drawable, - fbConfig, offScreen, 1, 1, - VirtualUniverse.mc.glslLibraryAvailable); + fbConfig, offScreen, 1, 1); // compute the max available texture units maxAvailableTextureUnits = Math.max(maxTextureUnits, maxTextureImageUnits); } @@ -4795,20 +4793,16 @@ void addTextureResource(int id, TextureRetained obj) { // This is the native method for creating the underlying graphics context. private Context createNewContext(long display, Drawable drawable, long fbConfig, Context shareCtx, boolean isSharedCtx, - boolean offScreen, - boolean glslLibraryAvailable) { + boolean offScreen) { return Pipeline.getPipeline().createNewContext(this, display, drawable, fbConfig, shareCtx, isSharedCtx, - offScreen, - glslLibraryAvailable); + offScreen); } private void createQueryContext(long display, Drawable drawable, - long fbConfig, boolean offScreen, int width, int height, - boolean glslLibraryAvailable) { + long fbConfig, boolean offScreen, int width, int height) { Pipeline.getPipeline().createQueryContext(this, display, drawable, - fbConfig, offScreen, width, height, - glslLibraryAvailable); + fbConfig, offScreen, width, height); } // This is the native for creating offscreen buffer diff --git a/src/classes/share/javax/media/j3d/JoglPipeline.java b/src/classes/share/javax/media/j3d/JoglPipeline.java index 1ada96f..39df173 100644 --- a/src/classes/share/javax/media/j3d/JoglPipeline.java +++ b/src/classes/share/javax/media/j3d/JoglPipeline.java @@ -114,15 +114,6 @@ class JoglPipeline extends Pipeline { // TODO: finish this with any other needed initialization } - /** - * Returns true if the GLSL library is loaded and available. Note that this - * does not necessarily mean that GLSL is supported by the graphics card. - */ - boolean isGLSLLibraryAvailable() { - return true; - } - - // --------------------------------------------------------------------- // @@ -6179,8 +6170,7 @@ class JoglPipeline extends Pipeline { // This is the native method for creating the underlying graphics context. Context createNewContext(Canvas3D cv, long display, Drawable drawable, long fbConfig, Context shareCtx, boolean isSharedCtx, - boolean offScreen, - boolean glslLibraryAvailable) { + boolean offScreen) { if (VERBOSE) System.err.println("JoglPipeline.createNewContext()"); GLDrawable draw = null; GLCapabilitiesChooser indexChooser = null; @@ -6240,7 +6230,7 @@ class JoglPipeline extends Pipeline { if(!isSharedCtx){ // Set up fields in Canvas3D - setupCanvasProperties(cv, ctx, gl, glslLibraryAvailable); + setupCanvasProperties(cv, ctx, gl); } // Enable rescale normal @@ -6269,8 +6259,7 @@ class JoglPipeline extends Pipeline { } void createQueryContext(Canvas3D cv, long display, Drawable drawable, - long fbConfig, boolean offScreen, int width, int height, - boolean glslLibraryAvailable) { + long fbConfig, boolean offScreen, int width, int height) { if (VERBOSE) System.err.println("JoglPipeline.createQueryContext()"); // FIXME: for now, ignoring the "offscreen" flag -- unclear how @@ -6283,7 +6272,7 @@ class JoglPipeline extends Pipeline { f.setUndecorated(true); f.setLayout(new BorderLayout()); GLCapabilities caps = new GLCapabilities(getDefaultProfile()); - ContextQuerier querier = new ContextQuerier(cv, glslLibraryAvailable); + ContextQuerier querier = new ContextQuerier(cv); // FIXME: should know what GraphicsDevice on which to create // this Canvas / Frame, and this should probably be known from // the incoming "display" parameter @@ -7617,8 +7606,7 @@ class JoglPipeline extends Pipeline { private void setupCanvasProperties(Canvas3D cv, JoglContext ctx, - GL gl, - boolean glslLibraryAvailable) { + GL gl) { // Note: this includes relevant portions from both the // NativePipeline's getPropertiesFromCurrentContext and setupCanvasProperties @@ -7757,7 +7745,7 @@ class JoglPipeline extends Pipeline { // Check shader extensions if (gl13) { - checkGLSLShaderExtensions(cv, ctx, gl, glslLibraryAvailable); + checkGLSLShaderExtensions(cv, ctx, gl, true); } else { // Force shaders to be disabled, since no multitexture support checkGLSLShaderExtensions(cv, ctx, gl, false); @@ -8327,13 +8315,10 @@ class JoglPipeline extends Pipeline { // than just a GLCapabilitiesChooser class ContextQuerier extends DefaultGLCapabilitiesChooser implements ExtendedCapabilitiesChooser { private Canvas3D canvas; - private boolean glslLibraryAvailable; private boolean done; - public ContextQuerier(Canvas3D canvas, - boolean glslLibraryAvailable) { + public ContextQuerier(Canvas3D canvas) { this.canvas = canvas; - this.glslLibraryAvailable = glslLibraryAvailable; } public boolean done() { @@ -8345,8 +8330,7 @@ class JoglPipeline extends Pipeline { JoglContext jctx = new JoglContext(context); // Set up various properties if (getPropertiesFromCurrentContext(jctx)) { - setupCanvasProperties(canvas, jctx, context.getGL(), - glslLibraryAvailable); + setupCanvasProperties(canvas, jctx, context.getGL()); } markDone(); } diff --git a/src/classes/share/javax/media/j3d/MasterControl.java b/src/classes/share/javax/media/j3d/MasterControl.java index a418421..654fdd6 100644 --- a/src/classes/share/javax/media/j3d/MasterControl.java +++ b/src/classes/share/javax/media/j3d/MasterControl.java @@ -370,13 +370,6 @@ class MasterControl { // to control this. boolean stencilClear = false; - // Flags indicating whether the Cg or GLSL libraries are available; we still need - // to check for the actual extension support when the Canvas3D with its associated context - // is created. Note that these are qualifed by the above globalShadingLanguage, so at - // most one of these two flags will be true; - static boolean glslLibraryAvailable = false; - - // REQUESTCLEANUP messages argument static Integer REMOVEALLCTXS_CLEANUP = new Integer(1); static Integer REMOVECTX_CLEANUP = new Integer(2); @@ -567,9 +560,7 @@ class MasterControl { // Build display lists for geometry with vertex attributes // ONLY if we are in GLSL mode and GLSL shaders are available - if (glslLibraryAvailable) { - vertexAttrsInDisplayList = true; - } + vertexAttrsInDisplayList = true; } // Check to see whether Renderer can run without DSI lock @@ -877,7 +868,6 @@ private static String getProperty(final String prop) { // Construct the singleton Pipeline instance Pipeline.createPipeline(pipelineType); - glslLibraryAvailable = Pipeline.getPipeline().isGLSLLibraryAvailable(); librariesLoaded = true; } diff --git a/src/classes/share/javax/media/j3d/NoopPipeline.java b/src/classes/share/javax/media/j3d/NoopPipeline.java index ad2ace7..d661e22 100644 --- a/src/classes/share/javax/media/j3d/NoopPipeline.java +++ b/src/classes/share/javax/media/j3d/NoopPipeline.java @@ -50,15 +50,6 @@ class NoopPipeline extends Pipeline { assert pipelineType == Pipeline.Type.NOOP; } - /** - * Returns true if the GLSL library is loaded and available. Note that this - * does not necessarily mean that GLSL is supported by the graphics card. - */ - boolean isGLSLLibraryAvailable() { - return true; - } - - // --------------------------------------------------------------------- // @@ -962,14 +953,12 @@ class NoopPipeline extends Pipeline { // This is the native method for creating the underlying graphics context. Context createNewContext(Canvas3D cv, long display, Drawable drawable, long fbConfig, Context shareCtx, boolean isSharedCtx, - boolean offScreen, - boolean glslLibraryAvailable) { + boolean offScreen) { return new NoopContext(); } void createQueryContext(Canvas3D cv, long display, Drawable drawable, - long fbConfig, boolean offScreen, int width, int height, - boolean glslLibraryAvailable) { + long fbConfig, boolean offScreen, int width, int height) { } // This is the native for creating offscreen buffer diff --git a/src/classes/share/javax/media/j3d/Pipeline.java b/src/classes/share/javax/media/j3d/Pipeline.java index d93b184..5636e3e 100644 --- a/src/classes/share/javax/media/j3d/Pipeline.java +++ b/src/classes/share/javax/media/j3d/Pipeline.java @@ -149,16 +149,6 @@ public Pipeline run() { } } - - // --------------------------------------------------------------------- - - /** - * Returns true if the GLSL library is loaded and available. Note that this - * does not necessarily mean that GLSL is supported by the graphics card. - */ - abstract boolean isGLSLLibraryAvailable(); - - // --------------------------------------------------------------------- // @@ -976,12 +966,10 @@ public Pipeline run() { // This is the native method for creating the underlying graphics context. abstract Context createNewContext(Canvas3D cv, long display, Drawable drawable, long fbConfig, Context shareCtx, boolean isSharedCtx, - boolean offScreen, - boolean glslLibraryAvailable); + boolean offScreen); abstract void createQueryContext(Canvas3D cv, long display, Drawable drawable, - long fbConfig, boolean offScreen, int width, int height, - boolean glslLibraryAvailable); + long fbConfig, boolean offScreen, int width, int height); // This is the native for creating offscreen buffer abstract Drawable createOffScreenBuffer(Canvas3D cv, Context ctx, long display, long fbConfig, int width, int height); |