现在的位置: 首页 > 综合 > 正文

OpenGL 4.3 (Core Profile) – August 6, 2012 spec Fundamental 2.1 Execution Model

2018年05月27日 ⁄ 综合 ⁄ 共 3246字 ⁄ 字号 评论关闭

以前从来没有记笔记的习惯,现在记性不好,就开着博客编辑器一面粘贴一面总结吧。

Each primitive is a point, line segment, patch, or polygon.

 patch就是控制面片了,用于tessalator。

Data binding occurs on call. This means that data passed to a GL command
are interpreted when that command is received. Even if the command requires a
pointer to data, those data are interpreted when the call is made, and any subsequent
changes to the data have no effect on the GL (unless the same pointer is used in a
subsequent command).

调用时刻即绑定,后边再变无用

The model for interpretation of GL commands is client-server. That is, a program
(the client) issues commands, and these commands are interpreted and processed
by the GL (the server). The server may or may not operate on the same
computer or in the same address space as the client. In this sense, the GL is network
transparent. A server may maintain a number of GL contexts, each of which
is an encapsulation of current GL state and objects. A client may choose to be
made current to any one of these contexts.

C/S模型,cpu端client,gpu端server。多线程渲染(多cpu),多核服务端(多GPU,opengl insight今天目录看到有讲)

Issuing GL commands when a program is not current to a context results in
undefined behavior.

可能是说program的激活?glUseprogram()?

There are two classes of framebuffers: a window system-provided framebuffer
associated with a context when the context is made current, and application-created
framebuffers. The window system-provided framebuffer is referred to as the default
framebuffer. Application-created framebuffers, referred to as framebuffer objects,
may be created as desired, A context may be associated with two framebuffers,
one for each of reading and drawing operations. but both read and draw
framebuffers must be of the same class. The default framebuffer and framebuffer
objects are distinguished primarily by the interfaces for configuring and managing
their state.

两种FB,系统FB和程序创建的FBO

The effects of GL commands on the default framebuffer are ultimately controlled
by the window system, which allocates framebuffer resources, determines
which portions of the default framebuffer the GL may access at any given time, and
communicates to the GL how those portions are structured. Therefore, there are
no GL commands to initialize a GL context or configure the default framebuffer.
Similarly, display of framebuffer contents on a physical display device (including
the transformation of individual framebuffer values by such techniques as gamma
correction) is not addressed by the GL.

系统默认FB分配不了,也配置不了

Allocation and configuration of the default framebuffer occurs outside of the
GL in conjunction with the window system, using companion APIs described in
section 1.3.5.

想分配控制的话调用配套API windows下的用wgl系列函数。HDC构造出HGLRC即可。HWND.GetSafeDC(),

mfc的view.GetDC()

It is possible to use a GL context without a default framebuffer, in which case
a framebuffer object must be used to perform all rendering. This is useful for
applications needing to perform offscreen rendering.

FBO用于离屏渲染

OpenGL is designed to be run on a range of platforms with varying capabilities,
memory, and performance. To accommodate this variety, we specify ideal behavior
instead of actual behavior for certain GL operations. In cases where deviation from
the ideal is allowed, we also specify the rules that an implementation must obey
if it is to approximate the ideal behavior usefully. This allowed variation in GL
behavior implies that two distinct GL implementations may not agree pixel for
pixel when presented with the same input, even when run on identical framebuffer
configurations.

龙生九子各有不同。不同配置机型相同调用结果可能略有不同

Finally, command names, constants, and types are prefixed in the C language
binding to OpenGL (by gl, GL_, and GL, respectively), to reduce name clashes with
other packages. The prefixes are omitted in this document for clarity.

前缀:函数名称gl,常量 GL_类型GL

抱歉!评论已关闭.