X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Finclude%2Fpipe%2Fp_state.h;h=cf6c5b50268d3cb85f938893a4a474f8bfb5291f;hb=d40b868db5b82529cbe07598b2ebef23cc31a7fa;hp=fc6dba346daef50e81359cd06e50f2ff0a4ff797;hpb=adf35e80d3b3d37b97f0608a5a2f221dbd8c0d64;p=mesa.git diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index fc6dba346da..cf6c5b50268 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -62,6 +62,7 @@ extern "C" { #define PIPE_MAX_GEOMETRY_SAMPLERS 16 #define PIPE_MAX_SHADER_INPUTS 32 #define PIPE_MAX_SHADER_OUTPUTS 32 +#define PIPE_MAX_SHADER_RESOURCES 32 #define PIPE_MAX_TEXTURE_LEVELS 16 #define PIPE_MAX_SO_BUFFERS 4 @@ -271,25 +272,33 @@ struct pipe_sampler_state /** - * 2D surface. This is basically a view into a memory buffer. - * May be a renderbuffer, texture mipmap level, etc. + * A view into a texture that can be bound to a color render target / + * depth stencil attachment point. */ struct pipe_surface { struct pipe_reference reference; struct pipe_resource *texture; /**< resource into which this is a view */ + struct pipe_context *context; /**< context this view belongs to */ enum pipe_format format; + /* XXX width/height should be removed */ unsigned width; /**< logical width in pixels */ unsigned height; /**< logical height in pixels */ - unsigned layout; /**< PIPE_SURFACE_LAYOUT_x */ - unsigned offset; /**< offset from start of buffer, in bytes */ unsigned usage; /**< bitmask of PIPE_BIND_x */ - unsigned zslice; - unsigned face; - unsigned level; + union { + struct { + unsigned level; + unsigned first_layer:16; + unsigned last_layer:16; + } tex; + struct { + unsigned first_element; + unsigned last_element; + } buf; + } u; }; @@ -302,8 +311,18 @@ struct pipe_sampler_view enum pipe_format format; /**< typed PIPE_FORMAT_x */ struct pipe_resource *texture; /**< texture into which this is a view */ struct pipe_context *context; /**< context this view belongs to */ - unsigned first_level:8; /**< first mipmap level */ - unsigned last_level:8; /**< last mipmap level */ + union { + struct { + unsigned first_layer:16; /**< first layer to use for array textures */ + unsigned last_layer:16; /**< last layer to use for array textures */ + unsigned first_level:8; /**< first mipmap level to use */ + unsigned last_level:8; /**< last mipmap level to use */ + } tex; + struct { + unsigned first_element; + unsigned last_element; + } buf; + } u; unsigned swizzle_r:3; /**< PIPE_SWIZZLE_x for red component */ unsigned swizzle_g:3; /**< PIPE_SWIZZLE_x for green component */ unsigned swizzle_b:3; /**< PIPE_SWIZZLE_x for blue component */ @@ -338,13 +357,14 @@ struct pipe_resource unsigned width0; unsigned height0; unsigned depth0; + unsigned array_size; unsigned last_level:8; /**< Index of last mipmap level present/defined */ unsigned nr_samples:8; /**< for multisampled surfaces, nr of samples */ unsigned usage:8; /**< PIPE_USAGE_x (not a bitmask) */ - unsigned bind; /**< bitmask of PIPE_BIND_x */ - unsigned flags; /**< bitmask of PIPE_RESOURCE_FLAG_x */ + unsigned bind; /**< bitmask of PIPE_BIND_x */ + unsigned flags; /**< bitmask of PIPE_RESOURCE_FLAG_x */ }; struct pipe_stream_output_state @@ -363,15 +383,6 @@ struct pipe_stream_output_state unsigned stride; }; -/** - * Extra indexing info for (cube) texture resources. - */ -struct pipe_subresource -{ - unsigned face:16; - unsigned level:16; -}; - /** * Transfer object. For data transfer to/from a resource. @@ -379,11 +390,11 @@ struct pipe_subresource struct pipe_transfer { struct pipe_resource *resource; /**< resource to transfer to/from */ - struct pipe_subresource sr; + unsigned level; /**< texture mipmap level */ enum pipe_transfer_usage usage; - struct pipe_box box; - unsigned stride; - unsigned slice_stride; + struct pipe_box box; /**< region of the resource to access */ + unsigned stride; /**< row stride in bytes */ + unsigned layer_stride; /**< image/layer stride in bytes */ void *data; }; @@ -397,7 +408,6 @@ struct pipe_transfer struct pipe_vertex_buffer { unsigned stride; /**< stride to same attrib in next vertex, in bytes */ - unsigned max_index; /**< number of vertices in this buffer */ unsigned buffer_offset; /**< offset to start of data in buffer, in bytes */ struct pipe_resource *buffer; /**< the actual buffer */ };