Previous 199869 Revisions Next

r31853 Monday 1st September, 2014 at 02:09:38 UTC by R. Belmont
SDL: remove more dead code from the GL paths (nw)
[src/osd/sdl]drawogl.c

trunk/src/osd/sdl/drawogl.c
r31852r31853
187187   UINT32              mpass_texture_scrn[2];  // Multipass OpenGL texture "name"/ID for the shader
188188   UINT32              mpass_fbo_scrn[2];      // framebuffer object for this texture, multipass
189189
190   int                 lut_table_width;        // LUT table width
191   int                 lut_table_height;       // LUT table height
192
193190   UINT32              pbo;                    // pixel buffer object for this texture (DYNAMIC only!)
194191   UINT32              *data;                  // pixels for the texture
195192   int                 data_own;               // do we own / allocated it ?
r31852r31853
18951892{
18961893   sdl_info *sdl = (sdl_info *) window->dxdata;
18971894   int uniform_location;
1898   int lut_table_width_pow2=0;
1899   int lut_table_height_pow2=0;
19001895   int i;
19011896   int surf_w_pow2  = get_valid_pow2_value (window->blitwidth, texture->texpow2);
19021897   int surf_h_pow2  = get_valid_pow2_value (window->blitheight, texture->texpow2);
19031898
19041899   assert ( texture->type==TEXTURE_TYPE_SHADER );
19051900
1906   texture->lut_table_height = 1; // default ..
1907
1908   switch(texture->format)
1909   {
1910      case SDL_TEXFORMAT_RGB32_PALETTED:
1911      case SDL_TEXFORMAT_RGB32:
1912         texture->lut_table_width  = 1 << 8; // 8 bits per component
1913         texture->lut_table_width *= 3;      // BGR ..
1914         break;
1915
1916      case SDL_TEXFORMAT_RGB15_PALETTED:
1917      case SDL_TEXFORMAT_RGB15:
1918         texture->lut_table_width  = 1 << 5; // 5 bits per component
1919         texture->lut_table_width *= 3;      // BGR ..
1920         break;
1921
1922      case SDL_TEXFORMAT_PALETTE16:
1923         texture->lut_table_width  = (1 << 8) * 3;
1924         break;
1925
1926      default:
1927         // should never happen
1928         assert(0);
1929         exit(1);
1930   }
1931
1932   texture->lut_table_height = 1;
1933
1934   /**
1935    * always use pow2 for LUT, to minimize the chance for floating point arithmetic errors
1936    * (->buggy GLSL engine)
1937    */
1938   lut_table_height_pow2 = get_valid_pow2_value (texture->lut_table_height, 1 /* texture->texpow2 */);
1939   lut_table_width_pow2  = get_valid_pow2_value (texture->lut_table_width,  1 /* texture->texpow2 */);
1940
1941   if ( lut_table_width_pow2 > sdl->texture_max_width || lut_table_height_pow2 > sdl->texture_max_height )
1942   {
1943      osd_printf_error("Need lut size %dx%d, but max text size is %dx%d, bail out\n",
1944         lut_table_width_pow2, lut_table_height_pow2,
1945         sdl->texture_max_width, sdl->texture_max_height);
1946      return -1;
1947   }
1948
19491901   GL_CHECK_ERROR_QUIET();
19501902
19511903   if( sdl->glsl_program_num > 1 )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team