Previous 199869 Revisions Next

r30975 Saturday 14th June, 2014 at 19:10:40 UTC by R. Belmont
SDL: Always supply screen size uniforms to GLSL shaders, and fix bug with X multihead. [R. Belmont]
[src/osd/sdl]drawogl.c

trunk/src/osd/sdl/drawogl.c
r30974r30975
18731873   int lut_table_width_pow2=0;
18741874   int lut_table_height_pow2=0;
18751875   int i;
1876   int surf_w_pow2  = get_valid_pow2_value (window->width, texture->texpow2);
1877   int surf_h_pow2  = get_valid_pow2_value (window->height, texture->texpow2);
1876   int surf_w_pow2  = get_valid_pow2_value (window->blitwidth, texture->texpow2);
1877   int surf_h_pow2  = get_valid_pow2_value (window->blitheight, texture->texpow2);
18781878
18791879   assert ( texture->type==TEXTURE_TYPE_SHADER );
18801880
r30974r30975
19591959         GL_CHECK_ERROR_NORMAL();
19601960      }
19611961
1962      {
1963         GLfloat color_texture_pow2_sz[2] = { (GLfloat)texture->rawwidth_create, (GLfloat)texture->rawheight_create };
1964         uniform_location = pfn_glGetUniformLocationARB(sdl->glsl_program[i], "color_texture_pow2_sz");
1965         pfn_glUniform2fvARB(uniform_location, 1, &(color_texture_pow2_sz[0]));
1966         GL_CHECK_ERROR_NORMAL();
1967      }
1968      if ( i>sdl->glsl_program_mb2sc )
1969      {
1970         {
1971            GLfloat screen_texture_sz[2] = { (GLfloat)window->width, (GLfloat)window->height };
1972            uniform_location = pfn_glGetUniformLocationARB(sdl->glsl_program[i], "screen_texture_sz");
1973            pfn_glUniform2fvARB(uniform_location, 1, &(screen_texture_sz[0]));
1974            GL_CHECK_ERROR_NORMAL();
1975         }
1962      GLfloat color_texture_pow2_sz[2] = { (GLfloat)texture->rawwidth_create, (GLfloat)texture->rawheight_create };
1963      uniform_location = pfn_glGetUniformLocationARB(sdl->glsl_program[i], "color_texture_pow2_sz");
1964      pfn_glUniform2fvARB(uniform_location, 1, &(color_texture_pow2_sz[0]));
1965      GL_CHECK_ERROR_NORMAL();
19761966
1977         {
1978            GLfloat screen_texture_pow2_sz[2] = { (GLfloat)surf_w_pow2, (GLfloat)surf_h_pow2 };
1979            uniform_location = pfn_glGetUniformLocationARB(sdl->glsl_program[i], "screen_texture_pow2_sz");
1980            pfn_glUniform2fvARB(uniform_location, 1, &(screen_texture_pow2_sz[0]));
1981            GL_CHECK_ERROR_NORMAL();
1982         }
1983      }
1967      GLfloat screen_texture_sz[2] = { (GLfloat)window->blitwidth, (GLfloat)window->blitheight };
1968      uniform_location = pfn_glGetUniformLocationARB(sdl->glsl_program[i], "screen_texture_sz");
1969      pfn_glUniform2fvARB(uniform_location, 1, &(screen_texture_sz[0]));
1970      GL_CHECK_ERROR_NORMAL();
1971
1972      GLfloat screen_texture_pow2_sz[2] = { (GLfloat)surf_w_pow2, (GLfloat)surf_h_pow2 };
1973      uniform_location = pfn_glGetUniformLocationARB(sdl->glsl_program[i], "screen_texture_pow2_sz");
1974      pfn_glUniform2fvARB(uniform_location, 1, &(screen_texture_pow2_sz[0]));
1975      GL_CHECK_ERROR_NORMAL();
19841976   }
19851977
19861978   pfn_glUseProgramObjectARB(sdl->glsl_program[0]); // start with 1st shader

Previous 199869 Revisions Next


© 1997-2024 The MAME Team