summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo
Commit message (Collapse)AuthorAgeFilesLines
* gallium: Add PIPE_CAP_ENDIANNESSTom Stellard2013-07-221-0/+2
| | | | | | Cc: [email protected] [ Francisco Jerez: Fix "PIPE_ENDIAN_SMALL" in the documentation, define PIPE_ENDIAN_NATIVE. ]
* ilo: skip 3DSTATE_INDEX_BUFFER when possibleChia-I Wu2013-07-144-59/+77
| | | | | | When only the offset to the index buffer is changed, we can skip the 3DSTATE_INDEX_BUFFER if we always use 0 for the offset, and add (offset / index_size) to Start Vertex Location in 3DPRIMITIVE.
* ilo: move a santiy check into its assert()Chia-I Wu2013-07-131-5/+2
| | | | | | The compiler does not know that ilo_3d_pipeline_estimate_size() is pure and can be eliminated in a release build in gen6_pipeline_end(). Move the call into the assert().
* ilo: mark some states dirty when they are really changedChia-I Wu2013-07-131-0/+16
| | | | | The checks may seem redundant because cso_context handles them, but util_blitter does not have access to cso_context.
* ilo: clean up ilo_blitter_pipe_begin()Chia-I Wu2013-07-133-27/+39
| | | | | Document why certain states need to be saved, and fix a bug when blitting with scissor enabled.
* tgsi: rename the TGSI fragment kill opcodesBrian Paul2013-07-122-9/+9
| | | | | | | | | | | | | | | | | | | | | TGSI_OPCODE_KIL and KILP had confusing names. The former was conditional kill (if any src component < 0). The later was unconditional kill. At one time KILP was supposed to work with NV-style condition codes/predicates but we never had that in TGSI. This patch renames both opcodes: TGSI_OPCODE_KIL -> KILL_IF (kill if src.xyzw < 0) TGSI_OPCODE_KILP -> KILL (unconditional kill) Note: I didn't just transpose the opcode names to help ensure that I didn't miss updating any code anywhere. I believe I've updated all the relevant code and comments but I'm not 100% sure that some drivers had this right in the first place. For example, the radeon driver might have llvm.AMDGPU.kill and llvm.AMDGPU.kilp mixed up. Driver authors should review their code. Reviewed-by: Jose Fonseca <[email protected]>
* ilo: reduce PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS to 12Chia-I Wu2013-07-111-2/+3
| | | | So that there are at most (2^22 * 6) texels, lower than the 2^26 limit.
* ilo: correctly initialize undefined registers in fsChia-I Wu2013-07-111-5/+15
| | | | | Initialize all 4 channels of undefined registers (that is, TEMPs that are used before being assigned) in FS.
* ilo: honor surface padding requirementsChia-I Wu2013-07-101-0/+53
| | | | The PRM specifies several padding requirements that we failed to honor.
* mesa,glsl,gallium: remove GLSLSkipStrictMaxVaryingLimitCheck and dependenciesMarek Olšák2013-07-021-1/+0
| | | | | | Not needed with do_dead_builtin_varyings. Reviewed-by: Ian Romanick <[email protected]>
* ilo: clean up states that use ilo_view_surfaceChia-I Wu2013-06-281-13/+10
| | | | Use variables that are easier to remember what they are.
* ilo: remove ilo_cbuf_state::countChia-I Wu2013-06-284-17/+12
| | | | We can derive it from enabled_mask.
* ilo: clean up ilo_set_constant_buffer()Chia-I Wu2013-06-281-29/+44
| | | | Add loops that will be optimized away.
* ilo: clean up states that take a start_slotChia-I Wu2013-06-281-73/+99
| | | | They are similar, so clean them up to make them look similar.
* ilo: use shorter names for dirty flagsChia-I Wu2013-06-287-141/+138
| | | | | The new names match those of ilo_context's members respectively, and are shorter.
* ilo: track if primitive restart has changedChia-I Wu2013-06-283-1/+8
| | | | Re-emit 3DSTATE_INDEX_BUFFER to enable/disable primitive restart.
* ilo: avoid potential dangling pointer dereferenceChia-I Wu2013-06-281-0/+3
| | | | Set pipe_draw_info to NULL after draw_vbo().
* ilo: plug a potential index buffer leakChia-I Wu2013-06-271-0/+1
| | | | | This is harmless since st_context and u_vbuf both set index buffer to NULL before destroying themselves. But we do not want to rely on that behavior.
* ilo: Remove max_threads dead code path.Vinson Lee2013-06-261-3/+0
| | | | | | | | | max_threads cannot be greater than 28. It is either 21 or 28. Fixes "Logically dead code" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
* ilo: use a bitmask for enabled constant buffersChia-I Wu2013-06-262-11/+14
| | | | | Looping over 4 * 13 constant buffers while in most cases only two are enabled is stupid.
* ilo: support PIPE_CAP_USER_INDEX_BUFFERSChia-I Wu2013-06-269-36/+97
| | | | | | | | We want to access the user buffer, if available, when primitive restart is enabled and the restart index/primitive type is not natively supported. And since we are handling index buffer uploads in the driver with this change, we can also work around misalignment of index buffer offsets.
* ilo: make pipe_draw_info a context stateChia-I Wu2013-06-269-39/+33
| | | | | | Rename ilo_finalize_states() to ilo_finalize_3d_states(), and bind pipe_draw_info to the context when it is called. This saves us from having to pass pipe_draw_info around in several places.
* ilo: support PIPE_CAP_USER_CONSTANT_BUFFERSChia-I Wu2013-06-265-23/+88
| | | | We need it for HUD support, and will need it for push constants in the future.
* ilo: honor render condition in blitterChia-I Wu2013-06-254-8/+23
| | | | | | Make pass_render_condition() available for blitter, and check for render condition in (and only in) clear(), clear_render_target(), and clear_depth_stencil().
* ilo: remove ilo_shader_internal.h from GEN6 pipelineChia-I Wu2013-06-253-38/+55
| | | | Replace direct shader accesses with ilo_shader_get_kernel_param() and etc.
* ilo: remove ilo_shader_internal.h from GEN7 pipelineChia-I Wu2013-06-251-11/+6
| | | | Replace direct shader accesses with ilo_shader_get_kernel_param() and etc.
* ilo: speed up ilo_shader_select_kernel_routing() a bitChia-I Wu2013-06-252-4/+32
| | | | | Remember the order of the source attributes and avoid recomputation when it does not change.
* ilo: move SBE setup code to ilo_shader.cChia-I Wu2013-06-256-155/+237
| | | | | | | | | Add ilo_shader_select_kernel_routing() to construct 3DSTATE_SBE. It is called in ilo_finalize_states(), rather than in create_fs_state(), as it depends on VS/GS and rasterizer states. With this change, ilo_shader_internal.h is no longer needed for ilo_gpe_gen6.c.
* ilo: use ilo_shader_state exclusively in GPEChia-I Wu2013-06-256-107/+44
| | | | | | This allows us to remove ilo_shader_internal.h from ilo_gpe_gen7.c. The unfinished code in 3DSTATE_DS, 3DSTATE_HS, and INTERFACE_DESCRIPTOR_DATA are partly or entirely removed.
* ilo: map SO registers at shader compile timeChia-I Wu2013-06-256-37/+72
| | | | | | | The unmodified pipe_stream_output_info describes its outputs as if they are in TGSI_FILE_OUTPUT. Remap the register indices to where they appear in the VUE. TGSI_SEMANTIC_PSIZE needs a little care because it is at the W channel.
* ilo: use ilo_shader_cso for FSChia-I Wu2013-06-258-154/+255
| | | | | Add ilo_gpe_init_fs_cso() to construct 3DSTATE_PS and shader part of 3DSTATE_WM once and early for fragment shaders.
* ilo: use ilo_rasterizer_state exclusively in GPEChia-I Wu2013-06-255-15/+17
| | | | | Replace pipe_rasterizer_state by ilo_rasterizer_state for the remaining GPE functions for consistency.
* ilo: convert pipe_rasterizer_state to ilo_rasterizer_wmChia-I Wu2013-06-257-62/+141
| | | | | Add ilo_gpe_init_rasterizer_wm() to construct fixed-function part of 3DSTATE_WM once in create_rasterizer_state().
* ilo: use ilo_shader_cso for GSChia-I Wu2013-06-257-145/+225
| | | | | Add ilo_gpe_init_gs_cso() to construct 3DSTATE_GS once and early for geometry shaders.
* ilo: introduce ilo_shader_cso for VSChia-I Wu2013-06-257-42/+102
| | | | | | | When a new VS kernel is generated, a newly added function, ilo_gpe_init_vs_cso(), is called to construct 3DSTATE_VS command in ilo_shader_cso. When the command needs to be emitted later, we copy the command from the CSO instead of constructing it dynamically.
* ilo: add functions to query shadersChia-I Wu2013-06-252-0/+152
| | | | | | Add ilo_shader_get_type() to query the type (PIPE_SHADER_x) of the shader. Add ilo_shader_get_kernel_offset() and ilo_shader_get_kernel_param() to query the cache offset and various kernel parameters of the selected kernel.
* ilo: clean up finalize_shader_states()Chia-I Wu2013-06-254-62/+79
| | | | | | | | Add ilo_shader_select_kernel() to replace the dependency table, ilo_shader_variant_init(), and ilo_shader_state_use_variant(). With the changes, we no longer need to include ilo_shader_internal.h in ilo_state.c.
* ilo: use multiple entry points for shader creationChia-I Wu2013-06-256-32/+96
| | | | | | | | | | | | Replace ilo_shader_state_create() by ilo_shader_create_vs() ilo_shader_create_gs() ilo_shader_create_fs() ilo_shader_create_cs() Rename ilo_shader_state_destroy() to ilo_shader_destroy(). The old ilo_shader_destroy() is renamed to ilo_shader_destroy_kernel().
* ilo: move internal shader interface to a new headerChia-I Wu2013-06-2513-183/+226
| | | | | Move it to ilo_shader_internal.h. The goal is to make files not part of the compiler include only ilo_shader.h eventually.
* ilo: replace a boolean by boolChia-I Wu2013-06-201-1/+1
| | | | bool is used internally. This is just cosmetic.
* ilo: rename cache_seqno to uploadedChia-I Wu2013-06-202-6/+6
| | | | It has been used as a bool since shader cache rework.
* ilo: rework shader cacheChia-I Wu2013-06-199-186/+356
| | | | | | | | | The new code makes the shader cache manages all shaders and be able to upload all of them to a caller-provided bo as a whole. Previously, we uploaded only the bound shaders. When a different set of shaders is bound, we had to allocate a new kernel bo to upload if the current one is busy.
* gallium: add condition parameter to render_conditionRoland Scheidegger2013-06-182-1/+4
| | | | | | | | | | | | | For conditional rendering this makes it possible to skip rendering if either the predicate is true or false, as supported by d3d10 (in fact previously it was sort of implied skip rendering if predicate is false for occlusion predicate, and true for so_overflow predicate). There's no cap bit for this as presumably all drivers could do it trivially (but this patch does not implement it for the drivers using true hw predicates, nvxx, r600, radeonsi, no change is expected for OpenGL functionality). Reviewed-by: Jose Fonseca <[email protected]>
* ilo: construct depth/stencil command in create_surface()Chia-I Wu2013-06-186-271/+368
| | | | | | | | | | Add ilo_gpe_init_zs_surface() to construct 3DSTATE_DEPTH_BUFFER 3DSTATE_STENCIL_BUFFER 3DSTATE_HIER_DEPTH_BUFFER at surface creation time. This allows fast state emission in draw_vbo().
* ilo: add pipe-based copy method to ilo_blitterChia-I Wu2013-06-172-5/+25
| | | | It enables accelerated resource_copy_region() when blt-based method fails.
* ilo: add BLT-based blitting methods to ilo_blitterChia-I Wu2013-06-174-495/+847
| | | | | | Port BLT code in ilo_blit.c to BLT-based blitting methods of ilo_blitter. Add BLT-based clears. The latter is verifed with util_clear(), but it is not in use yet.
* ilo: replace util_blitter by ilo_blitterChia-I Wu2013-06-177-103/+363
| | | | | ilo_blitter is just a wrapper for util_blitter for now. We will port BLT code to ilo_blitter shortly.
* ilo: fix for half-float vertex arraysChia-I Wu2013-06-151-1/+14
| | | | | Commit 6fe0453c339b6e894e0ee8d2200e7638a43ed21e broke half-float vertex arrays. This reverts a part of that commit, and explains why.
* ilo: add some assertions to help debuggingChia-I Wu2013-06-141-1/+23
| | | | | | Assert that we do not support user vertex/index/constant buffers. Issue a warning when a sampler view is created for a resource without PIPE_BIND_SAMPLER_VIEW.
* ilo: silence a compiler warningChia-I Wu2013-06-141-0/+2
| | | | The path should never be hit.