summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/python/samples
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-07-14 10:45:40 +0900
committerJosé Fonseca <[email protected]>2008-07-14 12:41:06 +0900
commit05a23e6c6f08d4d901dc9fc9995b3444fa6355dd (patch)
treed9c399afb7cad207eb2100198526457c0a48ce3d /src/gallium/state_trackers/python/samples
parent16c2267d55fb14d0ffcb676540345a14ecc0f323 (diff)
python: Allow to create/specify shaders.
Diffstat (limited to 'src/gallium/state_trackers/python/samples')
-rw-r--r--src/gallium/state_trackers/python/samples/simple.py29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/python/samples/simple.py b/src/gallium/state_trackers/python/samples/simple.py
index 77e182b6447..6e90eec28ae 100644
--- a/src/gallium/state_trackers/python/samples/simple.py
+++ b/src/gallium/state_trackers/python/samples/simple.py
@@ -103,7 +103,9 @@ def test(dev):
ctx.set_sampler(0, sampler)
# texture
- texture = dev.texture_create(PIPE_FORMAT_A8R8G8B8_UNORM, width, height, usage=PIPE_TEXTURE_USAGE_RENDER_TARGET)
+ texture = dev.texture_create(PIPE_FORMAT_A8R8G8B8_UNORM,
+ width, height,
+ usage=PIPE_TEXTURE_USAGE_RENDER_TARGET)
ctx.set_sampler_texture(0, texture)
# drawing dest
@@ -116,12 +118,29 @@ def test(dev):
ctx.set_framebuffer(fb)
# vertex shader
- # vs = Shader()
- #ctx.set_vertex_shader(vs)
+ vs = Shader('''
+ VERT1.1
+ DCL IN[0], POSITION, CONSTANT
+ DCL IN[1], GENERIC[0], CONSTANT
+ DCL OUT[0], POSITION, CONSTANT
+ DCL OUT[1], GENERIC[0], CONSTANT
+ 0:MOV OUT[0], IN[0]
+ 1:MOV OUT[1], IN[1]
+ 2:END
+ ''')
+ #vs.dump()
+ ctx.set_vertex_shader(vs)
# fragment shader
- #fs = Shader()
- #ctx.set_fragment_shader(fs)
+ fs = Shader('''
+ FRAG1.1
+ DCL IN[0], COLOR, CONSTANT
+ DCL OUT[0], COLOR, CONSTANT
+ 0:MOV OUT[0], IN[0]
+ 1:END
+ ''')
+ #fs.dump()
+ ctx.set_fragment_shader(fs)
if 0:
nverts = 4