Ignore:
Timestamp:
05/05/16 19:37:28 (9 years ago)
Author:
epyon
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gl/gl_device.cc

    r491 r492  
    9898        unsigned glid = 0;
    9999        unsigned gl_type = texture_type_to_enum( type );
    100         GLint gl_internal = GLint( nv::image_format_to_internal_enum( aformat.format ) );
     100        GLenum gl_internal = GLenum( nv::image_format_to_internal_enum( aformat.format ) );
    101101        unsigned gl_enum = nv::image_format_to_enum( aformat.format );
    102102
     
    119119        }
    120120
    121         glTexParameteri( gl_type, GL_TEXTURE_MIN_FILTER, GLint( nv::sampler_filter_to_enum( asampler.filter_min ) ) );
    122         glTexParameteri( gl_type, GL_TEXTURE_MAG_FILTER, GLint( nv::sampler_filter_to_enum( asampler.filter_max ) ) );
     121        if ( gl_type != GL_TEXTURE_2D_MULTISAMPLE )
     122        {
     123                glTexParameteri( gl_type, GL_TEXTURE_MIN_FILTER, GLint( nv::sampler_filter_to_enum( asampler.filter_min ) ) );
     124                glTexParameteri( gl_type, GL_TEXTURE_MAG_FILTER, GLint( nv::sampler_filter_to_enum( asampler.filter_max ) ) );
     125        }
    123126       
    124         if ( gl_enum != GL_RED_INTEGER )
     127        if ( gl_type != GL_TEXTURE_2D_MULTISAMPLE && gl_enum != GL_RED_INTEGER )
    125128        {
    126129                glTexParameteri( gl_type, GL_TEXTURE_WRAP_S, GLint( nv::sampler_wrap_to_enum( asampler.wrap_s ) ) );
     
    130133        if ( is_depth )
    131134        {
    132                 glTexParameteri( gl_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
    133                 glTexParameteri( gl_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
     135//              glTexParameteri( gl_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
     136//              glTexParameteri( gl_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
    134137
    135138                // This is to allow usage of shadow2DProj function in the shader
     
    146149//      glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso );
    147150
    148         glTexImage2D( gl_type, 0, gl_internal, size.x, size.y, 0, gl_enum, nv::datatype_to_gl_enum(aformat.type), data );
     151        if ( gl_type != GL_TEXTURE_2D_MULTISAMPLE )
     152                glTexImage2D( gl_type, 0, gl_internal, size.x, size.y, 0, gl_enum, nv::datatype_to_gl_enum(aformat.type), data );
     153        else
     154                glTexImage2DMultisample( gl_type, 4, gl_internal, size.x, size.y, 1 );
    149155
    150156        glBindTexture( gl_type, 0 );
     
    163169nv::texture nv::gl_device::create_texture( texture_type type, pixel_format format )
    164170{
    165         NV_ASSERT_ALWAYS( type == TEXTURE_1D_BUFFER );
     171        NV_ASSERT_ALWAYS( type == TEXTURE_1D_BUFFER, "create_texture not texture buffer!" );
    166172        unsigned glid = 0;
    167         unsigned gl_type = texture_type_to_enum( type );
    168173
    169174        glGenTextures( 1, &glid );
     
    552557                NV_ASSERT( u, "Unknown uniform type!" );
    553558                (*p->m_uniform_map)[ name ] = u;
     559                //NV_LOG_DEBUG( "Uniform : ", name, " - ", utype, "/", uni_len );
     560
    554561        }
    555562
Note: See TracChangeset for help on using the changeset viewer.