]> git.cworth.org Git - apitrace-tests/blob - cli/cli-trim-unused-textures.script
Add test to ensure that unused textures are dropped from a trace.
[apitrace-tests] / cli / cli-trim-unused-textures.script
1 # Generate reference images from unmodified trace.
2
3 # We carefully generate images only for desired frames (dropping the
4 # first frame that draws using textures).
5
6 rm_and_mkdir glxsimple-ref
7 apitrace dump-images --calls=10,31,50,71,87,88 --call-nos=no -o ./glxsimple-ref/ glxsimple.trace
8
9 # Trim to the same callset used to generate reference images
10
11 apitrace trim --calls=10,31,50,71,87,88 glxsimple.trace
12
13 # Verify that we actually trimmed what we wanted to
14
15 apitrace diff --diff=diff glxsimple.trace glxsimple-trim.trace
16 expect "44,46d43\n< glGenTextures(1, &1)\n< glBindTexture(GL_TEXTURE_2D, 1)\n< glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, blob(3))\n48,57d44\n< glBegin(GL_QUADS)\n< glTexCoord2f(0, 0)\n< glVertex2f(0, 0)\n< glTexCoord2f(1, 0)\n< glVertex2f(64, 0)\n< glTexCoord2f(1, 1)\n< glVertex2f(64, 64)\n< glTexCoord2f(0, 1)\n< glVertex2f(0, 64)\n< glEnd()\n59,60d45\n< glXSwapBuffers(0x236a280, 41943041)\n< \n"
17
18 # Generate output images for all frames in the trimmed trace
19
20 rm_and_mkdir glxsimple-out
21 apitrace dump-images --call-nos=no -o ./glxsimple-out/ glxsimple-trim.trace
22
23 # Compare output to reference images
24
25 apitrace diff-images -v ./glxsimple-ref ./glxsimple-out
26 expect "Comparing ./glxsimple-ref/0000000000.png and ./glxsimple-out/0000000000.png ... MATCH\nComparing ./glxsimple-ref/0000000001.png and ./glxsimple-out/0000000001.png ... MATCH\nComparing ./glxsimple-ref/0000000002.png and ./glxsimple-out/0000000002.png ... MATCH\nComparing ./glxsimple-ref/0000000003.png and ./glxsimple-out/0000000003.png ... MATCH\nComparing ./glxsimple-ref/0000000004.png and ./glxsimple-out/0000000004.png ... MATCH\n"