aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/d3d1x/gd3d11
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-10-20 18:37:07 +0200
committerChristoph Bumiller <[email protected]>2011-10-21 23:00:36 +0200
commitd2cc8aedb5d544608842b58b6ae4754313ded939 (patch)
treea3bb70799326a724755022518945a4971c40fa07 /src/gallium/state_trackers/d3d1x/gd3d11
parent47eb8a23eb03d885353442221ea24a8928d2c31a (diff)
d3d1x: add shader signature to sm4_program
Correct linkage requires examining the signature itself, it cannot be reconstructed from declarations only since unused registers may have been omitted from them.
Diffstat (limited to 'src/gallium/state_trackers/d3d1x/gd3d11')
-rw-r--r--src/gallium/state_trackers/d3d1x/gd3d11/d3d11_misc.h8
-rw-r--r--src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h16
2 files changed, 19 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_misc.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_misc.h
index 357f51bcb9b..85c694fdf15 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_misc.h
+++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_misc.h
@@ -52,7 +52,7 @@ HRESULT D3D10GetInputSignatureBlob(
ID3D10Blob **signature_blob
)
{
- dxbc_chunk_signature* sig = dxbc_find_signature(shader_bytecode, bytecode_length, false);
+ dxbc_chunk_signature* sig = dxbc_find_signature(shader_bytecode, bytecode_length, DXBC_FIND_INPUT_SIGNATURE);
if(!sig)
return E_FAIL;
@@ -65,7 +65,7 @@ HRESULT D3D10GetOutputSignatureBlob(
ID3D10Blob **signature_blob
)
{
- dxbc_chunk_signature* sig = dxbc_find_signature(shader_bytecode, bytecode_length, true);
+ dxbc_chunk_signature* sig = dxbc_find_signature(shader_bytecode, bytecode_length, DXBC_FIND_OUTPUT_SIGNATURE);
if(!sig)
return E_FAIL;
@@ -79,10 +79,10 @@ HRESULT D3D10GetInputAndOutputSignatureBlob(
)
{
dxbc_chunk_signature* sigs[2];
- sigs[0] = dxbc_find_signature(shader_bytecode, bytecode_length, false);
+ sigs[0] = dxbc_find_signature(shader_bytecode, bytecode_length, DXBC_FIND_INPUT_SIGNATURE);
if(!sigs[0])
return E_FAIL;
- sigs[1] = dxbc_find_signature(shader_bytecode, bytecode_length, true);
+ sigs[1] = dxbc_find_signature(shader_bytecode, bytecode_length, DXBC_FIND_OUTPUT_SIGNATURE);
if(!sigs[1])
return E_FAIL;
diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
index 617bd435099..33cea8380cd 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
+++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
@@ -600,7 +600,7 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen
// putting semantics matching in the core API seems to be a (minor) design mistake
- struct dxbc_chunk_signature* sig = dxbc_find_signature(shader_bytecode_with_input_signature, bytecode_length, false);
+ struct dxbc_chunk_signature* sig = dxbc_find_signature(shader_bytecode_with_input_signature, bytecode_length, DXBC_FIND_INPUT_SIGNATURE);
D3D11_SIGNATURE_PARAMETER_DESC* params;
unsigned num_params = dxbc_parse_signature(sig, &params);
@@ -1211,6 +1211,20 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen
if(dump)
sm4->dump();
+ struct dxbc_chunk_signature* sig;
+
+ sig = dxbc_find_signature(shader_bytecode, bytecode_length, DXBC_FIND_INPUT_SIGNATURE);
+ if(sig)
+ sm4->num_params_in = dxbc_parse_signature(sig, &sm4->params_in);
+
+ sig = dxbc_find_signature(shader_bytecode, bytecode_length, DXBC_FIND_OUTPUT_SIGNATURE);
+ if(sig)
+ sm4->num_params_out = dxbc_parse_signature(sig, &sm4->params_out);
+
+ sig = dxbc_find_signature(shader_bytecode, bytecode_length, DXBC_FIND_PATCH_SIGNATURE);
+ if(sig)
+ sm4->num_params_patch = dxbc_parse_signature(sig, &sm4->params_patch);
+
struct pipe_shader_state tgsi_shader;
memset(&tgsi_shader, 0, sizeof(tgsi_shader));
tgsi_shader.tokens = (const tgsi_token*)sm4_to_tgsi(*sm4);