Lines Matching refs:shader

2  * GLSL pixel and vertex shader implementation
34 * D3D shader asm has swizzles on source parameters, and write masks for
103 /* GLSL shader private data */
262 "Vertex shader was successfully compiled to run on hardware.\n", /* fglrx */
263 "Fragment shader was successfully compiled to run on hardware.\n", /* fglrx, with \n */
264 "Fragment shader was successfully compiled to run on hardware.", /* fglrx, no \n */
265 "Fragment shader(s) linked, vertex shader(s) linked. \n ", /* fglrx, with \n */
266 "Fragment shader(s) linked, vertex shader(s) linked.", /* fglrx, no \n */
267 "Vertex shader(s) linked, no fragment shader(s) defined. \n ", /* fglrx, with \n */
268 "Vertex shader(s) linked, no fragment shader(s) defined.", /* fglrx, no \n */
269 "Fragment shader(s) linked, no vertex shader(s) defined. \n ", /* fglrx, with \n */
270 "Fragment shader(s) linked, no vertex shader(s) defined.", /* fglrx, no \n */
306 WDLOG(("Spam received from GLSL shader #%u:\n", obj));
311 WDLOG(("Error received from GLSL shader #%u:\n", obj));
318 static void shader_glsl_dump_shader_source(const struct wined3d_gl_info *gl_info, GLhandleARB shader)
325 GL_EXTCALL(glGetObjectParameterivARB(shader, GL_OBJECT_SHADER_SOURCE_LENGTH_ARB, &tmp));
330 ERR("Failed to allocate %d bytes for shader source.\n", tmp);
336 WDLOG(("Object %u:\n", shader));
337 GL_EXTCALL(glGetObjectParameterivARB(shader, GL_OBJECT_SUBTYPE_ARB, &tmp));
339 GL_EXTCALL(glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &tmp));
345 GL_EXTCALL(glGetShaderSourceARB(shader, source_size, NULL, source));
349 WDLOG(("*****shader source***\n"));
351 WDLOG(("\n*****END shader source***\n\n"));
399 ERR("this is a program, but shader expected");
417 ERR("this is a shader, but program expected");
436 * Loads (pixel shader) samplers
642 TRACE("No need to load local float constants for this shader\n");
646 /* Immediate constants are clamped to [-1;1] at shader creation time if needed */
719 FIXME("Unknown shader type %#x.\n",
770 static const struct ps_np2fixup_info * get_fixup_info(const IWineD3DPixelShaderImpl *shader, UINT inp2fixup_info)
772 struct glsl_pshader_private *shader_data = shader->baseShader.backend_data;
777 if (!shader->baseShader.backend_data)
782 shader_data = shader->baseShader.backend_data;
872 /* Load DirectX 9 float constants/uniforms for vertex shader */
876 /* Load DirectX 9 integer constants/uniforms for vertex shader */
880 /* Load DirectX 9 boolean constants/uniforms for vertex shader */
893 /* Load DirectX 9 float constants/uniforms for pixel shader */
897 /* Load DirectX 9 integer constants/uniforms for pixel shader */
901 /* Load DirectX 9 boolean constants/uniforms for pixel shader */
1055 /* Unless the shader uses indirect addressing, always declare the maximum array size and ignore that we need some
1057 * declare VC[256]. If the shader needs more uniforms than we have it won't work in any case. If it uses less, the
1058 * compiler will figure out which uniforms are really used and strip them out. This allows a shader to use c255 on
1061 * If the shader uses indirect addressing the compiler must assume that all declared uniforms are used. In this case,
1065 * 1) The shader really uses more uniforms than supported
1066 * 2) The shader uses indirect addressing, less constants than supported, but uses a constant index > #supported consts
1078 * The shader code only uses 0.5, 2.0, 1.0, 128 and -128 in vertex shader code, so one vec4 should be enough
1092 /* tmp work-around to make Internet Explorer in win8 work with GPU supporting only with 256 shader uniform vars
1138 /* Predeclaration; This function is added at link time based on the pixel shader.
1139 * VS 3.0 shaders have an array OUT[] the shader writes to, earlier versions don't have
1140 * that. We know the input to the reorder function at vertex shader compile time, so
1141 * we can deal with that. The reorder function for a 1.x and 2.x vertex shader can just
1142 * read gl_FrontColor. The output depends on the pixel shader. The reorder function for a
1143 * 1.x and 2.x pshader or for fixed function will write gl_FrontColor, and for a 3.0 shader
1144 * it will write to the varying array. Here we depend on the shader optimizer on sorting that
1188 * actually used, only the max limit of the shader version
1274 /* Declare input register varyings. Only pixel shader, vertex shaders have that declared in the
1275 * helper function shader that is linked in at link time
1283 /* TODO: Write a replacement shader for the fixed function vertex pipeline, so this isn't needed.
1284 * For fixed function vertex processing + 3.0 pixel shader we need a separate function in the
1285 * pixel shader that reads the fixed function color into the packed input registers.
1324 /* Local constants use a different name so they can be loaded once at shader link time
1325 * They can't be hardcoded into the shader text via LC = {x, y, z, w}; because the
1446 IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
2239 * shader versions WINED3DSIO_MOVA is used for this. */
2453 * For shader model 1.x, do the following (and honor the writemask, so use a temporary variable):
2984 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
2997 LIST_FOR_EACH_ENTRY(constant, &shader->baseShader.constantsI, local_constant, entry) {
3016 shader->baseShader.cur_loop_depth, loop_control.start,
3017 shader->baseShader.cur_loop_depth, loop_control.count, loop_control.step, loop_control.start,
3018 shader->baseShader.cur_loop_depth, loop_control.step);
3023 shader->baseShader.cur_loop_depth, loop_control.start,
3024 shader->baseShader.cur_loop_depth, loop_control.count, loop_control.step, loop_control.start,
3025 shader->baseShader.cur_loop_depth, loop_control.step);
3030 shader->baseShader.cur_loop_depth, loop_control.start, shader->baseShader.cur_loop_depth,
3031 shader->baseShader.cur_loop_depth, loop_control.count,
3032 shader->baseShader.cur_loop_depth);
3037 shader->baseShader.cur_loop_depth, shader->baseShader.cur_loop_regno,
3038 src1_param.reg_name, shader->baseShader.cur_loop_depth, src1_param.reg_name,
3039 shader->baseShader.cur_loop_depth, shader->baseShader.cur_loop_regno, src1_param.reg_name);
3042 shader->baseShader.cur_loop_depth++;
3043 shader->baseShader.cur_loop_regno++;
3048 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3054 shader->baseShader.cur_loop_depth--;
3055 shader->baseShader.cur_loop_regno--;
3060 shader->baseShader.cur_loop_depth--;
3066 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3074 LIST_FOR_EACH_ENTRY(constant, &shader->baseShader.constantsI, local_constant, entry)
3086 shader->baseShader.cur_loop_depth, shader->baseShader.cur_loop_depth,
3087 control_values[0], shader->baseShader.cur_loop_depth);
3091 shader->baseShader.cur_loop_depth, shader->baseShader.cur_loop_depth,
3092 src0_param.param_str, shader->baseShader.cur_loop_depth);
3094 shader->baseShader.cur_loop_depth++;
3161 /* No-op. The closing } is written when a new function is started, and at the end of the shader. This
3171 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3172 IWineD3DDeviceImpl *deviceImpl = (IWineD3DDeviceImpl *)shader->baseShader.device;
3263 IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3298 IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3324 WARN("Using %s in fragment shader.\n", sample_function.name);
3495 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3499 SHADER_PARSE_STATE* current_state = &shader->baseShader.parse_state;
3531 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3532 SHADER_PARSE_STATE *current_state = &shader->baseShader.parse_state;
3556 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3557 SHADER_PARSE_STATE *current_state = &shader->baseShader.parse_state;
3575 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3581 SHADER_PARSE_STATE* current_state = &shader->baseShader.parse_state;
3607 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3611 SHADER_PARSE_STATE* current_state = &shader->baseShader.parse_state;
3642 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
3643 IWineD3DDeviceImpl *deviceImpl = (IWineD3DDeviceImpl *)shader->baseShader.device;
4105 /* so far we assume that if texcoord_mask has any write flags, they are assigned appropriately with pixel shader */
4135 /* That one is easy: The vertex shader writes to the builtin varyings, the pixel shader reads from them.
4158 /* The vertex shader writes to its own varyings, the pixel shader needs them in the builtin ones */
4213 /* This one is tricky: a 3.0 pixel shader reads from a 3.0 vertex shader */
4217 /* First, sort out position and point size. Those are not passed to the pixel shader */
4235 /* Then, fix the pixel shader input */
4243 /* The vertex shader wrote to the builtin varyings. There is no need to figure out position and
4244 * point size, but we depend on the optimizers kindness to find out that the pixel shader doesn't
4251 ERR("Unexpected vertex and pixel shader version condition: vs: %d, ps: %d\n", vs_major, ps_major);
4265 static void hardcode_local_constants(IWineD3DBaseShaderImpl *shader, const struct wined3d_gl_info *gl_info,
4273 LIST_FOR_EACH_ENTRY(lconst, &shader->baseShader.constantsF, local_constant, entry) {
4296 /* Create the hw GLSL shader object and assign it as the shader->prgId */
4350 /* Pixel shader < 3.0 do not replace the fog stage.
4383 TRACE("Compiling shader object %p\n", (void *)(uintptr_t)shader_obj);
4388 /* Store the shader object */
4406 /* Create the hw GLSL shader program and assign it as the shader->prgId */
4429 /* The D3DRS_FOGTABLEMODE render state defines if the shader-generated fog coord is used
4432 * the shader, it is set to 0.0(fully fogged, since start = 1.0, end = 0.0)
4463 TRACE("Compiling shader object %p\n", (void *)(uintptr_t)shader_obj);
4472 struct wined3d_shader_buffer *buffer, IWineD3DPixelShaderImpl *shader,
4484 if (!shader->baseShader.backend_data)
4486 shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
4487 if (!shader->baseShader.backend_data)
4493 shader_data = shader->baseShader.backend_data;
4495 /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
4509 TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
4535 pixelshader_update_samplers(&shader->baseShader.reg_maps,
4536 ((IWineD3DDeviceImpl *)shader->baseShader.device)->stateBlock->textures);
4539 ret = shader_glsl_generate_pshader(context, buffer, shader, args, np2fixup);
4554 struct wined3d_shader_buffer *buffer, IWineD3DVertexShaderImpl *shader,
4560 DWORD use_map = ((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.use_map;
4564 if (!shader->baseShader.backend_data)
4566 shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
4567 if (!shader->baseShader.backend_data)
4573 shader_data = shader->baseShader.backend_data;
4575 /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
4586 TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
4611 ret = shader_glsl_generate_vshader(context, buffer, shader, args);
4617 /** Sets the GLSL program ID for the given pixel and vertex shader combination.
4653 TRACE("Created new GLSL shader program %p\n", (void *)(uintptr_t)programId);
4680 TRACE("Attaching GLSL shader object %p to program %p\n", (void *)(uintptr_t)reorder_shader_id, (void *)(uintptr_t)programId);
4688 TRACE("Attaching GLSL shader object %p to program %p\n", (void *)(uintptr_t)vshader_id, (void *)(uintptr_t)programId);
4720 TRACE("Attaching GLSL shader object %p to program %p\n", (void *)(uintptr_t)pshader_id, (void *)(uintptr_t)programId);
4728 TRACE("Linking GLSL shader program %p\n", (void *)(uintptr_t)programId);
4792 /* Set the shader to allow uniform loading on it */
4807 * vertex shader with fixed function pixel processing is used we make sure that the card
4949 * called between selecting the shader and using it, which results in wrong fixup for some frames. */
5017 /* Note: Do not use QueryInterface here to find out which shader type this is because this code
5206 ERR("Failed to initialize shader buffer.\n");
5218 ERR("Failed to initialize vertex shader constant heap\n");
5223 ERR("Failed to initialize pixel shader constant heap\n");
5285 * using ARB_vertex_program. It is safe to assume that when a card supports pixel shader 2.0 it
5286 * supports vertex shader 2.0 too and the way around. We can detect ps2.0 using the maximum number
5287 * of native instructions, so use that here. For more info see the pixel shader versioning code below.
5295 TRACE_(d3d_caps)("Hardware vertex shader version %d.%d enabled (GLSL)\n", (pCaps->VertexShaderVersion >> 8) & 0xff, pCaps->VertexShaderVersion & 0xff);
5298 /* Older DX9-class videocards (GeforceFX / Radeon >9500/X*00) only support pixel shader 2.0/2.0a/2.0b.
5324 * The problem is that the refrast clamps temporary results in the shader to
5327 * the shader will generate incorrect results too. Unfortunately, GL deliberately doesn't
5331 TRACE_(d3d_caps)("Hardware pixel shader version %d.%d enabled (GLSL)\n", (pCaps->PixelShaderVersion >> 8) & 0xff, pCaps->PixelShaderVersion & 0xff);