diff options
author | Luca Barbieri <[email protected]> | 2010-09-05 20:50:50 +0200 |
---|---|---|
committer | Luca Barbieri <[email protected]> | 2010-09-14 06:07:41 +0200 |
commit | a508d2dddcc67d0f92cc36b9ed6f36a9bbfc579d (patch) | |
tree | 54e2cd38f19fdd1b47bbbe5c6d913fcf2e894d77 /src/gallium/drivers/cell/ppu | |
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/cell/ppu')
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_screen.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index 0f12e0667eb..8d2b4b96438 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -90,8 +90,6 @@ cell_get_param(struct pipe_screen *screen, enum pipe_cap param) return 1; /* XXX not really true */ case PIPE_CAP_TEXTURE_MIRROR_CLAMP: return 0; /* XXX to do */ - case PIPE_CAP_TGSI_CONT_SUPPORTED: - return 1; case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT: case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER: return 1; @@ -105,6 +103,20 @@ cell_get_param(struct pipe_screen *screen, enum pipe_cap param) } } +static int +cell_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap param) +{ + switch(shader) + { + case PIPE_SHADER_FRAGMENT: + return tgsi_exec_get_shader_param(param); + case PIPE_SHADER_VERTEX: + case PIPE_SHADER_GEOMETRY: + return draw_get_shader_param(shader, param); + default: + return 0; + } +} static float cell_get_paramf(struct pipe_screen *screen, enum pipe_cap param) @@ -200,6 +212,7 @@ cell_create_screen(struct sw_winsys *winsys) screen->base.get_name = cell_get_name; screen->base.get_vendor = cell_get_vendor; screen->base.get_param = cell_get_param; + screen->base.get_shader_param = cell_get_shader_param; screen->base.get_paramf = cell_get_paramf; screen->base.is_format_supported = cell_is_format_supported; screen->base.context_create = cell_create_context; |