Changeset 331
- Timestamp:
- 09/09/14 20:08:33 (11 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/gl/gl_context.hh
r326 r331 20 20 { 21 21 unsigned glid; 22 unsigned depth_rb_glid; 22 23 }; 23 24 … … 35 36 virtual const framebuffer_info* get_framebuffer_info( framebuffer f ) const; 36 37 38 virtual void set_draw_buffers( uint32 count, output_slot* slots ); 39 virtual void set_draw_buffer( output_slot slot ); 40 virtual void set_read_buffer( output_slot slot ); 41 virtual void blit( framebuffer f, clear_state::buffers_type mask, ivec2 src1, ivec2 src2, ivec2 dst1, ivec2 dst2 ); 42 43 virtual void attach( framebuffer f, output_slot slot, texture t ); 44 virtual void attach( framebuffer f, texture depth ); 45 virtual void attach( framebuffer f, ivec2 size ); 46 virtual bool check( framebuffer_slot ft ); 47 virtual void bind( framebuffer f, framebuffer_slot ft = FRAMEBUFFER ); 37 48 virtual void bind( texture t, texture_slot slot ); 38 49 … … 54 65 // void bind( buffer b ); 55 66 void bind( vertex_array va ); 56 void bind( framebuffer va );57 67 void unbind( program p ); 58 68 // void unbind( buffer b ); -
trunk/nv/gl/gl_device.hh
r326 r331 44 44 virtual program create_program( const string& vs_source, const string& fs_source ); 45 45 virtual buffer create_buffer( buffer_type type, buffer_hint hint, size_t size, const void* source = nullptr ); 46 virtual texture create_texture( ivec2 size, image_format aformat, sampler asampler, void* data = nullptr );46 virtual texture create_texture( texture_type type, ivec2 size, image_format aformat, sampler asampler, void* data = nullptr ); 47 47 48 48 virtual void release( buffer b ); -
trunk/nv/gl/gl_enum.hh
r319 r331 22 22 { 23 23 24 unsigned int texture_type_to_enum( texture_type type ); 24 25 unsigned int clear_state_buffers_to_mask( clear_state::buffers_type type ); 25 26 unsigned int depth_state_function_to_enum( depth_test::function_type type ); … … 34 35 unsigned int buffer_type_to_enum( buffer_type type ); 35 36 unsigned int image_format_to_enum( pixel_format format ); 37 unsigned int image_format_to_internal_enum( pixel_format format ); 36 38 unsigned int sampler_filter_to_enum( sampler::filter filter ); 37 39 unsigned int sampler_wrap_to_enum( sampler::wrap wrap ); 38 40 unsigned int primitive_to_enum( primitive p ); 41 unsigned int framebuffer_slot_to_enum( framebuffer_slot slot ); 42 unsigned int output_slot_to_enum( output_slot slot ); 39 43 40 44 unsigned int datatype_to_gl_enum( datatype type ); -
trunk/nv/interface/context.hh
r323 r331 37 37 }; 38 38 39 enum framebuffer_slot 40 { 41 READ_FRAMEBUFFER, 42 DRAW_FRAMEBUFFER, 43 FRAMEBUFFER, 44 }; 45 39 46 class mesh_interface 40 47 { … … 64 71 uint32 color_attachment_count; 65 72 texture depth_attachment; 66 texture depth_stencil_attachment;67 73 }; 68 74 … … 83 89 virtual const framebuffer_info* get_framebuffer_info( framebuffer ) const = 0; 84 90 91 virtual void set_draw_buffers( uint32 count, output_slot* slots ) = 0; 92 virtual void set_draw_buffer( output_slot slot ) = 0; 93 virtual void set_read_buffer( output_slot slot ) = 0; 94 virtual void blit( framebuffer f, clear_state::buffers_type mask, ivec2 src1, ivec2 src2, ivec2 dst1, ivec2 dst2 ) = 0; 95 96 virtual void attach( framebuffer f, output_slot slot, texture t ) = 0; 97 virtual void attach( framebuffer f, texture depth ) = 0; 98 virtual void attach( framebuffer f, ivec2 size ) = 0; 99 100 virtual bool check( framebuffer_slot ft ) = 0; 101 virtual void bind( framebuffer f, framebuffer_slot slot = FRAMEBUFFER ) = 0; 85 102 virtual void bind( texture, texture_slot ) = 0; 86 103 virtual void update( texture, void* ) = 0; -
trunk/nv/interface/device.hh
r326 r331 23 23 { 24 24 class window; 25 26 enum output_slot 27 { 28 OUTPUT_0 = 0, 29 OUTPUT_1 = 1, 30 OUTPUT_2 = 2, 31 OUTPUT_3 = 3, 32 OUTPUT_4 = 4, 33 OUTPUT_5 = 5, 34 OUTPUT_6 = 6, 35 OUTPUT_7 = 7, 36 37 OUTPUT_NONE = 16, 38 OUTPUT_FRONT = 17, 39 OUTPUT_BACK = 18, 40 }; 41 42 enum texture_type 43 { 44 TEXTURE_1D, 45 TEXTURE_2D, 46 TEXTURE_RECT, 47 TEXTURE_3D, 48 TEXTURE_CUBE, 49 }; 25 50 26 51 enum texture_slot … … 99 124 struct texture_info 100 125 { 126 texture_type type; 101 127 ivec2 size; 102 128 image_format format; … … 132 158 virtual program create_program( const string& vs_source, const string& fs_source ) = 0; 133 159 virtual buffer create_buffer( buffer_type type, buffer_hint hint, size_t size, const void* source = nullptr ) = 0; 134 virtual texture create_texture( ivec2 size, image_format aformat, sampler asampler, void* data = nullptr ) = 0; 160 virtual texture create_texture( texture_type type, ivec2 size, image_format aformat, sampler asampler, void* data = nullptr ) = 0; 161 // TODO: remove? 162 virtual texture create_texture( ivec2 size, image_format aformat, sampler asampler, void* data = nullptr ) { return create_texture( TEXTURE_2D, size, aformat, asampler, data ); } 135 163 virtual image_data* create_image_data( const std::string& filename ) = 0; // temporary 136 164 virtual void release( texture ) = 0; -
trunk/nv/lib/detail/gl_types.inc
r295 r331 125 125 #define GL_MAX_VIEWPORT_DIMS 0x0D3A 126 126 #define GL_SUBPIXEL_BITS 0x0D50 127 #define GL_TEXTURE_1D 0x0DE0 127 128 #define GL_TEXTURE_2D 0x0DE1 129 #define GL_TEXTURE_3D 0x806F 130 #define GL_TEXTURE_CUBE_MAP 0x8513 128 131 #define GL_POLYGON_OFFSET_UNITS 0x2A00 129 132 #define GL_POLYGON_OFFSET_POINT 0x2A01 … … 522 525 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 523 526 527 /* GL_ARB_TEXTURE_RECTANGLE */ 528 // TODO: this should be checked by the extension mechanism 529 #define GL_TEXTURE_RECTANGLE 0x84F5 530 #define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 531 #define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 532 #define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 533 #define GL_SAMPLER_2D_RECT 0x8B63 534 #define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 535 536 524 537 #endif // NV_LIB_GL_TYPES_HH -
trunk/src/gl/gl_context.cc
r326 r331 24 24 nv::framebuffer nv::gl_context::create_framebuffer() 25 25 { 26 if ( is_gl_extension_loaded( GL_EXT_FRAMEBUFFER_OBJECT ) )26 if ( is_gl_extension_loaded( GL_EXT_FRAMEBUFFER_OBJECT ) && is_gl_extension_loaded( GL_EXT_FRAMEBUFFER_BLIT ) ) 27 27 { 28 28 unsigned glid = 0; … … 31 31 gl_framebuffer_info* info = m_framebuffers.get( result ); 32 32 info->glid = glid; 33 info->depth_rb_glid = 0; 33 34 info->color_attachment_count = 0; 34 35 return result; … … 57 58 { 58 59 // TODO: release textures? 59 glBindFramebuffer(GL_FRAMEBUFFER, 0); 60 glDeleteFramebuffers(1, &info->glid); 60 glBindFramebuffer( GL_FRAMEBUFFER, 0 ); 61 glBindRenderbuffer( GL_RENDERBUFFER, 0 ); 62 if ( info->depth_rb_glid == 0 ) 63 glDeleteRenderbuffers( 1, &info->depth_rb_glid ); 64 glDeleteFramebuffers( 1, &info->glid ); 61 65 } 62 66 } … … 77 81 } 78 82 83 void nv::gl_context::attach( framebuffer f, output_slot slot, texture t ) 84 { 85 // TODO: framebuffer variable, so no re-binding? 86 // TODO: support 1d, 3d textures, cubemaps or layers? 87 // TODO: support GL_READ_FRAMEBUFFER? 88 const gl_framebuffer_info* info = m_framebuffers.get( f ); 89 const gl_texture_info* tinfo = (gl_texture_info*)m_device->get_texture_info( t ); 90 if ( info ) 91 { 92 glBindFramebuffer( GL_FRAMEBUFFER, info->glid ); 93 unsigned gl_type = texture_type_to_enum( tinfo->type ); 94 95 if ( tinfo ) 96 { 97 // if ( tinfo->size.y == 0 ) 98 // glFramebufferTexture1D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+(unsigned)slot, GL_TEXTURE_1D, tinfo->glid, 0 ); 99 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+(unsigned)slot, gl_type, tinfo->glid, 0 ); 100 } 101 else 102 { 103 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+(unsigned)slot, gl_type, 0, 0 ); 104 } 105 106 } 107 } 108 109 void nv::gl_context::attach( framebuffer f, texture depth ) 110 { 111 // TODO: framebuffer variable, so no re-binding? 112 // TODO: support GL_READ_FRAMEBUFFER? 113 const gl_framebuffer_info* info = m_framebuffers.get( f ); 114 const gl_texture_info* tinfo = (gl_texture_info*)m_device->get_texture_info( depth ); 115 if ( info ) 116 { 117 glBindFramebuffer( GL_FRAMEBUFFER, info->glid ); 118 unsigned gl_type = texture_type_to_enum( tinfo->type ); 119 120 if ( tinfo ) 121 { 122 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, gl_type, tinfo->glid, 0 ); 123 } 124 else 125 { 126 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, gl_type, 0, 0 ); 127 } 128 } 129 } 130 131 void nv::gl_context::attach( framebuffer f, ivec2 size ) 132 { 133 // TODO: framebuffer variable, so no re-binding? 134 // TODO: support GL_READ_FRAMEBUFFER? 135 gl_framebuffer_info* info = m_framebuffers.get( f ); 136 if ( info ) 137 { 138 glBindFramebuffer( GL_FRAMEBUFFER, info->glid ); 139 if ( info->depth_rb_glid ) glDeleteRenderbuffers( 1, &(info->depth_rb_glid) ); 140 glGenRenderbuffers( 1, &(info->depth_rb_glid) ); 141 glBindRenderbuffer( GL_RENDERBUFFER, info->depth_rb_glid ); 142 glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, size.x, size.y ); 143 glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, info->depth_rb_glid ); 144 glBindRenderbuffer( GL_RENDERBUFFER, 0 ); 145 } 146 147 } 148 149 void nv::gl_context::blit( framebuffer f, clear_state::buffers_type mask, ivec2 src1, ivec2 src2, ivec2 dst1, ivec2 dst2 ) 150 { 151 gl_framebuffer_info* info = m_framebuffers.get( f ); 152 if ( info ) 153 { 154 glBindFramebuffer( GL_FRAMEBUFFER, info->glid ); 155 unsigned filter = mask == clear_state::COLOR_BUFFER ? GL_LINEAR : GL_NEAREST; 156 glBlitFramebuffer( src1.x, src1.y, src2.x, src2.y, dst1.x, dst1.y, dst2.x, dst2.y, clear_state_buffers_to_mask( mask ), filter ); 157 } 158 } 159 160 161 bool nv::gl_context::check( framebuffer_slot ft ) 162 { 163 if ( is_gl_extension_loaded( GL_EXT_FRAMEBUFFER_OBJECT ) && is_gl_extension_loaded( GL_EXT_FRAMEBUFFER_BLIT ) ) 164 { 165 unsigned result = glCheckFramebufferStatus( framebuffer_slot_to_enum(ft) ); 166 if ( result == GL_FRAMEBUFFER_COMPLETE ) return true; 167 switch ( result ) 168 { 169 case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT : NV_LOG( LOG_ERROR, "gl_context::check : Framebuffer incomplete attachment!" ); break; 170 case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT : NV_LOG( LOG_ERROR, "gl_context::check : Framebuffer missing attachment!" ); break; 171 case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS : NV_LOG( LOG_ERROR, "gl_context::check : Framebuffer incomplete dimensions!" ); break; 172 case GL_FRAMEBUFFER_INCOMPLETE_FORMATS : NV_LOG( LOG_ERROR, "gl_context::check : Framebuffer incomplete formats!" ); break; 173 case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER : NV_LOG( LOG_ERROR, "gl_context::check : Framebuffer incomplete draw buffer!" ); break; 174 case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER : NV_LOG( LOG_ERROR, "gl_context::check : Framebuffer incomplete read buffer!" ); break; 175 case GL_FRAMEBUFFER_UNSUPPORTED : NV_LOG( LOG_ERROR, "gl_context::check : Framebuffer format combination unsupported!" ); break; 176 default : NV_LOG( LOG_ERROR, "gl_context::check : Unknown Framebuffer error! (" << result << ")" ); break; 177 } 178 } 179 else 180 { 181 NV_LOG( LOG_ERROR, "gl_context::check : Framebuffer extensions not loaded!" ); 182 } 183 return false; 184 } 185 186 void nv::gl_context::bind( framebuffer f, framebuffer_slot ft /*= FRAMEBUFFER_BOTH */ ) 187 { 188 const gl_framebuffer_info* info = m_framebuffers.get( f ); 189 if ( info ) 190 { 191 glBindFramebuffer( framebuffer_slot_to_enum(ft), info->glid ); 192 } 193 else 194 { 195 glBindFramebuffer( framebuffer_slot_to_enum(ft), 0 ); 196 } 197 } 79 198 80 199 void gl_context::bind( texture t, texture_slot slot ) … … 84 203 { 85 204 glActiveTexture( GL_TEXTURE0 + static_cast< GLenum >( slot ) ); 86 glBindTexture( GL_TEXTURE_2D, info->glid );205 glBindTexture( texture_type_to_enum( info->type ), info->glid ); 87 206 } 88 207 } … … 151 270 } 152 271 153 void nv::gl_context::bind( framebuffer f )154 {155 const gl_framebuffer_info* info = m_framebuffers.get( f );156 if ( info )157 {158 glBindFramebuffer( GL_FRAMEBUFFER, info->glid );159 }160 }161 162 272 void nv::gl_context::unbind( program ) 163 273 { … … 199 309 glBindFramebuffer( GL_FRAMEBUFFER, 0 ); 200 310 } 311 glDrawBuffer( GL_BACK ); 312 glReadBuffer( GL_BACK ); 201 313 } 202 314 … … 206 318 if ( info ) 207 319 { 208 image_format format = info->format; 209 ivec2 size = info->size; 210 211 glBindTexture( GL_TEXTURE_2D, info->glid ); 212 glTexImage2D( GL_TEXTURE_2D, 0, (GLint)nv::image_format_to_enum(format.format), size.x, size.y, 0, nv::image_format_to_enum(format.format), nv::datatype_to_gl_enum(format.type), data ); 320 image_format format = info->format; 321 ivec2 size = info->size; 322 unsigned gl_type = texture_type_to_enum( info->type ); 323 324 glBindTexture( gl_type, info->glid ); 325 glTexImage2D( gl_type, 0, (GLint)nv::image_format_to_internal_enum(format.format), size.x, size.y, 0, nv::image_format_to_enum(format.format), nv::datatype_to_gl_enum(format.type), data ); 213 326 } 214 327 } … … 290 403 m_render_state.stencil_test.enabled = stencil.enabled; 291 404 } 292 405 293 406 if ( stencil.enabled ) 294 407 { … … 579 692 : context( a_device ), m_handle( a_handle ) 580 693 { 694 // TODO: configurable: 695 load_gl_extensions( GL_EXT_FRAMEBUFFER_BLIT | GL_EXT_FRAMEBUFFER_OBJECT ); 581 696 force_apply_render_state( m_render_state ); 582 697 } … … 603 718 } 604 719 720 void nv::gl_context::set_draw_buffers( uint32 count, output_slot* slots ) 721 { 722 unsigned int buffers[8]; 723 count = glm::min<uint32>( count, 8 ); 724 for ( uint32 i = 0; i < count; ++i ) 725 { 726 buffers[i] = output_slot_to_enum( slots[i] ); 727 if ( slots[i] > OUTPUT_7 ) buffers[i] = 0; 728 } 729 glDrawBuffers( count, buffers ); 730 } 731 732 void nv::gl_context::set_draw_buffer( output_slot slot ) 733 { 734 glDrawBuffer( output_slot_to_enum(slot) ); 735 } 736 737 void nv::gl_context::set_read_buffer( output_slot slot ) 738 { 739 glReadBuffer( output_slot_to_enum(slot) ); 740 } 741 605 742 void gl_context::draw( primitive prim, const render_state& rs, program p, vertex_array va, size_t count ) 606 743 { -
trunk/src/gl/gl_device.cc
r326 r331 62 62 } 63 63 64 nv::texture nv::gl_device::create_texture( ivec2 size, image_format aformat, sampler asampler, void* data /*= nullptr */ )64 nv::texture nv::gl_device::create_texture( texture_type type, ivec2 size, image_format aformat, sampler asampler, void* data /*= nullptr */ ) 65 65 { 66 66 unsigned glid = 0; 67 unsigned gl_type = texture_type_to_enum( type ); 67 68 glGenTextures( 1, &glid ); 68 69 69 glBindTexture( GL_TEXTURE_2D, glid );70 glBindTexture( gl_type, glid ); 70 71 71 72 // Detect if mipmapping was requested 72 if (( asampler.filter_min != sampler::LINEAR && asampler.filter_min != sampler::NEAREST ) || 73 ( asampler.filter_max != sampler::LINEAR && asampler.filter_max != sampler::NEAREST )) 74 { 75 glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); 76 } 77 78 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (int)nv::sampler_filter_to_enum( asampler.filter_min ) ); 79 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (int)nv::sampler_filter_to_enum( asampler.filter_max ) ); 80 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, (int)nv::sampler_wrap_to_enum( asampler.wrap_s) ); 81 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, (int)nv::sampler_wrap_to_enum( asampler.wrap_t) ); 82 83 if (data) 84 { 85 glTexImage2D( GL_TEXTURE_2D, 0, (GLint)nv::image_format_to_enum(aformat.format), size.x, size.y, 0, nv::image_format_to_enum(aformat.format), nv::datatype_to_gl_enum(aformat.type), data ); 86 } 87 88 glBindTexture( GL_TEXTURE_2D, 0 ); 73 if ( gl_type == GL_TEXTURE_2D && asampler.filter_min != sampler::LINEAR && asampler.filter_min != sampler::NEAREST ) 74 { 75 // TODO: This should not be done if we use framebuffers! 76 glTexParameteri( gl_type, GL_GENERATE_MIPMAP, GL_TRUE); 77 } 78 79 if ( asampler.filter_max != sampler::NEAREST ) 80 { 81 asampler.filter_max = sampler::LINEAR; 82 } 83 84 glTexParameteri( gl_type, GL_TEXTURE_MIN_FILTER, (int)nv::sampler_filter_to_enum( asampler.filter_min ) ); 85 glTexParameteri( gl_type, GL_TEXTURE_MAG_FILTER, (int)nv::sampler_filter_to_enum( asampler.filter_max ) ); 86 glTexParameteri( gl_type, GL_TEXTURE_WRAP_S, (int)nv::sampler_wrap_to_enum( asampler.wrap_s) ); 87 glTexParameteri( gl_type, GL_TEXTURE_WRAP_T, (int)nv::sampler_wrap_to_enum( asampler.wrap_t) ); 88 89 glTexImage2D( gl_type, 0, (GLint)nv::image_format_to_internal_enum(aformat.format), size.x, size.y, 0, nv::image_format_to_enum(aformat.format), nv::datatype_to_gl_enum(aformat.type), data ); 90 91 glBindTexture( gl_type, 0 ); 89 92 90 93 texture result = m_textures.create(); 91 94 gl_texture_info* info = m_textures.get( result ); 95 info->type = type; 92 96 info->format = aformat; 93 97 info->tsampler = asampler; -
trunk/src/gl/gl_enum.cc
r323 r331 8 8 9 9 using namespace nv; 10 11 unsigned int nv::texture_type_to_enum( texture_type type ) 12 { 13 switch( type ) 14 { 15 case TEXTURE_1D : return GL_TEXTURE_1D; 16 case TEXTURE_2D : return GL_TEXTURE_2D; 17 case TEXTURE_RECT : return GL_TEXTURE_RECTANGLE; 18 case TEXTURE_3D : return GL_TEXTURE_3D; 19 case TEXTURE_CUBE : return GL_TEXTURE_CUBE_MAP; 20 NV_RETURN_COVERED_DEFAULT( 0 ); 21 } 22 } 10 23 11 24 unsigned int nv::clear_state_buffers_to_mask( clear_state::buffers_type type ) … … 167 180 } 168 181 182 unsigned int nv::image_format_to_internal_enum( pixel_format format ) 183 { 184 switch( format ) 185 { 186 case RGB : return GL_RGB8; 187 case RGBA : return GL_RGBA8; 188 NV_RETURN_COVERED_DEFAULT( 0 ); 189 } 190 } 191 192 169 193 unsigned int nv::sampler_filter_to_enum( sampler::filter filter ) 170 194 { … … 207 231 } 208 232 } 233 234 unsigned int nv::framebuffer_slot_to_enum( framebuffer_slot slot ) 235 { 236 switch( slot ) 237 { 238 case READ_FRAMEBUFFER : return GL_READ_FRAMEBUFFER; 239 case DRAW_FRAMEBUFFER : return GL_DRAW_FRAMEBUFFER; 240 case FRAMEBUFFER : return GL_FRAMEBUFFER; 241 NV_RETURN_COVERED_DEFAULT( 0 ); 242 } 243 } 244 245 246 unsigned int nv::output_slot_to_enum( output_slot slot ) 247 { 248 switch( slot ) 249 { 250 case OUTPUT_0 : return GL_COLOR_ATTACHMENT0; 251 case OUTPUT_1 : return GL_COLOR_ATTACHMENT1; 252 case OUTPUT_2 : return GL_COLOR_ATTACHMENT2; 253 case OUTPUT_3 : return GL_COLOR_ATTACHMENT3; 254 case OUTPUT_4 : return GL_COLOR_ATTACHMENT4; 255 case OUTPUT_5 : return GL_COLOR_ATTACHMENT5; 256 case OUTPUT_6 : return GL_COLOR_ATTACHMENT6; 257 case OUTPUT_7 : return GL_COLOR_ATTACHMENT7; 258 case OUTPUT_NONE : return 0; 259 case OUTPUT_FRONT : return GL_FRONT; 260 case OUTPUT_BACK : return GL_BACK; 261 NV_RETURN_COVERED_DEFAULT( 0 ); 262 } 263 } 264 209 265 210 266 unsigned int nv::datatype_to_gl_enum( datatype type ) … … 257 313 case GL_INT_VEC4 : return INT_VECTOR_4; 258 314 // TODO: separate types? 259 case GL_SAMPLER_1D : return INT; 260 case GL_SAMPLER_2D : return INT; 261 case GL_SAMPLER_3D : return INT; 262 case GL_SAMPLER_CUBE : return INT; 263 case GL_SAMPLER_1D_SHADOW : return INT; 264 case GL_SAMPLER_2D_SHADOW : return INT; 315 case GL_SAMPLER_1D : return INT; 316 case GL_SAMPLER_2D : return INT; 317 case GL_SAMPLER_3D : return INT; 318 case GL_SAMPLER_2D_RECT : return INT; 319 case GL_SAMPLER_2D_RECT_SHADOW : return INT; 320 case GL_SAMPLER_CUBE : return INT; 321 case GL_SAMPLER_1D_SHADOW : return INT; 322 case GL_SAMPLER_2D_SHADOW : return INT; 265 323 // TODO: implement? 266 324 // case GL_BOOL -
trunk/src/lib/gl.cc
r323 r331 273 273 { 274 274 NV_LOG( nv::LOG_NOTICE, "load_gl_extension - extension \"" << name << "\" loaded (" << count << " symbols)" ); 275 gl_loaded_extensions = (gl_extensions)( gl_loaded_extensions | (unsigned)extension ); 275 276 return false; 276 277 }
Note: See TracChangeset
for help on using the changeset viewer.