home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / i386unix / 145 < prev    next >
Encoding:
Text File  |  1992-12-24  |  3.5 KB  |  70 lines

  1. Newsgroups: comp.windows.x.i386unix
  2. Path: sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!roell
  3. From: roell@informatik.tu-muenchen.de (Thomas Roell)
  4. Subject: Re: 32K or 16M colours?
  5. In-Reply-To: mouse@thunder.mcrcim.mcgill.edu's message of 23 Dec 92 17:19:33 GMT
  6. References: <linda.724803368@minnie> <1992Dec20.000426.21774@cbnewsj.cb.att.com>
  7.     <1992Dec22.130619.18414@news.lrz-muenchen.de>
  8.     <1992Dec23.171933.11736@thunder.mcrcim.mcgill.edu>
  9. Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
  10. Organization: Inst. fuer Informatik, Technische Univ. Muenchen, Germany
  11. Date: Thu, 24 Dec 1992 11:58:11 GMT
  12. Message-ID: <1992Dec24.115811.1540@Informatik.TU-Muenchen.DE>
  13. Lines: 55
  14.  
  15. >>> Take a look at how the 24-bit SVGA's are implemented.  Packed 3-byte
  16. >>> pixels.  It's going to make working on them rediculous[sic].
  17. >> I don't think 3byte pixels is that rediculus[sic] if you look at the
  18. >> memory contraints given in todays SVGAs.  But the price to pay is
  19. >> VERY high.  You can only deal with 24bpp (opposed to 32bpp) by using
  20. >> 32bit reads/writes.  A simple statistic shows that about every second
  21. >> access will be not correctly aligned and hence at least 2 32bit
  22. >> accesses to video memroy will be necessary.  Having this in mind a
  23. >> 24bpp framebuffer will be at leat 1.5 times slower than a 32bpp.
  24. >
  25. >Only if the implementation is careless.  You should be doing three
  26. >32-bit memory accesses for every four pixels.  Only if you're doing
  27. >something narrow (ie, small span along the x axis) will the
  28. >misalignment effect make much difference.  Granted, drawing lines is a
  29. >common operation, but I believe area copies and text drawing are much
  30. >more important for nearly all applications.
  31.  
  32. Hmmm .... very intresting. I tried it doing it the 'careless' way. Anyway,
  33. I have some perhaps strong arguments again doing your approach (at leat
  34. some thoughts that might make this approach not a good as it seems to be
  35. at first, but nevertheless faster than the dumb brute force approach):
  36.  
  37. 1) Much of the speed of cfb comes from the fact that basically all unary
  38.    operations (everything except CopyArea and CopyPlane) are reduced to:
  39.  
  40.         (((dst) & (and)) ^ (xor))
  41.  
  42.    and & xor are precumputed constants (with optimisations if xor == 0 or
  43.    and == PMSK). If you would used units of 96bits (for four pixels) you
  44.    had to use 6 constants instead of 2, which might break the register
  45.    allocation of your compiler.
  46.  
  47. 2) The way cfb handles ragged edges would have to be changed to make
  48.    as few accesses as possible, instead of reading one pixel unit (32bit 
  49.    for cfb) and simply handle the complete group. Instead you hand to make
  50.    special case for 3,2,1 pixels which are unaligned.
  51.  
  52. 3) Cases for CopyArea where source and destination will not have the 
  53.    same alignment regarding the 96bit units will have to be handled in
  54.    a complex shifting code. For 32bit units you have enought registers on
  55.    a 386, but with 96bit units, you have to store temporay results and
  56.    hence will be slower than using unaligned accesses.
  57.  
  58.  
  59. But after all this way seems to be faster than even 32bpp. One would
  60. have to try it out. But on the other hand I feel like the speed will be still
  61. to slow for real usage. And then most people will get accelerated graphics
  62. boards, which do support TrueColor but again only in 32bpp ...
  63.  
  64. - Thomas
  65. --
  66. -------------------------------------------------------------------------------
  67. Das Reh springt hoch,                 e-mail: roell@sgcs.com
  68. das Reh springt weit,                #include <sys/pizza.h>
  69. was soll es tun, es hat ja Zeit ...
  70.