1bf215546Sopenharmony_ci/* 2bf215546Sopenharmony_ci * Copyright 2010 Red Hat Inc. 3bf215546Sopenharmony_ci * 4bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 5bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 6bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation 7bf215546Sopenharmony_ci * on the rights to use, copy, modify, merge, publish, distribute, sub 8bf215546Sopenharmony_ci * license, and/or sell copies of the Software, and to permit persons to whom 9bf215546Sopenharmony_ci * the Software is furnished to do so, subject to the following conditions: 10bf215546Sopenharmony_ci * 11bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next 12bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the 13bf215546Sopenharmony_ci * Software. 14bf215546Sopenharmony_ci * 15bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 18bf215546Sopenharmony_ci * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 19bf215546Sopenharmony_ci * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20bf215546Sopenharmony_ci * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 21bf215546Sopenharmony_ci * USE OR OTHER DEALINGS IN THE SOFTWARE. 22bf215546Sopenharmony_ci */ 23bf215546Sopenharmony_ci#include <stdio.h> 24bf215546Sopenharmony_ci#include <errno.h> 25bf215546Sopenharmony_ci#include "pipe/p_defines.h" 26bf215546Sopenharmony_ci#include "pipe/p_state.h" 27bf215546Sopenharmony_ci#include "pipe/p_context.h" 28bf215546Sopenharmony_ci#include "pipe/p_screen.h" 29bf215546Sopenharmony_ci#include "util/u_memory.h" 30bf215546Sopenharmony_ci#include "util/u_inlines.h" 31bf215546Sopenharmony_ci#include "util/u_transfer.h" 32bf215546Sopenharmony_ci 33bf215546Sopenharmony_cistatic void noop_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info, 34bf215546Sopenharmony_ci unsigned drawid_offset, 35bf215546Sopenharmony_ci const struct pipe_draw_indirect_info *indirect, 36bf215546Sopenharmony_ci const struct pipe_draw_start_count_bias *draws, 37bf215546Sopenharmony_ci unsigned num_draws) 38bf215546Sopenharmony_ci{ 39bf215546Sopenharmony_ci} 40bf215546Sopenharmony_ci 41bf215546Sopenharmony_cistatic void noop_draw_vertex_state(struct pipe_context *ctx, 42bf215546Sopenharmony_ci struct pipe_vertex_state *state, 43bf215546Sopenharmony_ci uint32_t partial_velem_mask, 44bf215546Sopenharmony_ci struct pipe_draw_vertex_state_info info, 45bf215546Sopenharmony_ci const struct pipe_draw_start_count_bias *draws, 46bf215546Sopenharmony_ci unsigned num_draws) 47bf215546Sopenharmony_ci{ 48bf215546Sopenharmony_ci} 49bf215546Sopenharmony_ci 50bf215546Sopenharmony_cistatic void noop_launch_grid(struct pipe_context *ctx, 51bf215546Sopenharmony_ci const struct pipe_grid_info *info) 52bf215546Sopenharmony_ci{ 53bf215546Sopenharmony_ci} 54bf215546Sopenharmony_ci 55bf215546Sopenharmony_cistatic void noop_set_blend_color(struct pipe_context *ctx, 56bf215546Sopenharmony_ci const struct pipe_blend_color *state) 57bf215546Sopenharmony_ci{ 58bf215546Sopenharmony_ci} 59bf215546Sopenharmony_ci 60bf215546Sopenharmony_cistatic void *noop_create_blend_state(struct pipe_context *ctx, 61bf215546Sopenharmony_ci const struct pipe_blend_state *state) 62bf215546Sopenharmony_ci{ 63bf215546Sopenharmony_ci return MALLOC(1); 64bf215546Sopenharmony_ci} 65bf215546Sopenharmony_ci 66bf215546Sopenharmony_cistatic void *noop_create_dsa_state(struct pipe_context *ctx, 67bf215546Sopenharmony_ci const struct pipe_depth_stencil_alpha_state *state) 68bf215546Sopenharmony_ci{ 69bf215546Sopenharmony_ci return MALLOC(1); 70bf215546Sopenharmony_ci} 71bf215546Sopenharmony_ci 72bf215546Sopenharmony_cistatic void *noop_create_rs_state(struct pipe_context *ctx, 73bf215546Sopenharmony_ci const struct pipe_rasterizer_state *state) 74bf215546Sopenharmony_ci{ 75bf215546Sopenharmony_ci return MALLOC(1); 76bf215546Sopenharmony_ci} 77bf215546Sopenharmony_ci 78bf215546Sopenharmony_cistatic void *noop_create_sampler_state(struct pipe_context *ctx, 79bf215546Sopenharmony_ci const struct pipe_sampler_state *state) 80bf215546Sopenharmony_ci{ 81bf215546Sopenharmony_ci return MALLOC(1); 82bf215546Sopenharmony_ci} 83bf215546Sopenharmony_ci 84bf215546Sopenharmony_cistatic struct pipe_sampler_view *noop_create_sampler_view(struct pipe_context *ctx, 85bf215546Sopenharmony_ci struct pipe_resource *texture, 86bf215546Sopenharmony_ci const struct pipe_sampler_view *state) 87bf215546Sopenharmony_ci{ 88bf215546Sopenharmony_ci struct pipe_sampler_view *sampler_view = CALLOC_STRUCT(pipe_sampler_view); 89bf215546Sopenharmony_ci 90bf215546Sopenharmony_ci if (!sampler_view) 91bf215546Sopenharmony_ci return NULL; 92bf215546Sopenharmony_ci 93bf215546Sopenharmony_ci /* initialize base object */ 94bf215546Sopenharmony_ci *sampler_view = *state; 95bf215546Sopenharmony_ci sampler_view->texture = NULL; 96bf215546Sopenharmony_ci pipe_resource_reference(&sampler_view->texture, texture); 97bf215546Sopenharmony_ci pipe_reference_init(&sampler_view->reference, 1); 98bf215546Sopenharmony_ci sampler_view->context = ctx; 99bf215546Sopenharmony_ci return sampler_view; 100bf215546Sopenharmony_ci} 101bf215546Sopenharmony_ci 102bf215546Sopenharmony_cistatic struct pipe_surface *noop_create_surface(struct pipe_context *ctx, 103bf215546Sopenharmony_ci struct pipe_resource *texture, 104bf215546Sopenharmony_ci const struct pipe_surface *surf_tmpl) 105bf215546Sopenharmony_ci{ 106bf215546Sopenharmony_ci struct pipe_surface *surface = CALLOC_STRUCT(pipe_surface); 107bf215546Sopenharmony_ci 108bf215546Sopenharmony_ci if (!surface) 109bf215546Sopenharmony_ci return NULL; 110bf215546Sopenharmony_ci pipe_reference_init(&surface->reference, 1); 111bf215546Sopenharmony_ci pipe_resource_reference(&surface->texture, texture); 112bf215546Sopenharmony_ci surface->context = ctx; 113bf215546Sopenharmony_ci surface->format = surf_tmpl->format; 114bf215546Sopenharmony_ci surface->width = texture->width0; 115bf215546Sopenharmony_ci surface->height = texture->height0; 116bf215546Sopenharmony_ci surface->texture = texture; 117bf215546Sopenharmony_ci surface->u.tex.first_layer = surf_tmpl->u.tex.first_layer; 118bf215546Sopenharmony_ci surface->u.tex.last_layer = surf_tmpl->u.tex.last_layer; 119bf215546Sopenharmony_ci surface->u.tex.level = surf_tmpl->u.tex.level; 120bf215546Sopenharmony_ci 121bf215546Sopenharmony_ci return surface; 122bf215546Sopenharmony_ci} 123bf215546Sopenharmony_ci 124bf215546Sopenharmony_cistatic void noop_set_sampler_views(struct pipe_context *ctx, 125bf215546Sopenharmony_ci enum pipe_shader_type shader, 126bf215546Sopenharmony_ci unsigned start, unsigned count, 127bf215546Sopenharmony_ci unsigned unbind_num_trailing_slots, 128bf215546Sopenharmony_ci bool take_ownership, 129bf215546Sopenharmony_ci struct pipe_sampler_view **views) 130bf215546Sopenharmony_ci{ 131bf215546Sopenharmony_ci} 132bf215546Sopenharmony_ci 133bf215546Sopenharmony_cistatic void noop_bind_sampler_states(struct pipe_context *ctx, 134bf215546Sopenharmony_ci enum pipe_shader_type shader, 135bf215546Sopenharmony_ci unsigned start, unsigned count, 136bf215546Sopenharmony_ci void **states) 137bf215546Sopenharmony_ci{ 138bf215546Sopenharmony_ci} 139bf215546Sopenharmony_ci 140bf215546Sopenharmony_cistatic void noop_set_clip_state(struct pipe_context *ctx, 141bf215546Sopenharmony_ci const struct pipe_clip_state *state) 142bf215546Sopenharmony_ci{ 143bf215546Sopenharmony_ci} 144bf215546Sopenharmony_ci 145bf215546Sopenharmony_cistatic void noop_set_polygon_stipple(struct pipe_context *ctx, 146bf215546Sopenharmony_ci const struct pipe_poly_stipple *state) 147bf215546Sopenharmony_ci{ 148bf215546Sopenharmony_ci} 149bf215546Sopenharmony_ci 150bf215546Sopenharmony_cistatic void noop_set_sample_mask(struct pipe_context *pipe, unsigned sample_mask) 151bf215546Sopenharmony_ci{ 152bf215546Sopenharmony_ci} 153bf215546Sopenharmony_ci 154bf215546Sopenharmony_cistatic void noop_set_scissor_states(struct pipe_context *ctx, 155bf215546Sopenharmony_ci unsigned start_slot, 156bf215546Sopenharmony_ci unsigned num_scissors, 157bf215546Sopenharmony_ci const struct pipe_scissor_state *state) 158bf215546Sopenharmony_ci{ 159bf215546Sopenharmony_ci} 160bf215546Sopenharmony_ci 161bf215546Sopenharmony_cistatic void noop_set_stencil_ref(struct pipe_context *ctx, 162bf215546Sopenharmony_ci const struct pipe_stencil_ref state) 163bf215546Sopenharmony_ci{ 164bf215546Sopenharmony_ci} 165bf215546Sopenharmony_ci 166bf215546Sopenharmony_cistatic void noop_set_viewport_states(struct pipe_context *ctx, 167bf215546Sopenharmony_ci unsigned start_slot, 168bf215546Sopenharmony_ci unsigned num_viewports, 169bf215546Sopenharmony_ci const struct pipe_viewport_state *state) 170bf215546Sopenharmony_ci{ 171bf215546Sopenharmony_ci} 172bf215546Sopenharmony_ci 173bf215546Sopenharmony_cistatic void noop_set_framebuffer_state(struct pipe_context *ctx, 174bf215546Sopenharmony_ci const struct pipe_framebuffer_state *state) 175bf215546Sopenharmony_ci{ 176bf215546Sopenharmony_ci} 177bf215546Sopenharmony_ci 178bf215546Sopenharmony_cistatic void noop_set_constant_buffer(struct pipe_context *ctx, 179bf215546Sopenharmony_ci enum pipe_shader_type shader, uint index, 180bf215546Sopenharmony_ci bool take_ownership, 181bf215546Sopenharmony_ci const struct pipe_constant_buffer *cb) 182bf215546Sopenharmony_ci{ 183bf215546Sopenharmony_ci} 184bf215546Sopenharmony_ci 185bf215546Sopenharmony_cistatic void noop_set_inlinable_constants(struct pipe_context *ctx, 186bf215546Sopenharmony_ci enum pipe_shader_type shader, 187bf215546Sopenharmony_ci uint num_values, uint32_t *values) 188bf215546Sopenharmony_ci{ 189bf215546Sopenharmony_ci} 190bf215546Sopenharmony_ci 191bf215546Sopenharmony_ci 192bf215546Sopenharmony_cistatic void noop_sampler_view_destroy(struct pipe_context *ctx, 193bf215546Sopenharmony_ci struct pipe_sampler_view *state) 194bf215546Sopenharmony_ci{ 195bf215546Sopenharmony_ci pipe_resource_reference(&state->texture, NULL); 196bf215546Sopenharmony_ci FREE(state); 197bf215546Sopenharmony_ci} 198bf215546Sopenharmony_ci 199bf215546Sopenharmony_ci 200bf215546Sopenharmony_cistatic void noop_surface_destroy(struct pipe_context *ctx, 201bf215546Sopenharmony_ci struct pipe_surface *surface) 202bf215546Sopenharmony_ci{ 203bf215546Sopenharmony_ci pipe_resource_reference(&surface->texture, NULL); 204bf215546Sopenharmony_ci FREE(surface); 205bf215546Sopenharmony_ci} 206bf215546Sopenharmony_ci 207bf215546Sopenharmony_cistatic void noop_bind_state(struct pipe_context *ctx, void *state) 208bf215546Sopenharmony_ci{ 209bf215546Sopenharmony_ci} 210bf215546Sopenharmony_ci 211bf215546Sopenharmony_cistatic void noop_delete_state(struct pipe_context *ctx, void *state) 212bf215546Sopenharmony_ci{ 213bf215546Sopenharmony_ci FREE(state); 214bf215546Sopenharmony_ci} 215bf215546Sopenharmony_ci 216bf215546Sopenharmony_cistatic void noop_set_vertex_buffers(struct pipe_context *ctx, 217bf215546Sopenharmony_ci unsigned start_slot, unsigned count, 218bf215546Sopenharmony_ci unsigned unbind_num_trailing_slots, 219bf215546Sopenharmony_ci bool take_ownership, 220bf215546Sopenharmony_ci const struct pipe_vertex_buffer *buffers) 221bf215546Sopenharmony_ci{ 222bf215546Sopenharmony_ci} 223bf215546Sopenharmony_ci 224bf215546Sopenharmony_cistatic void *noop_create_vertex_elements(struct pipe_context *ctx, 225bf215546Sopenharmony_ci unsigned count, 226bf215546Sopenharmony_ci const struct pipe_vertex_element *state) 227bf215546Sopenharmony_ci{ 228bf215546Sopenharmony_ci return MALLOC(1); 229bf215546Sopenharmony_ci} 230bf215546Sopenharmony_ci 231bf215546Sopenharmony_cistatic void *noop_create_shader_state(struct pipe_context *ctx, 232bf215546Sopenharmony_ci const struct pipe_shader_state *state) 233bf215546Sopenharmony_ci{ 234bf215546Sopenharmony_ci return MALLOC(1); 235bf215546Sopenharmony_ci} 236bf215546Sopenharmony_ci 237bf215546Sopenharmony_cistatic void *noop_create_compute_state(struct pipe_context *ctx, 238bf215546Sopenharmony_ci const struct pipe_compute_state *state) 239bf215546Sopenharmony_ci{ 240bf215546Sopenharmony_ci return MALLOC(1); 241bf215546Sopenharmony_ci} 242bf215546Sopenharmony_ci 243bf215546Sopenharmony_cistatic struct pipe_stream_output_target *noop_create_stream_output_target( 244bf215546Sopenharmony_ci struct pipe_context *ctx, 245bf215546Sopenharmony_ci struct pipe_resource *res, 246bf215546Sopenharmony_ci unsigned buffer_offset, 247bf215546Sopenharmony_ci unsigned buffer_size) 248bf215546Sopenharmony_ci{ 249bf215546Sopenharmony_ci struct pipe_stream_output_target *t = CALLOC_STRUCT(pipe_stream_output_target); 250bf215546Sopenharmony_ci if (!t) 251bf215546Sopenharmony_ci return NULL; 252bf215546Sopenharmony_ci 253bf215546Sopenharmony_ci pipe_reference_init(&t->reference, 1); 254bf215546Sopenharmony_ci pipe_resource_reference(&t->buffer, res); 255bf215546Sopenharmony_ci t->buffer_offset = buffer_offset; 256bf215546Sopenharmony_ci t->buffer_size = buffer_size; 257bf215546Sopenharmony_ci return t; 258bf215546Sopenharmony_ci} 259bf215546Sopenharmony_ci 260bf215546Sopenharmony_cistatic void noop_stream_output_target_destroy(struct pipe_context *ctx, 261bf215546Sopenharmony_ci struct pipe_stream_output_target *t) 262bf215546Sopenharmony_ci{ 263bf215546Sopenharmony_ci pipe_resource_reference(&t->buffer, NULL); 264bf215546Sopenharmony_ci FREE(t); 265bf215546Sopenharmony_ci} 266bf215546Sopenharmony_ci 267bf215546Sopenharmony_cistatic void noop_set_stream_output_targets(struct pipe_context *ctx, 268bf215546Sopenharmony_ci unsigned num_targets, 269bf215546Sopenharmony_ci struct pipe_stream_output_target **targets, 270bf215546Sopenharmony_ci const unsigned *offsets) 271bf215546Sopenharmony_ci{ 272bf215546Sopenharmony_ci} 273bf215546Sopenharmony_ci 274bf215546Sopenharmony_cistatic void noop_set_window_rectangles(struct pipe_context *ctx, 275bf215546Sopenharmony_ci bool include, 276bf215546Sopenharmony_ci unsigned num_rectangles, 277bf215546Sopenharmony_ci const struct pipe_scissor_state *rects) 278bf215546Sopenharmony_ci{ 279bf215546Sopenharmony_ci} 280bf215546Sopenharmony_ci 281bf215546Sopenharmony_cistatic void noop_set_shader_buffers(struct pipe_context *ctx, 282bf215546Sopenharmony_ci enum pipe_shader_type shader, 283bf215546Sopenharmony_ci unsigned start_slot, unsigned count, 284bf215546Sopenharmony_ci const struct pipe_shader_buffer *buffers, 285bf215546Sopenharmony_ci unsigned writable_bitmask) 286bf215546Sopenharmony_ci{ 287bf215546Sopenharmony_ci} 288bf215546Sopenharmony_ci 289bf215546Sopenharmony_cistatic void noop_set_shader_images(struct pipe_context *ctx, 290bf215546Sopenharmony_ci enum pipe_shader_type shader, 291bf215546Sopenharmony_ci unsigned start_slot, unsigned count, 292bf215546Sopenharmony_ci unsigned unbind_num_trailing_slots, 293bf215546Sopenharmony_ci const struct pipe_image_view *images) 294bf215546Sopenharmony_ci{ 295bf215546Sopenharmony_ci} 296bf215546Sopenharmony_ci 297bf215546Sopenharmony_cistatic void noop_render_condition( struct pipe_context *pipe, 298bf215546Sopenharmony_ci struct pipe_query *query, 299bf215546Sopenharmony_ci bool condition, 300bf215546Sopenharmony_ci enum pipe_render_cond_flag mode ) 301bf215546Sopenharmony_ci{ 302bf215546Sopenharmony_ci} 303bf215546Sopenharmony_ci 304bf215546Sopenharmony_cistatic void noop_get_query_result_resource(struct pipe_context *pipe, 305bf215546Sopenharmony_ci struct pipe_query *q, 306bf215546Sopenharmony_ci enum pipe_query_flags flags, 307bf215546Sopenharmony_ci enum pipe_query_value_type result_type, 308bf215546Sopenharmony_ci int index, 309bf215546Sopenharmony_ci struct pipe_resource *resource, 310bf215546Sopenharmony_ci unsigned offset) 311bf215546Sopenharmony_ci{ 312bf215546Sopenharmony_ci} 313bf215546Sopenharmony_ci 314bf215546Sopenharmony_cistatic void noop_set_min_samples( struct pipe_context *ctx, 315bf215546Sopenharmony_ci unsigned min_samples ) 316bf215546Sopenharmony_ci{ 317bf215546Sopenharmony_ci} 318bf215546Sopenharmony_ci 319bf215546Sopenharmony_cistatic void noop_set_sample_locations( struct pipe_context *ctx, 320bf215546Sopenharmony_ci size_t size, const uint8_t *locations ) 321bf215546Sopenharmony_ci{ 322bf215546Sopenharmony_ci} 323bf215546Sopenharmony_ci 324bf215546Sopenharmony_cistatic void noop_set_tess_state(struct pipe_context *ctx, 325bf215546Sopenharmony_ci const float default_outer_level[4], 326bf215546Sopenharmony_ci const float default_inner_level[2]) 327bf215546Sopenharmony_ci{ 328bf215546Sopenharmony_ci} 329bf215546Sopenharmony_ci 330bf215546Sopenharmony_cistatic void noop_clear_texture(struct pipe_context *pipe, 331bf215546Sopenharmony_ci struct pipe_resource *res, 332bf215546Sopenharmony_ci unsigned level, 333bf215546Sopenharmony_ci const struct pipe_box *box, 334bf215546Sopenharmony_ci const void *data) 335bf215546Sopenharmony_ci{ 336bf215546Sopenharmony_ci} 337bf215546Sopenharmony_ci 338bf215546Sopenharmony_cistatic void noop_clear_buffer(struct pipe_context *pipe, 339bf215546Sopenharmony_ci struct pipe_resource *res, 340bf215546Sopenharmony_ci unsigned offset, 341bf215546Sopenharmony_ci unsigned size, 342bf215546Sopenharmony_ci const void *clear_value, 343bf215546Sopenharmony_ci int clear_value_size) 344bf215546Sopenharmony_ci{ 345bf215546Sopenharmony_ci} 346bf215546Sopenharmony_ci 347bf215546Sopenharmony_cistatic void noop_fence_server_sync(struct pipe_context *pipe, 348bf215546Sopenharmony_ci struct pipe_fence_handle *fence) 349bf215546Sopenharmony_ci{ 350bf215546Sopenharmony_ci} 351bf215546Sopenharmony_ci 352bf215546Sopenharmony_cistatic void noop_texture_barrier(struct pipe_context *ctx, unsigned flags) 353bf215546Sopenharmony_ci{ 354bf215546Sopenharmony_ci} 355bf215546Sopenharmony_ci 356bf215546Sopenharmony_cistatic void noop_memory_barrier(struct pipe_context *ctx, unsigned flags) 357bf215546Sopenharmony_ci{ 358bf215546Sopenharmony_ci} 359bf215546Sopenharmony_ci 360bf215546Sopenharmony_cistatic bool noop_resource_commit(struct pipe_context *ctx, struct pipe_resource *res, 361bf215546Sopenharmony_ci unsigned level, struct pipe_box *box, bool commit) 362bf215546Sopenharmony_ci{ 363bf215546Sopenharmony_ci return true; 364bf215546Sopenharmony_ci} 365bf215546Sopenharmony_ci 366bf215546Sopenharmony_cistatic void noop_get_sample_position(struct pipe_context *context, 367bf215546Sopenharmony_ci unsigned sample_count, 368bf215546Sopenharmony_ci unsigned sample_index, 369bf215546Sopenharmony_ci float *out_value) 370bf215546Sopenharmony_ci{ 371bf215546Sopenharmony_ci} 372bf215546Sopenharmony_ci 373bf215546Sopenharmony_cistatic enum pipe_reset_status noop_get_device_reset_status(struct pipe_context *ctx) 374bf215546Sopenharmony_ci{ 375bf215546Sopenharmony_ci return PIPE_NO_RESET; 376bf215546Sopenharmony_ci} 377bf215546Sopenharmony_ci 378bf215546Sopenharmony_cistatic uint64_t noop_create_texture_handle(struct pipe_context *ctx, 379bf215546Sopenharmony_ci struct pipe_sampler_view *view, 380bf215546Sopenharmony_ci const struct pipe_sampler_state *state) 381bf215546Sopenharmony_ci{ 382bf215546Sopenharmony_ci return 1; 383bf215546Sopenharmony_ci} 384bf215546Sopenharmony_ci 385bf215546Sopenharmony_cistatic void noop_delete_texture_handle(struct pipe_context *ctx, uint64_t handle) 386bf215546Sopenharmony_ci{ 387bf215546Sopenharmony_ci} 388bf215546Sopenharmony_ci 389bf215546Sopenharmony_cistatic void noop_make_texture_handle_resident(struct pipe_context *ctx, 390bf215546Sopenharmony_ci uint64_t handle, bool resident) 391bf215546Sopenharmony_ci{ 392bf215546Sopenharmony_ci} 393bf215546Sopenharmony_ci 394bf215546Sopenharmony_cistatic uint64_t noop_create_image_handle(struct pipe_context *ctx, 395bf215546Sopenharmony_ci const struct pipe_image_view *image) 396bf215546Sopenharmony_ci{ 397bf215546Sopenharmony_ci return 2; 398bf215546Sopenharmony_ci} 399bf215546Sopenharmony_ci 400bf215546Sopenharmony_cistatic void noop_delete_image_handle(struct pipe_context *ctx, uint64_t handle) 401bf215546Sopenharmony_ci{ 402bf215546Sopenharmony_ci} 403bf215546Sopenharmony_ci 404bf215546Sopenharmony_cistatic void noop_make_image_handle_resident(struct pipe_context *ctx, uint64_t handle, 405bf215546Sopenharmony_ci unsigned access, bool resident) 406bf215546Sopenharmony_ci{ 407bf215546Sopenharmony_ci} 408bf215546Sopenharmony_ci 409bf215546Sopenharmony_cistatic void noop_set_patch_vertices(struct pipe_context *ctx, 410bf215546Sopenharmony_ci uint8_t patch_vertices) 411bf215546Sopenharmony_ci{ 412bf215546Sopenharmony_ci} 413bf215546Sopenharmony_ci 414bf215546Sopenharmony_civoid noop_init_state_functions(struct pipe_context *ctx); 415bf215546Sopenharmony_ci 416bf215546Sopenharmony_civoid noop_init_state_functions(struct pipe_context *ctx) 417bf215546Sopenharmony_ci{ 418bf215546Sopenharmony_ci ctx->create_blend_state = noop_create_blend_state; 419bf215546Sopenharmony_ci ctx->create_depth_stencil_alpha_state = noop_create_dsa_state; 420bf215546Sopenharmony_ci ctx->create_fs_state = noop_create_shader_state; 421bf215546Sopenharmony_ci ctx->create_rasterizer_state = noop_create_rs_state; 422bf215546Sopenharmony_ci ctx->create_sampler_state = noop_create_sampler_state; 423bf215546Sopenharmony_ci ctx->create_sampler_view = noop_create_sampler_view; 424bf215546Sopenharmony_ci ctx->create_surface = noop_create_surface; 425bf215546Sopenharmony_ci ctx->create_vertex_elements_state = noop_create_vertex_elements; 426bf215546Sopenharmony_ci ctx->create_compute_state = noop_create_compute_state; 427bf215546Sopenharmony_ci ctx->create_tcs_state = noop_create_shader_state; 428bf215546Sopenharmony_ci ctx->create_tes_state = noop_create_shader_state; 429bf215546Sopenharmony_ci ctx->create_gs_state = noop_create_shader_state; 430bf215546Sopenharmony_ci ctx->create_vs_state = noop_create_shader_state; 431bf215546Sopenharmony_ci ctx->bind_blend_state = noop_bind_state; 432bf215546Sopenharmony_ci ctx->bind_depth_stencil_alpha_state = noop_bind_state; 433bf215546Sopenharmony_ci ctx->bind_sampler_states = noop_bind_sampler_states; 434bf215546Sopenharmony_ci ctx->bind_fs_state = noop_bind_state; 435bf215546Sopenharmony_ci ctx->bind_rasterizer_state = noop_bind_state; 436bf215546Sopenharmony_ci ctx->bind_vertex_elements_state = noop_bind_state; 437bf215546Sopenharmony_ci ctx->bind_compute_state = noop_bind_state; 438bf215546Sopenharmony_ci ctx->bind_tcs_state = noop_bind_state; 439bf215546Sopenharmony_ci ctx->bind_tes_state = noop_bind_state; 440bf215546Sopenharmony_ci ctx->bind_gs_state = noop_bind_state; 441bf215546Sopenharmony_ci ctx->bind_vs_state = noop_bind_state; 442bf215546Sopenharmony_ci ctx->delete_blend_state = noop_delete_state; 443bf215546Sopenharmony_ci ctx->delete_depth_stencil_alpha_state = noop_delete_state; 444bf215546Sopenharmony_ci ctx->delete_fs_state = noop_delete_state; 445bf215546Sopenharmony_ci ctx->delete_rasterizer_state = noop_delete_state; 446bf215546Sopenharmony_ci ctx->delete_sampler_state = noop_delete_state; 447bf215546Sopenharmony_ci ctx->delete_vertex_elements_state = noop_delete_state; 448bf215546Sopenharmony_ci ctx->delete_compute_state = noop_delete_state; 449bf215546Sopenharmony_ci ctx->delete_tcs_state = noop_delete_state; 450bf215546Sopenharmony_ci ctx->delete_tes_state = noop_delete_state; 451bf215546Sopenharmony_ci ctx->delete_gs_state = noop_delete_state; 452bf215546Sopenharmony_ci ctx->delete_vs_state = noop_delete_state; 453bf215546Sopenharmony_ci ctx->set_blend_color = noop_set_blend_color; 454bf215546Sopenharmony_ci ctx->set_clip_state = noop_set_clip_state; 455bf215546Sopenharmony_ci ctx->set_constant_buffer = noop_set_constant_buffer; 456bf215546Sopenharmony_ci ctx->set_inlinable_constants = noop_set_inlinable_constants; 457bf215546Sopenharmony_ci ctx->set_sampler_views = noop_set_sampler_views; 458bf215546Sopenharmony_ci ctx->set_shader_buffers = noop_set_shader_buffers; 459bf215546Sopenharmony_ci ctx->set_shader_images = noop_set_shader_images; 460bf215546Sopenharmony_ci ctx->set_framebuffer_state = noop_set_framebuffer_state; 461bf215546Sopenharmony_ci ctx->set_polygon_stipple = noop_set_polygon_stipple; 462bf215546Sopenharmony_ci ctx->set_sample_mask = noop_set_sample_mask; 463bf215546Sopenharmony_ci ctx->set_scissor_states = noop_set_scissor_states; 464bf215546Sopenharmony_ci ctx->set_stencil_ref = noop_set_stencil_ref; 465bf215546Sopenharmony_ci ctx->set_vertex_buffers = noop_set_vertex_buffers; 466bf215546Sopenharmony_ci ctx->set_viewport_states = noop_set_viewport_states; 467bf215546Sopenharmony_ci ctx->set_window_rectangles = noop_set_window_rectangles; 468bf215546Sopenharmony_ci ctx->sampler_view_destroy = noop_sampler_view_destroy; 469bf215546Sopenharmony_ci ctx->surface_destroy = noop_surface_destroy; 470bf215546Sopenharmony_ci ctx->draw_vbo = noop_draw_vbo; 471bf215546Sopenharmony_ci ctx->draw_vertex_state = noop_draw_vertex_state; 472bf215546Sopenharmony_ci ctx->launch_grid = noop_launch_grid; 473bf215546Sopenharmony_ci ctx->create_stream_output_target = noop_create_stream_output_target; 474bf215546Sopenharmony_ci ctx->stream_output_target_destroy = noop_stream_output_target_destroy; 475bf215546Sopenharmony_ci ctx->set_stream_output_targets = noop_set_stream_output_targets; 476bf215546Sopenharmony_ci ctx->render_condition = noop_render_condition; 477bf215546Sopenharmony_ci ctx->get_query_result_resource = noop_get_query_result_resource; 478bf215546Sopenharmony_ci ctx->set_min_samples = noop_set_min_samples; 479bf215546Sopenharmony_ci ctx->set_sample_locations = noop_set_sample_locations; 480bf215546Sopenharmony_ci ctx->set_tess_state = noop_set_tess_state; 481bf215546Sopenharmony_ci ctx->clear_texture = noop_clear_texture; 482bf215546Sopenharmony_ci ctx->clear_buffer = noop_clear_buffer; 483bf215546Sopenharmony_ci ctx->fence_server_sync = noop_fence_server_sync; 484bf215546Sopenharmony_ci ctx->texture_barrier = noop_texture_barrier; 485bf215546Sopenharmony_ci ctx->memory_barrier = noop_memory_barrier; 486bf215546Sopenharmony_ci ctx->resource_commit = noop_resource_commit; 487bf215546Sopenharmony_ci ctx->get_sample_position = noop_get_sample_position; 488bf215546Sopenharmony_ci ctx->get_device_reset_status = noop_get_device_reset_status; 489bf215546Sopenharmony_ci ctx->create_texture_handle = noop_create_texture_handle; 490bf215546Sopenharmony_ci ctx->delete_texture_handle = noop_delete_texture_handle; 491bf215546Sopenharmony_ci ctx->make_texture_handle_resident = noop_make_texture_handle_resident; 492bf215546Sopenharmony_ci ctx->create_image_handle = noop_create_image_handle; 493bf215546Sopenharmony_ci ctx->delete_image_handle = noop_delete_image_handle; 494bf215546Sopenharmony_ci ctx->make_image_handle_resident = noop_make_image_handle_resident; 495bf215546Sopenharmony_ci ctx->set_patch_vertices = noop_set_patch_vertices; 496bf215546Sopenharmony_ci} 497