diff options
author | Nicolai Hähnle <[email protected]> | 2017-03-30 08:55:05 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2017-03-31 07:56:26 +0200 |
commit | 65b542a7ccbbf59c1e1000f677c799a660b5183e (patch) | |
tree | 7f26ce93df3916993ffccfd366b5f963aae986fe /src/mesa/state_tracker | |
parent | 94ec847cb00e7f5b7bc5a9d719d572cdc6affa44 (diff) |
st/mesa: implement ARB_shader_clock
Reviewed-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 16f86856a34..a48c22e82e7 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -599,6 +599,7 @@ void st_init_extensions(struct pipe_screen *screen, { o(ARB_robust_buffer_access_behavior), PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR }, { o(ARB_sample_shading), PIPE_CAP_SAMPLE_SHADING }, { o(ARB_seamless_cube_map), PIPE_CAP_SEAMLESS_CUBE_MAP }, + { o(ARB_shader_clock), PIPE_CAP_TGSI_CLOCK }, { o(ARB_shader_draw_parameters), PIPE_CAP_DRAW_PARAMETERS }, { o(ARB_shader_group_vote), PIPE_CAP_TGSI_VOTE }, { o(ARB_shader_stencil_export), PIPE_CAP_SHADER_STENCIL_EXPORT }, diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 31c14ed9ec7..369dff77075 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -3963,6 +3963,16 @@ glsl_to_tgsi_visitor::visit(ir_call *ir) visit_image_intrinsic(ir); return; + case ir_intrinsic_shader_clock: { + ir->return_deref->accept(this); + + st_dst_reg dst = st_dst_reg(this->result); + dst.writemask = TGSI_WRITEMASK_XY; + + emit_asm(ir, TGSI_OPCODE_CLOCK, dst); + return; + } + case ir_intrinsic_invalid: case ir_intrinsic_generic_load: case ir_intrinsic_generic_store: @@ -3974,7 +3984,6 @@ glsl_to_tgsi_visitor::visit(ir_call *ir) case ir_intrinsic_generic_atomic_max: case ir_intrinsic_generic_atomic_exchange: case ir_intrinsic_generic_atomic_comp_swap: - case ir_intrinsic_shader_clock: unreachable("Invalid intrinsic"); } } |