diff options
author | Luca Barbieri <luca@luca-barbieri.com> | 2010-09-05 20:50:50 +0200 |
---|---|---|
committer | Luca Barbieri <luca@luca-barbieri.com> | 2010-09-14 06:07:41 +0200 |
commit | a508d2dddcc67d0f92cc36b9ed6f36a9bbfc579d (patch) | |
tree | 54e2cd38f19fdd1b47bbbe5c6d913fcf2e894d77 /src/gallium/drivers/galahad | |
parent | 309cd4115b7cba669a0bf858e7809cb6dae90ddf (diff) |
gallium: introduce get_shader_param (ALL DRIVERS CHANGED) (v3)
Changes in v3:
- Also change trace, which I forgot about
Changes in v2:
- No longer adds tessellation shaders
Currently each shader cap has FS and VS versions.
However, we want a version of them for geometry, tessellation control,
and tessellation evaluation shaders, and want to be able to easily
query a given cap type for a given shader stage.
Since having 5 duplicates of each shader cap is unmanageable, add
a new get_shader_param function that takes both a shader cap from a
new enum and a shader stage.
Drivers with non-unified shaders will first switch on the shader
and, within each case, switch on the cap.
Drivers with unified shaders instead first check whether the shader
is supported, and then switch on the cap.
MAX_CONST_BUFFERS is now per-stage.
The geometry shader cap is removed in favor of checking whether the
limit of geometry shader instructions is greater than 0, which is also
used for tessellation shaders.
WARNING: all drivers changed and compiled but only nvfx tested
Diffstat (limited to 'src/gallium/drivers/galahad')
-rw-r--r-- | src/gallium/drivers/galahad/glhd_context.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/galahad/glhd_screen.c | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c index 5b56a4d0ed..ff6d2aa00a 100644 --- a/src/gallium/drivers/galahad/glhd_context.c +++ b/src/gallium/drivers/galahad/glhd_context.c @@ -469,11 +469,11 @@ galahad_set_constant_buffer(struct pipe_context *_pipe, if (index && index >= - pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_CONST_BUFFERS)) { + pipe->screen->get_shader_param(pipe->screen, shader, PIPE_SHADER_CAP_MAX_CONST_BUFFERS)) { glhd_error("Access to constant buffer %u requested, " "but only %d are supported", index, - pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_CONST_BUFFERS)); + pipe->screen->get_shader_param(pipe->screen, shader, PIPE_SHADER_CAP_MAX_CONST_BUFFERS)); } /* XXX hmm? unwrap the input state */ diff --git a/src/gallium/drivers/galahad/glhd_screen.c b/src/gallium/drivers/galahad/glhd_screen.c index 75e4c2d82e..288941b106 100644 --- a/src/gallium/drivers/galahad/glhd_screen.c +++ b/src/gallium/drivers/galahad/glhd_screen.c @@ -79,6 +79,17 @@ galahad_screen_get_param(struct pipe_screen *_screen, param); } +static int +galahad_screen_get_shader_param(struct pipe_screen *_screen, + unsigned shader, enum pipe_shader_cap param) +{ + struct galahad_screen *glhd_screen = galahad_screen(_screen); + struct pipe_screen *screen = glhd_screen->screen; + + return screen->get_shader_param(screen, shader, + param); +} + static float galahad_screen_get_paramf(struct pipe_screen *_screen, enum pipe_cap param) @@ -341,6 +352,7 @@ galahad_screen_create(struct pipe_screen *screen) glhd_screen->base.get_name = galahad_screen_get_name; glhd_screen->base.get_vendor = galahad_screen_get_vendor; glhd_screen->base.get_param = galahad_screen_get_param; + glhd_screen->base.get_shader_param = galahad_screen_get_shader_param; glhd_screen->base.get_paramf = galahad_screen_get_paramf; glhd_screen->base.is_format_supported = galahad_screen_is_format_supported; glhd_screen->base.context_create = galahad_screen_context_create; |