This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can i use ASTC in Emulator_v1.2

Note: This was originally posted on 21st May 2013 at http://forums.arm.com

Hi.


i don't know astc load.

i tryed  as follows.

step1 . PNG file compressed using Mali_Compress_tool  (  768X512 PNG file   ->  Very fast   block: 4X4 Low Dynamic Range   ) 
              Output file:    test.astc

step2.  Using glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, 768, 512, 0, astc_size, imageData)
                        [size=2]GL_CHECK(glTexParameteri(target, GL_TEXTURE_WRAP_S,     GL_CLAMP_TO_EDGE));[/size]
   GL_CHECK(glTexParameteri(target, GL_TEXTURE_WRAP_T,     GL_CLAMP_TO_EDGE));
   GL_CHECK(glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
   GL_CHECK(glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR));

astc_size :  file size
                FILE *f = fopen(filename, "rb");

  fseek(f, 0L, SEEK_END);
  astc_size = ftell(f);
  fseek(f, 0L, SEEK_SET);
[size=2]
[/size]
[size=2]imageData[/size][size=2]    :  [/size]

   [size=2]imageData[/size][size=2]    [/size]= (unsigned char*) malloc(size);
  fread([size=2]imageData[/size][size=2]    [/size], astc_size , 1, f);


error occurs in the [size=2]glCompressedTexImage2D[/size]
[size=2]
[/size]
[size=2]How can i load ASTC file?[/size]
Parents
  • Note: This was originally posted on 27th May 2013 at http://forums.arm.com


    Hi Jooyoung,

    Sorry to hear you're having trouble. A few questions:

    Can you let us know what the error returned by glGetError() is?
    Also your snippet is incomplete, so can you confirm that the texture has been generated, bound, and no errors have occured up to the glCompressedTexImage2D call?

    Thanks,
    Chris




    Hi Chris,

    this is glGetError() message.

    Debug: Number of configs found is 12

    GL renderer: [GeForce GTX 660/PCIe/SSE2]
    GL vendor:[NVIDIA Corporation]
    GL version: [4.2.0]
    GL shading language version: [4.20 NVIDIA via Cg compiler]
    glGetError() = 1280 (0x00000500) at d:*****/astc_test.cpp:607
    . . .


    "astc_test.cpp:607" is   GL_CHECK(glCompressedTexImage2D(target, 0, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, output_image->xsize, output_image->ysize, 0, output_image->xsize* output_image->ysize, output_image->imagedata8[0][0]));


    Can i get astc_load function or  example code ?

    Thanks,
    Jooyoung
Reply
  • Note: This was originally posted on 27th May 2013 at http://forums.arm.com


    Hi Jooyoung,

    Sorry to hear you're having trouble. A few questions:

    Can you let us know what the error returned by glGetError() is?
    Also your snippet is incomplete, so can you confirm that the texture has been generated, bound, and no errors have occured up to the glCompressedTexImage2D call?

    Thanks,
    Chris




    Hi Chris,

    this is glGetError() message.

    Debug: Number of configs found is 12

    GL renderer: [GeForce GTX 660/PCIe/SSE2]
    GL vendor:[NVIDIA Corporation]
    GL version: [4.2.0]
    GL shading language version: [4.20 NVIDIA via Cg compiler]
    glGetError() = 1280 (0x00000500) at d:*****/astc_test.cpp:607
    . . .


    "astc_test.cpp:607" is   GL_CHECK(glCompressedTexImage2D(target, 0, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, output_image->xsize, output_image->ysize, 0, output_image->xsize* output_image->ysize, output_image->imagedata8[0][0]));


    Can i get astc_load function or  example code ?

    Thanks,
    Jooyoung
Children
No data