Browse Source

gallium: pass the robust buffer access context flag to drivers

radeonsi will not do bounds checking for loads if this is not set.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
tags/11.2-branchpoint
Marek Olšák 9 years ago
parent
commit
17fe3fa312
2 changed files with 11 additions and 1 deletions
  1. 6
    0
      src/gallium/include/pipe/p_defines.h
  2. 5
    1
      src/mesa/state_tracker/st_manager.c

+ 6
- 0
src/gallium/include/pipe/p_defines.h View File

@@ -348,6 +348,12 @@ enum pipe_flush_flags
*/
#define PIPE_CONTEXT_DEBUG (1 << 1)

/**
* Whether out-of-bounds shader loads must return zero and out-of-bounds
* shader stores must be dropped.
*/
#define PIPE_CONTEXT_ROBUST_BUFFER_ACCESS (1 << 2)

/**
* Flags for pipe_context::memory_barrier.
*/

+ 5
- 1
src/mesa/state_tracker/st_manager.c View File

@@ -636,6 +636,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
struct pipe_context *pipe;
struct gl_config mode;
gl_api api;
unsigned ctx_flags = 0;

if (!(stapi->profile_mask & (1 << attribs->profile)))
return NULL;
@@ -659,7 +660,10 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
break;
}

pipe = smapi->screen->context_create(smapi->screen, NULL, 0);
if (attribs->flags & ST_CONTEXT_FLAG_ROBUST_ACCESS)
ctx_flags |= PIPE_CONTEXT_ROBUST_BUFFER_ACCESS;

pipe = smapi->screen->context_create(smapi->screen, NULL, ctx_flags);
if (!pipe) {
*error = ST_CONTEXT_ERROR_NO_MEMORY;
return NULL;

Loading…
Cancel
Save