@@ -22,9 +22,9 @@ namespace nbl::video
22
22
template <typename LogicalDeviceType>
23
23
class IOpenGL_PhysicalDeviceBase : public IPhysicalDevice
24
24
{
25
- using function_table_t = typename LogicalDeviceType::FunctionTableType;
26
- static inline constexpr EGLint EGL_API_TYPE = function_table_t ::EGL_API_TYPE;
27
- static inline constexpr bool IsGLES = (EGL_API_TYPE == EGL_OPENGL_ES_API);
25
+ using function_table_t = typename LogicalDeviceType::FunctionTableType;
26
+ static inline constexpr EGLint EGL_API_TYPE = function_table_t ::EGL_API_TYPE;
27
+ static inline constexpr bool IsGLES = (EGL_API_TYPE == EGL_OPENGL_ES_API);
28
28
29
29
static inline constexpr uint32_t MaxQueues = 8u ;
30
30
@@ -162,17 +162,17 @@ class IOpenGL_PhysicalDeviceBase : public IPhysicalDevice
162
162
}
163
163
164
164
public:
165
- IOpenGL_PhysicalDeviceBase (IAPIConnection* api, renderdoc_api_t * rdoc, core::smart_refctd_ptr<system::ISystem>&& s, egl::CEGL&& _egl, COpenGLDebugCallback&& _dbgCb, EGLConfig _config, EGLContext ctx, EGLint _major, EGLint _minor)
165
+ IOpenGL_PhysicalDeviceBase (IAPIConnection* api, renderdoc_api_t * rdoc, core::smart_refctd_ptr<system::ISystem>&& s, egl::CEGL&& _egl, COpenGLDebugCallback&& _dbgCb, EGLConfig _config, EGLContext ctx, EGLint _major, EGLint _minor)
166
166
: IPhysicalDevice(std::move(s),core::make_smart_refctd_ptr<asset::IGLSLCompiler>(s.get())), m_api(api), m_rdoc_api(rdoc), m_egl(std::move(_egl)), m_dbgCb(std::move(_dbgCb)), m_config(_config), m_gl_major(_major), m_gl_minor(_minor)
167
- {
168
- // OpenGL backend emulates presence of just one queue family with all capabilities (graphics, compute, transfer, ... what about sparse binding?)
169
- SQueueFamilyProperties qprops;
170
- qprops.queueFlags = core::bitflag (EQF_GRAPHICS_BIT)|EQF_COMPUTE_BIT|EQF_TRANSFER_BIT;
171
- qprops.queueCount = MaxQueues;
172
- qprops.timestampValidBits = 30u ; // ??? TODO: glGetQueryiv(GL_TIMESTAMP,GL_QUERY_COUNTER_BITS,&qprops.timestampValidBits)
173
- qprops.minImageTransferGranularity = { 1u ,1u ,1u };
167
+ {
168
+ // OpenGL backend emulates presence of just one queue family with all capabilities (graphics, compute, transfer, ... what about sparse binding?)
169
+ SQueueFamilyProperties qprops;
170
+ qprops.queueFlags = core::bitflag (EQF_GRAPHICS_BIT)|EQF_COMPUTE_BIT|EQF_TRANSFER_BIT;
171
+ qprops.queueCount = MaxQueues;
172
+ qprops.timestampValidBits = 30u ; // ??? TODO: glGetQueryiv(GL_TIMESTAMP,GL_QUERY_COUNTER_BITS,&qprops.timestampValidBits)
173
+ qprops.minImageTransferGranularity = { 1u ,1u ,1u };
174
174
175
- m_qfamProperties = core::make_refctd_dynamic_array<qfam_props_array_t >(1u , qprops);
175
+ m_qfamProperties = core::make_refctd_dynamic_array<qfam_props_array_t >(1u , qprops);
176
176
177
177
m_egl.call .peglBindAPI (EGL_API_TYPE);
178
178
@@ -492,8 +492,17 @@ class IOpenGL_PhysicalDeviceBase : public IPhysicalDevice
492
492
}
493
493
}
494
494
495
+ int majorVer = 0 ;
496
+ int minorVer = 0 ;
497
+ GetIntegerv (GL_MAJOR_VERSION, &majorVer);
498
+ GetIntegerv (GL_MINOR_VERSION, &minorVer);
499
+ m_apiVersion.major = majorVer;
500
+ m_apiVersion.minor = minorVer;
501
+ m_apiVersion.patch = 0u ;
502
+
503
+
495
504
std::ostringstream pool;
496
- addCommonGLSLDefines (pool,runningInRenderDoc);
505
+ addCommonGLSLDefines (pool,runningInRenderDoc);
497
506
{
498
507
std::string define;
499
508
for (size_t j=0ull ; j<std::extent<decltype (COpenGLFeatureMap::m_GLSLExtensions)>::value; ++j)
@@ -507,13 +516,13 @@ class IOpenGL_PhysicalDeviceBase : public IPhysicalDevice
507
516
}
508
517
}
509
518
}
510
- finalizeGLSLDefinePool (std::move (pool));
519
+ finalizeGLSLDefinePool (std::move (pool));
511
520
512
521
// we dont need this any more
513
522
m_egl.call .peglMakeCurrent (m_egl.display , EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
514
523
m_egl.call .peglDestroyContext (m_egl.display , ctx);
515
524
m_egl.call .peglDestroySurface (m_egl.display , pbuf);
516
- }
525
+ }
517
526
518
527
IDebugCallback* getDebugCallback ()
519
528
{
@@ -530,11 +539,11 @@ class IOpenGL_PhysicalDeviceBase : public IPhysicalDevice
530
539
531
540
IAPIConnection* m_api; // dumb pointer to avoid circ ref
532
541
renderdoc_api_t * m_rdoc_api;
533
- egl::CEGL m_egl;
542
+ egl::CEGL m_egl;
534
543
COpenGLDebugCallback m_dbgCb;
535
544
536
- EGLConfig m_config;
537
- EGLint m_gl_major, m_gl_minor;
545
+ EGLConfig m_config;
546
+ EGLint m_gl_major, m_gl_minor;
538
547
539
548
COpenGLFeatureMap m_glfeatures;
540
549
};
0 commit comments