aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_image.c
Commit message (Collapse)AuthorAgeFilesLines
* remove final imports.h and imports.c bitsDylan Baker2020-04-211-1/+1
| | | | | | | | | | | This moves the fi_types to a new mesa_private.h and removes the imports.c file. The vast majority of this patch is just removing pound includes of imports.h and fixing up the recursive includes. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* Move compiler.h and imports.h/c from src/mesa/main into src/utilMarek Olšák2020-03-271-1/+1
| | | | | Reviewed-by: Timothy Arceri <[email protected] Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>
* st/mesa: Record shader access qualifiers for imagesJason Ekstrand2018-10-231-4/+23
| | | | | | | | | | | | They're not required to be the same as the access flag on the image unit. For hardware that does shader image lowering based on the qualifier (Intel), it may be required for state setup. v2: (by Kenneth Graunke, incorporating feedback from Marek Olšák) - Reduce both access and shader_access to uint16_t to avoid making the pipe_image_view structure larger. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: ensure that images don't try to reference non-existent levelsIlia Mirkin2018-02-271-0/+1
| | | | | | | | | Ideally the st_finalize_texture call would take care of that, but it doesn't seem to with KHR-GL45.shader_image_size.advanced-nonMS-*. This assertion makes sure that no such values are passed to the driver. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: add an entirely separate codepath for setting up buffer viewsMarek Olšák2017-06-221-8/+21
| | | | | | | | | | | | Remove handling of buffers from all texture paths. This simplifies things for both buffers and textures. get_sampler_view_format is also cleaned up not to call util_format_is_depth_and_stencil. v2: also update st_NewTextureHandle Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
* st/mesa: add st_convert_image_from_unit() helperSamuel Pitoiset2017-06-141-11/+22
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: remove struct st_tracked_stateMarek Olšák2017-05-081-30/+6
| | | | | | | | | It contains only one member: the update function. Let's use the update function directly. Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: add st_convert_image()Samuel Pitoiset2017-04-031-47/+59
| | | | | | | | | | | | | Should be used by the state tracker when glGetImageHandleARB() is called in order to create a pipe_image_view template. v3: - move the comment to *.c v2: - make 'st' const - describe the function Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st: Add cubeMapFace parameter to st_finalize_texture.Michal Srb2017-04-011-1/+1
| | | | | | | | | | | st_finalize_texture always accesses image at face 0, but it may not be set if we are working with cubemap that had other face set. This fixes crash in piglit same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT. Cc: [email protected] Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: use gl_program for CurrentProgram rather than gl_shader_programTimothy Arceri2017-01-231-30/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes much more sense and should be more performant in some critical paths such as SSO validation which is called at draw time. Previously the CurrentProgram array could have contained multiple pointers to the same struct which was confusing and we would often need to fish out the information we were really after from the gl_program anyway. Also it was error prone to depend on the _LinkedShader array for programs in current use because a failed linking attempt will lose the infomation about the current program in use which is still valid. V2: fix validate_io() to compare linked_stages rather than the consumer and producer to decide if we are looking at inward facing shader interfaces which don't need validation. Acked-by: Edward O'Callaghan <[email protected]> To avoid build regressions the following 2 patches were squashed in to this commit: mesa/meta: rewrite _mesa_shader_program_use() and _mesa_program_use() These are rewritten to do what the function name suggests, that is _mesa_shader_program_use() sets the use of all stage and _mesa_program_use() sets the use of a single stage. Reviewed-by: Lionel Landwerlin <[email protected]> Acked-by: Edward O'Callaghan <[email protected]> mesa: update active relinked program This likely fixes a subroutine bug were _mesa_shader_program_init_subroutine_defaults() would never have been called for the relinked program as we previously just set _NEW_PROGRAM as dirty and never called the _mesa_use* functions when linking. Acked-by: Edward O'Callaghan <[email protected]>
* st/mesa: pass gl_program to st_bind_images()Timothy Arceri2017-01-091-24/+22
| | | | | | We no longer need anything from gl_linked_shader. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa/glsl: set num_images directly in shader_infoTimothy Arceri2017-01-091-6/+6
| | | | | | This change also removes the now duplicate NumImages field. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa/glsl/i965: move ImageUnits and ImageAccess fields to gl_programTimothy Arceri2017-01-061-1/+2
| | | | | | | | | | | | | | | Having it here rather than in gl_linked_shader allows us to simplify the code. Also it is error prone to depend on the gl_linked_shader for programs in current use because a failed linking attempt will free infomation about the current program. In i965 we could be trying to recompile a shader variant but may have lost some required fields. We drop the memset on ImageUnits because gl_program is already created using rzalloc(). Reviewed-by: Lionel Landwerlin <[email protected]>
* gallium: Use enum pipe_shader_type in set_shader_images()Kai Wasserbäch2016-08-291-1/+1
| | | | | Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: change pipe_image_view::first_element/last_element -> offset/sizeMarek Olšák2016-08-171-8/+2
| | | | | | | | | This is required by OpenGL. Our hardware supports this. Example: Bind RGBA32F with offset = 4 bytes. Acked-by: Ilia Mirkin <[email protected]> Acked-by: Nicolai Hähnle <[email protected]>
* st/mesa: completely rewrite state atomsMarek Olšák2016-07-301-24/+0
| | | | | | | | | | | | | | | | | | | | The goal is to do this in st_validate_state: while (dirty) atoms[u_bit_scan(&dirty)]->update(st); That implies that atoms can't specify which flags they consume. There is exactly one ST_NEW_* flag for each atom. (58 flags in total) There are macros that combine multiple flags into one for easier use. All _NEW_* flags are translated into ST_NEW_* flags in st_invalidate_state. st/mesa doesn't keep the _NEW_* flags after that. torcs is 2% faster between the previous patch and the end of this series. v2: - add st_atom_list.h to Makefile.sources Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove st_tracked_state::nameMarek Olšák2016-07-301-6/+0
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl/mesa: split gl_shader in twoTimothy Arceri2016-06-301-1/+1
| | | | | | | | | | | | | | | | | There are two distinctly different uses of this struct. The first is to store GL shader objects. The second is to store information about a shader stage thats been linked. The two uses actually share few fields and there is clearly confusion about their use. For example the linked shaders map one to one with a program so can simply be destroyed along with the program. However previously we were calling reference counting on the linked shaders. We were also creating linked shaders with a name even though it is always 0 and called the driver version of the _mesa_new_shader() function unnecessarily for GL shader objects. Acked-by: Iago Toral Quiroga <[email protected]>
* st/mesa: revalidate image atoms when a texture is updatedIlia Mirkin2016-06-071-6/+6
| | | | | | | | | | A texture may be redefined with _NEW_TEXTURE, which might have been bound to a shader image slot. We have to revalidate the image atoms to pick up on the new resource. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Cc: "12.0" <[email protected]>
* gallium/cso: allow saving the first fragment shader image slotNicolai Hähnle2016-06-011-4/+5
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: set image access flags in st_bind_imagesNicolai Hähnle2016-03-141-0/+15
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: check that the image unit is valid in st_bind_imagesNicolai Hähnle2016-03-111-1/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: move dereference after null checkThomas Hindoe Paaboel Andersen2016-03-021-1/+3
| | | | | | | | We should not dereference shader before we have done the null check. Reviewed-by: Erik Faye-Lund <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: set pipe_image_view layers correctly for 3D texturesNicolai Hähnle2016-02-151-7/+17
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: call st_finalize_texture from image atomsNicolai Hähnle2016-02-151-1/+5
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: add an image atom for shader imagesIlia Mirkin2016-02-151-0/+222
Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>