3939import com .jme3 .math .FastMath ;
4040import com .jme3 .renderer .Caps ;
4141import com .jme3 .renderer .Renderer ;
42- import com .jme3 .renderer .opengl .GL2 ;
4342import com .jme3 .texture .image .ColorSpace ;
4443import com .jme3 .texture .image .LastTextureState ;
4544import com .jme3 .util .BufferUtils ;
@@ -598,61 +597,6 @@ public boolean isFloatingPont(){
598597
599598
600599
601- }
602-
603- public enum Access {
604-
605- /**
606- * The image can only read from in a shader.
607- */
608- ReadOnly (true , false , GL2 .GL_READ_ONLY ),
609-
610- /**
611- * The image can written to in a shader.
612- */
613- WriteOnly (false , true , GL2 .GL_WRITE_ONLY ),
614-
615- /**
616- * The image can both be written to and read from in a shader.
617- */
618- ReadWrite (true , true , GL2 .GL_READ_WRITE );
619-
620- private final boolean read , write ;
621- private final int glEnum ;
622-
623- private Access (boolean read , boolean write , int glEnum ) {
624- this .read = read ;
625- this .write = write ;
626- this .glEnum = glEnum ;
627- }
628-
629- /**
630- * If true, the image can be read from in a shader.
631- *
632- * @return
633- */
634- public boolean isRead () {
635- return read ;
636- }
637-
638- /**
639- * If true, the image can be written to in a shader.
640- *
641- * @return
642- */
643- public boolean isWrite () {
644- return write ;
645- }
646-
647- /**
648- * Corresponding OpenGL enum.
649- *
650- * @return
651- */
652- public int getGlEnum () {
653- return glEnum ;
654- }
655-
656600 }
657601
658602 // image attributes
@@ -662,8 +606,6 @@ public int getGlEnum() {
662606 protected ArrayList <ByteBuffer > data ;
663607 protected int multiSamples = 1 ;
664608 protected ColorSpace colorSpace = null ;
665- protected Access access = null ;
666- protected int bindLayer = -1 ;
667609// protected int mipOffset = 0;
668610
669611 // attributes relating to GL object
@@ -1268,70 +1210,6 @@ public ColorSpace getColorSpace() {
12681210 return colorSpace ;
12691211 }
12701212
1271- /**
1272- * Sets the access modifier for this image.
1273- * <p>
1274- * If not null, the image will be bound in such a way as to allow
1275- * {@code imageStore} and {@code imageLoad} functions to work. Otherwise
1276- * the image will be bound normally.
1277- * <p>
1278- * default=null
1279- *
1280- * @param access
1281- */
1282- public void setAccess (Access access ) {
1283- if (this .access != access ) {
1284- this .access = access ;
1285- setUpdateNeeded ();
1286- }
1287- }
1288-
1289- /**
1290- *
1291- * @return
1292- * @see #setAccess(com.jme3.texture.Image.Access)
1293- */
1294- public Access getAccess () {
1295- return access ;
1296- }
1297-
1298- /**
1299- * Sets the bind layer used if {@link #getAccess()} does not
1300- * return null.
1301- * <p>
1302- * If greater than or equal to zero, only the specified layer will be
1303- * bound. If less than zero, the entire image will be bound.
1304- * <p>
1305- * default=-1
1306- *
1307- * @param bindLayer
1308- */
1309- public void setBindLayer (int bindLayer ) {
1310- if (this .bindLayer != bindLayer ) {
1311- this .bindLayer = bindLayer ;
1312- setUpdateNeeded ();
1313- }
1314- }
1315-
1316- /**
1317- *
1318- * @return
1319- * @see #setBindLayer(int)
1320- */
1321- public int getBindLayer () {
1322- return bindLayer ;
1323- }
1324-
1325- /**
1326- * Returns true if the entire image will be bound in cases where
1327- * {@link #getAccess()} does not return null.
1328- *
1329- * @return
1330- */
1331- public boolean isLayered () {
1332- return bindLayer < 0 ;
1333- }
1334-
13351213 @ Override
13361214 public String toString (){
13371215 StringBuilder sb = new StringBuilder ();
@@ -1408,8 +1286,6 @@ public void write(JmeExporter e) throws IOException {
14081286 capsule .write (multiSamples , "multiSamples" , 1 );
14091287 capsule .writeByteBufferArrayList (data , "data" , null );
14101288 capsule .write (colorSpace , "colorSpace" , null );
1411- capsule .write (access , "access" , null );
1412- capsule .write (bindLayer , "bindLayer" , -1 );
14131289 }
14141290
14151291 @ Override
@@ -1423,8 +1299,6 @@ public void read(JmeImporter importer) throws IOException {
14231299 multiSamples = capsule .readInt ("multiSamples" , 1 );
14241300 data = capsule .readByteBufferArrayList ("data" , null );
14251301 colorSpace = capsule .readEnum ("colorSpace" , ColorSpace .class , null );
1426- access = capsule .readEnum ("access" , Access .class , null );
1427- bindLayer = capsule .readInt ("bindLayer" , -1 );
14281302 if (mipMapSizes != null ) {
14291303 needGeneratedMips = false ;
14301304 mipsWereGenerated = true ;
0 commit comments