diff options
Diffstat (limited to 'src/gallium/docs')
-rw-r--r-- | src/gallium/docs/d3d11ddi.txt | 5 | ||||
-rw-r--r-- | src/gallium/docs/source/context.rst | 40 | ||||
-rw-r--r-- | src/gallium/docs/source/glossary.rst | 8 | ||||
-rw-r--r-- | src/gallium/docs/source/screen.rst | 28 | ||||
-rw-r--r-- | src/gallium/docs/source/tgsi.rst | 69 |
5 files changed, 122 insertions, 28 deletions
diff --git a/src/gallium/docs/d3d11ddi.txt b/src/gallium/docs/d3d11ddi.txt index f8155c828b1..11e77190895 100644 --- a/src/gallium/docs/d3d11ddi.txt +++ b/src/gallium/docs/d3d11ddi.txt @@ -162,8 +162,8 @@ CreateDepthStencilState -> create_depth_stencil_alpha_state + Gallium has per-face writemask/valuemasks, D3D11 uses the same value for back and front + Gallium supports the alpha test, which D3D11 lacks -CreateDepthStencilView -> get_tex_surface -CreateRenderTargetView -> get_tex_surface +CreateDepthStencilView -> create_surface +CreateRenderTargetView -> create_surface ! Gallium merges depthstencil and rendertarget views into pipe_surface, which also doubles as a 2D surface abstraction - lack of texture array support - lack of render-to-buffer support @@ -221,7 +221,6 @@ CreateResource -> texture_create or buffer_create ! D3D11 specifies mapping flags (i.e. read/write/discard);:it's unclear what they are used for here - D3D11 supports odd things in the D3D10_DDI_RESOURCE_MISC_FLAG enum (D3D10_DDI_RESOURCE_MISC_DISCARD_ON_PRESENT, D3D11_DDI_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS, D3D11_DDI_RESOURCE_MISC_BUFFER_STRUCTURED) - Gallium does not support indirect draw call parameter buffers - - Gallium lacks array textures ! D3D11 supports specifying hardware modes and other stuff here for scanout resources + Gallium allows specifying minimum buffer alignment ! D3D11 implements cube maps as 2D array textures diff --git a/src/gallium/docs/source/context.rst b/src/gallium/docs/source/context.rst index e09a1304c4d..c33cf7c5738 100644 --- a/src/gallium/docs/source/context.rst +++ b/src/gallium/docs/source/context.rst @@ -84,7 +84,14 @@ in the result register. For example, ``swizzle_r`` specifies what is going to be placed in first component of result register. The ``first_level`` and ``last_level`` fields of sampler view template specify -the LOD range the texture is going to be constrained to. +the LOD range the texture is going to be constrained to. Note that these +values are in addition to the respective min_lod, max_lod values in the +pipe_sampler_state (that is if min_lod is 2.0, and first_level 3, the first mip +level used for sampling from the resource is effectively the fifth). + +The ``first_layer`` and ``last_layer`` fields specify the layer range the +texture is going to be constrained to. Similar to the LOD range, this is added +to the array index which is used for sampling. * ``set_fragment_sampler_views`` binds an array of sampler views to fragment shader stage. Every binding point acquires a reference @@ -103,6 +110,22 @@ the LOD range the texture is going to be constrained to. * ``sampler_view_destroy`` destroys a sampler view and releases its reference to associated texture. +Surfaces +^^^^^^^^ + +These are the means to use resources as color render targets or depthstencil +attachments. To create one, specify the mip level, the range of layers, and +the bind flags (either PIPE_BIND_DEPTH_STENCIL or PIPE_BIND_RENDER_TARGET). +Note that layer values are in addition to what is indicated by the geometry +shader output variable XXX_FIXME (that is if first_layer is 3 and geometry +shader indicates index 2, the 5th layer of the resource will be used). These +first_layer and last_layer parameters will only be used for 1d array, 2d array, +cube, and 3d textures otherwise they are 0. + +* ``create_surface`` creates a new surface. + +* ``surface_destroy`` destroys a surface and releases its reference to the + associated resource. Clearing ^^^^^^^^ @@ -118,8 +141,7 @@ used by GL), and always clears the whole surfaces (no scissoring as used by GL clear or explicit rectangles like d3d9 uses). It can, however, also clear only depth or stencil in a combined depth/stencil surface, if the driver supports PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE. -If a surface includes several layers/slices (XXX: not yet...) then all layers -will be cleared. +If a surface includes several layers then all layers will be cleared. ``clear_render_target`` clears a single color rendertarget with the specified color value. While it is only possible to clear one surface at a time (which can @@ -271,12 +293,12 @@ These methods operate directly on ``pipe_resource`` objects, and stand apart from any 3D state in the context. Blitting functionality may be moved to a separate abstraction at some point in the future. -``resource_copy_region`` blits a region of a subresource of a resource to a -region of another subresource of a resource, provided that both resources have -the same format, or compatible formats, i.e., formats for which copying the -bytes from the source resource unmodified to the destination resource will -achieve the same effect of a textured quad blitter. The source and destination -may be the same resource, but overlapping blits are not permitted. +``resource_copy_region`` blits a region of a resource to a region of another +resource, provided that both resources have the same format, or compatible +formats, i.e., formats for which copying the bytes from the source resource +unmodified to the destination resource will achieve the same effect of a +textured quad blitter.. The source and destination may be the same resource, +but overlapping blits are not permitted. ``resource_resolve`` resolves a multisampled resource into a non-multisampled one. Formats and dimensions must match. This function must be present if a driver diff --git a/src/gallium/docs/source/glossary.rst b/src/gallium/docs/source/glossary.rst index acde56eafc4..c749d0c9556 100644 --- a/src/gallium/docs/source/glossary.rst +++ b/src/gallium/docs/source/glossary.rst @@ -22,6 +22,14 @@ Glossary Level of Detail. Also spelled "LoD." The value that determines when the switches between mipmaps occur during texture sampling. + layer + This term is used as the name of the "3rd coordinate" of a resource. + 3D textures have zslices, cube maps have faces, 1D and 2D array textures + have array members (other resources do not have multiple layers). + Since the functions only take one parameter no matter what type of + resource is used, use the term "layer" instead of a resource type + specific one. + GLSL GL Shading Language. The official, common high-level shader language used in GL 2.0 and above. diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index a62520061ea..ab90097add6 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -259,25 +259,33 @@ resource_create Create a new resource from a template. The following fields of the pipe_resource must be specified in the template: -target +**target** one of the pipe_texture_target enums. +Note that PIPE_BUFFER and PIPE_TEXTURE_X are not really fundamentally different. +Modern APIs allow using buffers as shader resources. -format +**format** one of the pipe_format enums. -width0 +**width0** the width of the base mip level of the texture or size of the buffer. -height0 +**height0** the height of the base mip level of the texture +(1 for 1D or 1D array textures). -depth0 +**depth0** the depth of the base mip level of the texture +(1 for everything else). -last_level +**array_size the array size for 1D and 2D array textures. +For cube maps this must be 6, for other textures 1. -nr_samples +**last_level** the last mip map level present. -usage +**nr_samples** the nr of msaa samples. 0 (or 1) specifies a resource +which isn't multisampled. -bind +**usage** one of the PIPE_USAGE flags. -flags +**bind** bitmask of the PIPE_BIND flags. + +**flags** bitmask of PIPE_RESOURCE_FLAG flags. diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index d99ed7c6d6b..d986e6601e6 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -577,17 +577,45 @@ This instruction replicates its result. .. opcode:: TEX - Texture Lookup - TBD +.. math:: + + coord = src0 + + bias = 0.0 + + dst = texture_sample(unit, coord, bias) .. opcode:: TXD - Texture Lookup with Derivatives - TBD +.. math:: + + coord = src0 + + ddx = src1 + + ddy = src2 + + bias = 0.0 + + dst = texture_sample_deriv(unit, coord, bias, ddx, ddy) .. opcode:: TXP - Projective Texture Lookup - TBD +.. math:: + + coord.x = src0.x / src.w + + coord.y = src0.y / src.w + + coord.z = src0.z / src.w + + coord.w = src0.w + + bias = 0.0 + + dst = texture_sample(unit, coord, bias) .. opcode:: UP2H - Unpack Two 16-Bit Floats @@ -729,7 +757,19 @@ This instruction replicates its result. .. opcode:: TXB - Texture Lookup With Bias - TBD +.. math:: + + coord.x = src.x + + coord.y = src.y + + coord.z = src.z + + coord.w = 1.0 + + bias = src.z + + dst = texture_sample(unit, coord, bias) .. opcode:: NRM - 3-component Vector Normalise @@ -767,9 +807,21 @@ This instruction replicates its result. dst = src0.x \times src1.x + src0.y \times src1.y -.. opcode:: TXL - Texture Lookup With LOD +.. opcode:: TXL - Texture Lookup With explicit LOD - TBD +.. math:: + + coord.x = src0.x + + coord.y = src0.y + + coord.z = src0.z + + coord.w = 1.0 + + lod = src0.w + + dst = texture_sample(unit, coord, lod) .. opcode:: BRK - Break @@ -1464,6 +1516,11 @@ GL_ARB_fragment_coord_conventions extension. DirectX 9 uses INTEGER. DirectX 10 uses HALF_INTEGER. +FS_COLOR0_WRITES_ALL_CBUFS +"""""""""""""""""""""""""" +Specifies that writes to the fragment shader color 0 are replicated to all +bound cbufs. This facilitates OpenGL's fragColor output vs fragData[0] where +fragData is directed to a single color buffer, but fragColor is broadcast. Texture Sampling and Texture Formats |