Bug 106123 - draw does not work in a simple example
Summary: draw does not work in a simple example
Status: NEEDINFO
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-18 09:22 UTC by xinghua
Modified: 2018-04-18 10:45 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
source code of example (11.79 KB, text/x-csrc)
2018-04-18 09:22 UTC, xinghua
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xinghua 2018-04-18 09:22:31 UTC
Created attachment 138904 [details]
source code of example

I found a issue in ANGLE project that draw does not work, and had written a simple example to reproduce this issue, attachment is the source code.
Steps:
1. gcc -o srgb srgb.c -lX11 -lepoxy
2. ./srgb

I had used readPixels to get fbo content and wrote content to files in current directory, the name is "result_1/2/3/4.rgba", These files were all empty, it seems that mesa did draw nothing.
The same case had run on NVIDIA GPU, which draw something normally.
I had spent some time to debug it, but did not find the root cause. Please help me to check it, thank you.
Comment 1 Denis 2018-04-18 10:45:17 UTC
Your variant:

GLubyte pixels_4[128 * 128 * 4];
  glReadPixels(0, 0, 128, 128, GL_RGBA, GL_UNSIGNED_BYTE, &pixels_4[0]);
  FILE *outputFile_4 = fopen("result_4.rgba", "a");
  fprintf(outputFile_4, "%s\n", (char *)(pixels_4));
  fclose(outputFile_4);


Proposed variant:

GLubyte pixels_4[128 * 128 * 4];
  glReadPixels(0, 0, 128, 128, GL_RGBA, GL_UNSIGNED_BYTE, &pixels_4[0]);
  FILE *outputFile_4 = fopen("result_4.rgba", "a");
  //fprintf(outputFile_4, "%s\n", (char *)(pixels_4));
  fwrite( pixels_4, sizeof pixels_4[0], sizeof(pixels_4)/sizeof(pixels_4[0]), outputFile_4 );
  fclose(outputFile_4);


In all of these files after changing the code (as I pasted higher) - was written repeated values of 00 00 00 FF. Each file has the same size - 65536 B.
In your variant each time should contain only 0A "\n" because first byte of pixels_N contains 00.

Are you sure that output for Nvidia had correct (expected) values??


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.