Arm Community
Site
Search
User
Site
Search
User
Groups
Education Hub
Distinguished Ambassadors
Open Source Software and Platforms
Research Collaboration and Enablement
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello forum
Operating Systems forum
SoC Design and Simulation forum
SystemReady Forum
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Internet of Things (IoT) blog
Operating Systems blog
SoC Design and Simulation blog
Tools, Software and IDEs blog
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Graphics, Gaming, and VR forum
How can i use ASTC in Emulator_v1.2
Jump...
Cancel
Locked
Locked
Replies
3 replies
Subscribers
136 subscribers
Views
4921 views
Users
0 members are here
Adaptive Scalable Texture Compression (ASTC)
Options
Share
More actions
Cancel
Related
How was your experience today?
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
jooyoung jung
over 11 years ago
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
Sean Ellis
over 11 years ago
Note: This was originally posted on 24th June 2013 at
http://forums.arm.com
Jooyong, did you get this working?
The code as you present it does not take account of the header at the front of the ASTC file, which is 16 bytes in length. It is constructed as follows:
Bytes 0..3 are the magic header value 0x5CA1AB13
Byte 4 is the X block dimension
Byte 5 is the Y block dimension
Byte 6 is the Z block dimension
Bytes 7..9 are the X image size (this is a 24-bit value, measured in pixels)
Bytes 10..12 are the Y image size
Bytes 13..15 are the Z image size (which will be 1 for a 2D image)
All multi-byte values are little-endian.
Immediately following the header is the actual image data, which is of size (ftell(f)-16) bytes. This is the data that should be passed to glCompressedTexImage2D.
Cancel
Up
0
Down
Cancel
Reply
Sean Ellis
over 11 years ago
Note: This was originally posted on 24th June 2013 at
http://forums.arm.com
Jooyong, did you get this working?
The code as you present it does not take account of the header at the front of the ASTC file, which is 16 bytes in length. It is constructed as follows:
Bytes 0..3 are the magic header value 0x5CA1AB13
Byte 4 is the X block dimension
Byte 5 is the Y block dimension
Byte 6 is the Z block dimension
Bytes 7..9 are the X image size (this is a 24-bit value, measured in pixels)
Bytes 10..12 are the Y image size
Bytes 13..15 are the Z image size (which will be 1 for a 2D image)
All multi-byte values are little-endian.
Immediately following the header is the actual image data, which is of size (ftell(f)-16) bytes. This is the data that should be passed to glCompressedTexImage2D.
Cancel
Up
0
Down
Cancel
Children
No data