Changeset 492 for trunk/src/gl/gl_device.cc
- Timestamp:
- 05/05/16 19:37:28 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_device.cc
r491 r492 98 98 unsigned glid = 0; 99 99 unsigned gl_type = texture_type_to_enum( type ); 100 GL int gl_internal = GLint( nv::image_format_to_internal_enum( aformat.format ) );100 GLenum gl_internal = GLenum( nv::image_format_to_internal_enum( aformat.format ) ); 101 101 unsigned gl_enum = nv::image_format_to_enum( aformat.format ); 102 102 … … 119 119 } 120 120 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 } 123 126 124 if ( gl_ enum != GL_RED_INTEGER )127 if ( gl_type != GL_TEXTURE_2D_MULTISAMPLE && gl_enum != GL_RED_INTEGER ) 125 128 { 126 129 glTexParameteri( gl_type, GL_TEXTURE_WRAP_S, GLint( nv::sampler_wrap_to_enum( asampler.wrap_s ) ) ); … … 130 133 if ( is_depth ) 131 134 { 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 ); 134 137 135 138 // This is to allow usage of shadow2DProj function in the shader … … 146 149 // glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso ); 147 150 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 ); 149 155 150 156 glBindTexture( gl_type, 0 ); … … 163 169 nv::texture nv::gl_device::create_texture( texture_type type, pixel_format format ) 164 170 { 165 NV_ASSERT_ALWAYS( type == TEXTURE_1D_BUFFER );171 NV_ASSERT_ALWAYS( type == TEXTURE_1D_BUFFER, "create_texture not texture buffer!" ); 166 172 unsigned glid = 0; 167 unsigned gl_type = texture_type_to_enum( type );168 173 169 174 glGenTextures( 1, &glid ); … … 552 557 NV_ASSERT( u, "Unknown uniform type!" ); 553 558 (*p->m_uniform_map)[ name ] = u; 559 //NV_LOG_DEBUG( "Uniform : ", name, " - ", utype, "/", uni_len ); 560 554 561 } 555 562
Note: See TracChangeset
for help on using the changeset viewer.