summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/pixelshader9.c
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2015-05-12 21:56:04 +0200
committerAxel Davy <[email protected]>2015-08-21 22:21:47 +0200
commit8f39ffc11e8b6fdf7c940f9c1853a362a886977a (patch)
tree8a8df571e545e5593dd219fb5dda7442bec35a68 /src/gallium/state_trackers/nine/pixelshader9.c
parent69de5d626f2e67e74e4de94ce13f7ac50fa52161 (diff)
st/nine: Finish Fog implementation
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/pixelshader9.c')
-rw-r--r--src/gallium/state_trackers/nine/pixelshader9.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/nine/pixelshader9.c b/src/gallium/state_trackers/nine/pixelshader9.c
index 5399afd3698..6173b0eea05 100644
--- a/src/gallium/state_trackers/nine/pixelshader9.c
+++ b/src/gallium/state_trackers/nine/pixelshader9.c
@@ -57,6 +57,7 @@ NinePixelShader9_ctor( struct NinePixelShader9 *This,
info.const_b_base = NINE_CONST_B_BASE(device->max_ps_const_f) / 16;
info.sampler_mask_shadow = 0x0;
info.sampler_ps1xtypes = 0x0;
+ info.fog_enable = 0;
hr = nine_translate_shader(device, &info);
if (FAILED(hr))
@@ -90,7 +91,7 @@ NinePixelShader9_dtor( struct NinePixelShader9 *This )
if (This->base.device) {
struct pipe_context *pipe = This->base.device->pipe;
- struct nine_shader_variant *var = &This->variant;
+ struct nine_shader_variant64 *var = &This->variant;
do {
if (var->cso) {
@@ -107,7 +108,7 @@ NinePixelShader9_dtor( struct NinePixelShader9 *This )
pipe->delete_fs_state(pipe, This->ff_cso);
}
}
- nine_shader_variants_free(&This->variant);
+ nine_shader_variants_free64(&This->variant);
FREE((void *)This->byte_code.tokens); /* const_cast */
@@ -138,13 +139,13 @@ void *
NinePixelShader9_GetVariant( struct NinePixelShader9 *This )
{
void *cso;
- uint32_t key;
+ uint64_t key;
key = This->next_key;
if (key == This->last_key)
return This->last_cso;
- cso = nine_shader_variant_get(&This->variant, key);
+ cso = nine_shader_variant_get64(&This->variant, key);
if (!cso) {
struct NineDevice9 *device = This->base.device;
struct nine_shader_info info;
@@ -156,11 +157,13 @@ NinePixelShader9_GetVariant( struct NinePixelShader9 *This )
info.byte_code = This->byte_code.tokens;
info.sampler_mask_shadow = key & 0xffff;
info.sampler_ps1xtypes = key;
+ info.fog_enable = device->state.rs[D3DRS_FOGENABLE];
+ info.fog_mode = device->state.rs[D3DRS_FOGTABLEMODE];
hr = nine_translate_shader(This->base.device, &info);
if (FAILED(hr))
return NULL;
- nine_shader_variant_add(&This->variant, key, info.cso);
+ nine_shader_variant_add64(&This->variant, key, info.cso);
cso = info.cso;
}